Saturday, September 26, 2009

Today is a Milestone

 Today marks the day I have been Smoke-Free for 1 month.  I even got a certificate from the Quit Plan that I can print out to prove it.  I have to say, after smoking for almost 30 years I didn't know if it would "take". I DID however use smoking cessation medication to help and I'm glad I did.  In the past I've tried the Cold Turkey and Taper Off methods and they just didn't do it for me.  I used lots of little things to help quit.  One month prior to quitting I changed my routine in a number of ways to break the smoking association.  I also started to only smoke outside.  This accomplished two things. I only smoked when I really wanted to and thereby cut down on the "mindless light one up" syndrome.  Secondly, it kept the house smelling better.
 The night before my quit day, instead of dreading it like other attempts, I welcomed it as a new day and a new start of sorts in life.  I hope that doesn't sound corny.
  I also read the Quit Plan forum to see how others were doing, what they went through, and to see what kind of withdrawal symptoms I could expect.  I found out that some quitters had smoked up to 3 packs of cigarettes a day.  Uff-da as my grandpa would say.  
  Another thing I did was give myself a hobby to occupy my mind.  So I started to learn ActionScript 3 and Koolmoves.  Fun AND useful at the same time.  About a day into the quit I was looking at someones Flash site and can you believe it - a smoking cigarette used as a pre-loader!  Not what I needed, but still kind of neat.  As the movie was loaded the cherry would burn down! 
  I've saved about $255 in one month not smoking.  Maybe I should say that's $255 that didn't get spent on smokes. 
  "So what?" you say? I know I'm not the first person to quit smoking, I just had to shout it from the rooftops a little.

Friday, September 25, 2009

Koolmoves and the trace() statement

Getting Started
Unlike Flash, Koolmoves does not ship with an output panel to debug code. This can be corrected by installing the FlashLog Viewer from the KoolExchange. Once you have downloaded it you can pin it to your start menu for easy access. It works as a standalone viewer. You also need the debugger version of the Flash Player.

I have the latest debug Flash Player version installed for Mozilla Firefox and Koolmoves set to use the default browser rather than the native Internet Explorer. This can be set in Preferences/Player. You also need to set Firefox as the default browser on your computer.


The trace() statement
Once you are set up you can open your viewer as well as the Actionscript editor in Koolmoves. From author Derrick Ypenburg:


“The trace() statement will become your best friend in ActionScript development. Much of the ActionScript functionality you will create does not have a visual result on the stage, so it can be difficult to tell if your ActionScript is doing its job properly in the background. The trace() statement displays the results of your ActionScript as messages in the Output panel at runtime. The Output panel is also used to display loading errors and other non-ActionScript errors at runtime. You can also use the trace() statement to alert you when a task has begun and when it has completed.”

If one is to have a reasonable level of success with learning ActionScript in Koolmoves they will need this functionality. To see how this works, enter this code into the Action Script Editor:



In the Flash Log Viewer you should get a result that looks like this:





The first trace() statement is a String indicated by quotation marks. The statement will output anything in the quotation marks directly as written. In the second statement we have Numbers performing a math operation, and the trace() statement outputs the result of that operation.

You can also trace a variable as in:



We are are defining these two variables as Numbers and therefore we expect a Number in the result.
Place a zero after "num1"  to make it "num10" inside the trace() statement and it returns an error in the Flash Log Viewer:





When you get this result you know you need to go back and find the error and the Viewer tells you there is something wrong with var num10.  This shows how the trace() statement can be utilized in Koolmoves. As you continue to learn you will use this statement a lot. It also helps you see how the code you write works. Happy tracing.

Thursday, September 24, 2009

Koolmove Component Class Documentation and Manipulation

I finally came to understand something in Koolmoves with the help of one of the developers of the Koolmoves Components.  You see, Koolmoves ships with a great set of custom made components that you can drag onto the stage and assign certain properties via the properties panel. These components are all built with ActionScript and saved as Koolmove classes. I know this will sound confusing to anyone not familiar with the product.  Hang in there.

Now in Flash 9 or 10 mode you have to use ActionScript to assign different properties. You can go to the Documention of the Components to find out what properties, methods and functions can be used with each component. However, the Documentation only goes so far.

"The KoolMoves docs stop whenever an intrinsic flash player class is reached."
So there are other properties that can be used that may not be listed in the Koolmoves Documentation by virtue of the fact that these components inherit properties and methods from their parent classes. An example might be in order. This came form a question on the Koolmoves forum at Flashkit.

If you drag a Contentpane onto the stage and access it properties via the propeties dialog you will notice that you can "hide scrollbars" in Flash 8 which uses ActionScript 1 but you cannot in Flash 9 or 10 which uses ActionScript 3. So how does one accomplish this? By writing ActionScript 3 code in the ActionScript panel.

Now if you look in the Documentation for the Contenetpane you will scratch your head (or your hump) like me and wonder what to do. Assuming your Contentpane is named "contentpane1" you might get this far:

contentpane1.hScrollBar. ???
Here we are trying to get to the horizontal ScrollBar in the contentpane and do someting with it.  But when we consult the Koolmoves documentation we can't find anything like "Hide" or "getRidOf".  But we will find that the hScrollBar is an instance of ScrollBar. Still nothing. But we have a clue!  Now if we look at the add syntax menu indicated by the "+" symbol in the ActionScript panel and look at the properties of ScrollBar we will see visible. Now we are getting somewhere and can write:

contentpane1.hScrollBar.visible ???
Now we don't have any information on how to use this visible property in the Koolmoves program because the documentation stops at the intrinsic flash player class which in this case is Sprite, which has as one of it's properties visible.  Sprite got visible from the class DisplayObject which is the source of the visible property.  Think of visible as a genetic trait that is passed down through children. The geneology(so to speak) of this visible property is this:


ScrollBar > UIComponent > Sprite > DisplayObjectContainer > InteractiveObject > DisplayObject
Now to find out how to use visible we need to consult the ActionScript 3 Language Reference found at Adobe and we see that visible calls for a Boolean which is true or false. We could then write it like this:

contentpane1.hScrollBar.visible = false;

When we go to test our movie we will have a contentpane with the Horizontal Scroll Bar hidden.





This begins to show how the components shipped with Koolmoves can be manipulated for individual use, how to track down code applicable to the component in question, and demonstartes at least in part the inheritance aspect of AS3.


Wednesday, September 23, 2009

Koolmoves 7.2.1 released

Koolmoves 7.2.1 has been released as the first build of the new Flash 10 capable version. Pretty cool with new Filter effects available to apply.  Presently, Koolmove users can publish in with ActionScript 1 & 3.  See some of the great work at the Koolmoves Gallery.  Why not check it out?

Eye-gor's Place is up and Running

Just a first post to see how this blogger stuff works. Thought I might try my hand at putting some stuff together that some might find useful. Stay tuned!