Jump to content
Search Community

AVM1 problem

clipclicmusic test
Moderator Tag

Recommended Posts

Hi Jack

 

The restrcitions by Flash 10 converning AVM1 and AVM2 gives this when I try to move loaded objects around :

ArgumentError: Error #2180: It is illegal to move AVM1 content (AS1 or AS2) to a different part of the displayList when it has been loaded into AVM2 (AS3) content.

Is there a workaround for that ?

 

The swfs are simply images / animations. No code...

 

I found this :

http://blog.formatlos.de/2008/11/20/fla ... 1-content/

But can't figure out how to apply it teasily to your Loader.

 

Thanks

 

Jason

Link to comment
Share on other sites

Hi Jack

 

Am using version 0.91

 

Still getting the same error.

I am using swfs exported fron Ill CS4, and as this person says, that isn't ideal :

 

can confirm Illustrator CS4 “export to swf” produces AVM1 swfs. I’ve been having huge problems with this for a while now. I recently contacted Adobe to hear about CS5.

 

Being a "little" below you level in AS3, I am stuck, and can only work around by reloading the swf in its new location.

Could there be an option to optionally change the headers in LoaderMax to AVM2 ?

If I understad from here :

http://blog.formatlos.de/2008/11/20/fla ... 1-content/

That would solve the issue ?

 

Thx

 

Jason

Link to comment
Share on other sites

Hi Jack

 

When I finished up last night (when I wrote) I was sooooo tired that I couldn't get my head round anything more than where my bed is !

 

I have worked again and found lots of interesting stuff along the way - like your extremely complete code commenting... not that I uderstand it all :)

 

Here is the FLA. It loads two US flags. Click on one to move it to the second blue box.

Basically, the coffee effect this morning is that I can move loaded objects if I cast them as DisplayObject and move the loader...

If I try to move the content, I get the error mentioned.

If I try to move rawContent, I suppose the security error kicks in, and it has become a Loader (or am I still confused ?)

 

Finally, a little help - in this scenario, when clicking on the flag, what is the easiest way to get the url (and any other info) for that object (see last line of code) ?

 

Thanks

 

Jason

Link to comment
Share on other sites

I think you're just misunderstanding the structure of things...

 

The SWFLoader's "content" refers to a Sprite that it creates immediately. The swf is placed INTO that Sprite when it's loaded. If security restrictions prevent access to the swf's root, then the Loader will be put into the Sprite instead. Either way, you'll always get that container Sprite when you access the SWFLoader's "content" property.

 

You added a listener to that Sprite. Then in your handler, you tried getting the Sprite's "rawContent" property which doesn't exist. "rawContent" is a property of the SWFLoader, not that Sprite. You also tried getting the Sprite's "content" property which, again, doesn't exist.

 

For convenience, the Sprite is given the same name as your loader (in your case "clip0" and "clip1"), so if you want to figure out what loader is associated with the Sprite that was clicked, you could use LoaderMax.getLoader(e.target.name).

 

So in summary, there doesn't appear to be any problems with loading AVM1 content with SWFLoader - you just need to tweak your code that is attempting to access the content.

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.
×
×
  • Create New...