currentLabel and currentLabels were a great improvement in flash. About 1 year ago I had a project with lots of characters animations, and as you know sometimes working with designers is not easy. The problem was that I had to run functions when the characters where doing some actions and some of those actions were not controlled by me, there were just embedded in the timeline. If all the animations where equal, like jump in frame 10 I could use the currentframe propriety, but they were not. That work was a really mess, but now with the help of those properties is easy.
On the next example:
Using currentLabels propriety we associated labels to functions, so when the playhead passes throw some label, the respective function is called.
We use currentLabel like a state variable that tells what is the current action of the animation. The movieClip: The code:
Last week, while developing an actionscript application, we had the need to read files stored inside a zip file. Our first approach was to use Zinc to deflate the zip file into a temporary directory.
Because some problems arouse with ZINC I took sometime to read about this AS3 Zip Library As it turns out it does a great job and reading and building zip files and it's really easy to use. Make sure you download and install the Library.
After playing around with this Library for a while I wanted to display some images I had inside the zip file. The issue was how to convert a ByteArry into a BitmapData. It took me a while to figure it out , but as it turns out it's really easy.
There is a little __undocumented__ function that can be very useful sometimes called addFrameScript. It allows you to specify a function that is called when the playhead of the Movieclip timeline enters the specified frame number. This can be a great improvement if you don’t want to write code directly on the timeline or if you don’t want to add an EnterFrame listener to the movieClip.
A couple of months ago I wanted to instantiate classes based on their name at runtime, using Flex Builder. At the time I read about the method getDefinitionByName. Everytime I tried to use it I got the error
Error #1009: Cannot access a property or method of a null object reference.  Â
I googled about it and found Daniel R. post on the subject. According to him
"The problem seems to be that if the runtime module makes a side-effect reference to a component, which is not included in the main application, it never really gets included in the SWF and as such causes problems when accessed"Â Â Â
And his solution was to declare a static instance of the class you wanted to instantiate at runtime.
private static const classInstance:ClassToInstantiate = null;Â Â Â
This *fix* becomes a problem when you have many classes to instantiate and have to declare an instante for each one. If the classes you want to instantiate are in the flash library (movieclips), there is a workaround for the problem described above.
When you export the Flash library, remember to check the "Export SWC".
Make sure you include the SWC in the Flex Builder.
(Here's the Magic) Just use this arguments in the compiler options:
You want to have that tipical html effect when rolling over a text link showing text underlined? That is one of thouse things that is hard to understand how Marcromedia/Adobe didn't support this from the very beginning.
Sure you can have your text field as html and have your content defined by code with html tags and all, but do you really want to go through all that trouble. Shouldn't that be more simple just using static text?
I came up to a quite simple solution:
Basically styleSheet is created with the underline style which is applied for every object on a MovieClip. Check it out (AS2):
That's it! The underline effect on a link roll over is active for every static or dynamic text field on stage.
Our Goals
+ Help the community
+ Explore the Flash platform
+ Create a better world
+ Research and play
Startups
We're looking for stories about startups using Flex/Flash technology. Drop us a quick e-mail or mention it to us via our Twitter account @dreaminginflash, thanks!