Run a flash movie in flex application.
- by Irwin
I've a flash movie that I would like to use inside of a flex application, very similar to a preloader.
Looking at this tutorial, http://www.flexer.info/2008/02/07/very-first-flex-preloader-customization/, I expected it would be a matter of not extending "Preloader" and extending "Sprite" and using the class i created wherever i needed.
Alas, the movie I created, is not being shown.
This is the code for my class containing the movie, made based on the tutorial above:
package
{
import mx.preloaders.DownloadProgressBar;
import flash.display.Sprite;
import flash.events.ProgressEvent;
import flash.events.Event;
import mx.events.FlexEvent;
import flash.display.MovieClip;
public class PlayerAnimation extends Sprite
{
[Embed("Player.swf")]
public var PlayerGraphic:Class;
public var mc:MovieClip;
public function PlayerAnimation():void
{
super();
mc = new PlayerGraphic();
addChild(mc);
}
public function Play():void
{
mc.gotoAndStop(2);
}
}
}