Created
January 6, 2010 17:00
-
-
Save scottdavis/270411 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mx.controls.Image; | |
[Embed(source='Fig23_Clip1.swf', mimeType='application/octet-stream')] | |
public static var MySwf:Class; | |
public function init() :void { | |
var swf:Object = new MySwf(); | |
var myLoader:Loader = new Loader; | |
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded); | |
myLoader.loadBytes(ByteArray(swf)); | |
} | |
public function loaded(e:Event) :void { | |
var timeline:MovieClip = e.currentTarget.content as MovieClip; | |
timeline.gotoAndStop(0); | |
timeline.play(); | |
trace(timeline.framesLoaded); | |
var img:Image = new Image; | |
img.source = timeline; | |
canvas.addChild(img); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment