Jump to content
GreenSock

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

Problem loading a swf and then playing it

Recommended Posts

Hello. I load a swf using:

 

var loaderMax:LoaderMax = new LoaderMax({name:"main-site", auditSize:false});

loaderMax.append( new SWFLoader("assets/swf/mySwf.swf", { name:"mySwf_loader", estimatedBytes:20000, autoPlay:false } ) );

 

After the swf has succesfuly loaded, I try to play it using as you suggest in another forum

LoaderMax.getLoader("mySwf_loader").rawContent.play();

 

BUT... it returns error

[Fault] exception, information=ReferenceError: Error #1069: Property play not found on flash.display.Loader and there is no default value.

 

Why?? It has driven me nuts. Please help!

Link to comment
Share on other sites

Sounds like you ran into a security error - Flash prevented your child swf from being accessed directly by the parent swf (I assume you're cross loading from another domain without a proper crossdomain.xml file in place) so LoaderMax automatically fell back to a less permissive mode. As indicated in the ASDocs, the "rawContent" will point to the Loader object instead of the root DisplayObject of the child swf in this scenario. So technically you're trying to call play() on a Loader instance which can't work.

 

See what I mean?

Link to comment
Share on other sites

Well, that was not the case, but I solved it. My flash website is made using Actionscript3, but the swf I was trying to load and play was made using Actionscript2!!!! I recompiled the swf using AS3 and all works good now! Thanks anyway. Without your 'security error' description I wouldn't have thought to check the swf language.

Link to comment
Share on other sites

By the way, what if I want to load an AS2 swf to an AS3 project using LoaderMax? Can I do this?

Link to comment
Share on other sites

By the way, what if I want to load an AS2 swf to an AS3 project using LoaderMax? Can I do this?

Sure. Of course I'd definitely recommend using all AS3 stuff. AS2 is a dying language :)

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.
×