Matrix class and object transformations in ActionScript3
For DisplayObject descendant classes we can use transform property to append any transformation. In AS3 (FP9) only affine transformations are possible, with use of Matrix class.
Transformation property defines how object is transformed, before it is drawn to its
parent canvas. Every object has its own (local) coordinate system, its orgin is used as position of object in parent coordinate system (an it is called registration point).
[read more]
Saving local SWF files from an image bitmap in AIR
In AIR applications images loaded with Loader class are internally stored as a single frame, not compressed SWF file. As far as I know, this isn't documented anywhere, but it seems to work this way. This also fast way to convert local image file (png, jpg or gif) to swf format. We will use this method to create save local swf file from any image that is stored in BitmapData class instance.
[read more]
Duplicate Loader object
is it possible to clone Loader instance to save some bandwidth ?
yes this is possible
Solution of this problem depends on type of loaded media. Lets take a look on how to clone loaded media
-
if you've loaded image (png, jpg or gif) file, and your not going to do any pixel level manipulation
var s:Bitmap = new Bitmap( (oldLoader.getChildAt(0) as Bitmap).bitmapData )
using this to create multiple bitmaps can also save used memory - only one BitmapData instance is created and shared across all bitmaps
if you need to do any pixel level editing, its important to first clone BitmapData ! -
if you've loaded swf file. you can clone Loader and use its loadBytes public method to load already loaded data
newLoader.loadBytes( oldLoader.contentLoaderInfo.bytes )
flashCS3 - notes #1
first part of my "migrating to as3" notes. lots of things have changed in new flashCS3. here are some i have to remeber about :
1. now its is possible to change parent of specified MovieClip (writing MovieClip i mean any subclass of InteractiveObject)
2. old MCs methods like attachMovie and createEmptyMovieClip are gone. now to achive the same effect you simply create MC instance and using method addChild append it to the parent MC.
1 , 2 , next (older)