Jump to content

Search In
  • More options...
Find results that contain...
Find results in...

how to load from external swf library

Recommended Posts

Basically what the title says.  How would I access a library movieclip from an externally loaded swf with swfloader?  The following is from a tutorial:

var loader:SWFLoader = new SWFLoader("path/to/file.swf", {name:"coupons", container:this, alpha:0, onComplete:completeHandler});
            function completeHandler(e:LoaderEvent):void{
                TweenLite.to(e.target.content, 1, {alpha:1});    
                var librarySymbol:Class = loader.getClass("splashes");
                var myInstance:MovieClip = new librarySymbol();

However that gives me the following error cannot convert splashes@5adcdc1 to flash.display.MovieClip.



Link to comment
Share on other sites

It sounds like your librarySymbol isn't a MovieClip. Maybe it extends Sprite or something else? Just make sure you're giving it the correct data type (in this case, Flash is telling you it's not a MovieClip). 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.