If and Else statements with Actionscript

May 27th, 2007 · 4 Comments

If you are a beginner when it comes to development, the concept of an if/else statement is probably something you know without actually realizing that you know it. It is one of the simpler theories of development that you can learn.

If statements are logic processes that we use every day to make decisions and the logic that applies to those types of real life situations is the exact same logic that applies to Actionscript. For example, if you are hungry, you go get something to eat. Breaking a statement like that down into Actionscript is very easy. Take a look at the following code.

Code (actionscript)
  1.  
  2. if(hungry == true){
  3.         this.gotoAndPlay("timeToEat");
  4. }
  5.  

[ Read more Read More ]

4 Comments 4 CommentsTags: Flash Tutorials · Actionscript 2.0 · Tutorials

3 Tips to Help Debug Your Actionscript

May 6th, 2007 · 1 Comment

It would be a slight understatement for me to say that every once in a while something in Flash doesn’t work. Bugs, errors and other quirks are all too common in Flash development, and learning how to find them quickly is key to being more productive, and learning how to avoid mistakes in the future.

One thing that I have noticed is new Actionscript developers tend to debug by the philosophy:

“If at first you don’t succeed, try again.”

While this might be a great philosophy for many aspects of life, but it just makes you waste time when it comes to debugging your Actionscript. Without proper debugging you have no way of knowing if the code you are changing is actually what is causing the problem.

[ Read more Read More ]

One Comment 1 CommentTags: Flash Tutorials · Actionscript 2.0 · Tutorials

Tweening with Actionscript

May 1st, 2007 · 5 Comments

Sometimes, it is just easier to tween with code. Sometimes there is no option. Tweening with the tween class is most effective for repetitive animations, and animations of movieclips created or attached with code.

Tween is a word that comes from between. The reasoning for this is that either through code, or timeline based tweens, you give it the start and finish settings, and then the parts in between get filled in automatically.

With this in mind, the idea of the tween class is very simple. You tell it what to tween, how to tween it, the start and end of the tween and how long to tween it.

[ Read more Read More ]

5 Comments 5 CommentsTags: Flash Tutorials · Actionscript 2.0 · Tutorials

Progress Bars with the MovieClipLoader Class

April 29th, 2007 · 2 Comments

Using a nice loader can help keep guests entertained during the times when they will have to wait while your work is loading. Some good uses for the movieClipLoader class, or mcl, include loading thumbnails or images in a photo gallery or portfolio, or loading swfs that are used as new pages or content areas of your website.

The MovieClipLoader is a variable that will broadcast events to a listener object that you assign to the loader. This listener object has functions assigned to different event names. When the listener catches one of the broadcasted events that it has been assigned a function for (in other words: told to listen for), the assigned function will be executed.

[ Read more Read More ]

2 Comments 2 CommentsTags: Flash Tutorials · Actionscript 2.0 · Tutorials