Run a flash movie in flex application.

Posted by Irwin on Stack Overflow See other posts from Stack Overflow or by Irwin
Published on 2009-07-27T21:13:52Z Indexed on 2010/05/30 14:12 UTC
Read the original article Hit count: 308

Filed under:
|
|

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);
    	}
    }
}

© Stack Overflow or respective owner

Related posts about flex

Related posts about flash