Flash on iDevices?

This looks like a pretty interesting alternative method to get Flash on the iPhone and iPad. From what I have read it sounds like it’s slower that regular Flash especially when it comes to interactive stuff like games. At this point it’s probably good for ads.

Smokescreen seems to take an SWF and convert into an SVG file and ad some javascript, so the end results are compatible with iPhone and and iPad.

http://smokescreen.us/

Thanks to Karaminder for pointing me to this.

unloadAndStop

Get rid of loaded assets when you’re done with them.

http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/Loader.html#unloadAndStop%28%29

Note: This requires Flash Player 10.

SWF files loaded into Flash can sometimes still exist after they have been removed from the stage. The is cause by teh way Flash cleans up elements. If an element is referenced by another object Flash figures it’s still in use and should no be removed.

In some cases this can work to your advantage. Imagine you have a dialog box that appears on the stage periodically to set options in your application. You can remove it from the display list, and then add it to the display list at a later time and have it in tact with all of it’s elements in the same state.

In other cases this can be a problem. For example you load an swf and then you remove it from the stage, but it still takes up RAM and might even still be running it’s enter frame or other events in the background.In this case it’s hurting the efficiency of your application.

The unloadAndStop() method tries to solve this by stopping all actions running in a loaded element and clearing the element out of RAM. The unloadAndStop() methos belongs to the Loader class. The idea is to call this method on your Loader instance to clean what you have loaded.

Video tutorials

I posted a bunch of video tutorials here: http://www.screencast.com/users/webdevils# . This is a new site with more tutorials. The last site I used was Vimeo. Their site tended to resize the videos and put more restrictions on uploads. The new site doesn’t resize or recompress the videos so the quality us much better. They also support flv, which allowed me to upload some tutorials I had in this format.

These tutorials cover various aspects of Flash from beginning to more complex stuff.

I’m going to upload the example fla files to the google code site as soon as I get a chance.

target vs currentTraget

When working with MouseEvents the event object provides two properties that refer to object that originated the event: target and currentTarget. The right choice between these two is almost always currentTarget.

The problem with target is that often it is not the object that you think it is. The target property is the object that was actually clicked. This can any object nested within the MovieClip that was clicked, and often not the MovieClip itself, which is what you are most often expecting.

The currentTarget property on the other hand is the object that registered the event. Which is almost always what you are expecting.

So for general use it should always be currentTarget. The target property does provide an interesting function but in most cases it’s not what you think it is.