Bitmap to ByteArray
by Alexis Hope, 23 Apr 2012
Some notes about using sprites from Flash Professional in Flash Builder.
1 When adding Sprites or Movie Clips to a Flex application add them to a UIcomponent first or use rawChildren.addChild() to avoid run time errors.
spritecanvas.addChild(new Sprite());
// OR
this.rawChildren.addChild(new Sprite();
2. The information on labeled timelines and labeled movieclip instances remains intact
[Embed(source="../sprites/Demo.swf", symbol="test")]
private var TimeLineTest:Class;
var TestTimeLine:MovieClip = new TimeLineTest() as MovieClip;
TestTimeLine.gotoAndPlay('timelinelabel');
// accessing sub movie clips which have been given an instance name in Flash Professional
// TestTimeLine.inception == MovieClip
3. AS3 code however does not remain intact but stop() commands do (I'm wondering if I'm missing a flag here when embedding)
A movie clip symbol in Flash Professional which is given a base class of the following
package
{
import flash.display.MovieClip;
public class TestClas extends MovieClip
{
public var TestString:String = 'Hello World!';
public function TestClas():void {
}
}
}
And then embedded into a Flex application or Flash Builder, the var TestString does not remain (nor do variables on the MovieClip's timeline)
[Embed(source="../sprites/Demo.swf", symbol="test")]
private var TestVariablesEmbed:Class;