Skip to content Skip to sidebar Skip to footer

Common mistakes in Flash development

"Experience is the name everyone gives to their mistakes". Oscar Wilde (1854 - 1900)

We all make mistakes and this is good because it is how we learn. I thought it would be a good idea to try to set up a little list of common mistakes that I regularly see in Flash development.


The infamous Roll Over effect

Many times I have landed on a nice Flash intro or website to suddenly realize that they were plagued with the "infamous roll over effect", this obviously kills the magic and is no good even for the navigation.
we have defined a hotspot by drawing an invisible rectangle on a layer under the text (pic1)
here it looks blue for demonstration purposes but the alpha for the fill color of the rectangle must be set to 0% (pic2)

hotspot
pic1 alpha pic2

This technique applies to buttons and button-movie clips see the 2 pictures below :

for buttons

for buttons-movie clip


You might be well aware of that "infamous roll over" issue but trust me there is still plenty of Flash files all over the place where you will be able to see it in action.


Incorrect naming of Instances
Very often I receive though my Flashvalley assistance requests to find out why a bit of code is not working and very often I can see that it is caused by instances which are incorrectly named. The usual mistake is to start the name of an instance with a number, this will create a silent error and it will seem that the code is not working but the real problem will be caused by an incorrect instance name. If you are unsure of the naming conventions in actionscript I strongly advise you to read naming conventions in actionscript.


Embedding fonts for dynamic text fields

If you are using a particular non-standard font that won't probably be installed on the user machine to display data in dynamic text fields, it is important to embed the characters that will be used to display the data. In Flash MX 2004 just press on the little button Character on the right hand side of the Var field (pic3). In Flash 8 press on the Embed button on the right hand side of the rendering method drop down menu (pic4).

character pic3

Embed pic4

Embedding fonts for dynamic text fields (continued)
When you click on these buttons a pop up will open and give you the choice to embed All or part of the font see pictures below :

If you are just planning to display numbers in your dynamic text fields just embed the numerals. Always try to embed what you are really going to need since embedding characters have a significant impact on the final size of your SWF.

If you don't want to embed any font I suggest you use the device font "_sans" that should display on most machines the same way you see it in the authoring environment.


Ultimate preloaders ?

There is a "preloadermania" going on all over the Web with Flash developers claiming that they created the ultimate preloader. Unfortunately most of these preloaders are not taking in account two important factors that will affect their functionality. These two factors are :
1.
If any class is set to export on frame 1 the preloader won't show on the screen until this class is loaded.
2. If any component is set to export on first frame the preloader won't show on the screen until the components are loaded.

To sort out these two issues do the following :

In the library right click on the components and select Linkage then in the window unselect Export on first frame
(pic1). Then go in File > Publish Settings, select the flash tab and next to Actionscript version click on Settings, in the window that pops up enter 2 in the field export frame for classes. (pic2)

pic1 export frame for classes pic2

Now you might be able to add the word "ultimate" in front of your preloader :)



These are just a few pitfalls to avoid, this article will be updated regularly since, as you can guess, there is a lot more to come :)

Post a Comment for "Common mistakes in Flash development"