Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > Flex > Flex 2, 3 & 4

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-17-2009, 09:29 PM   #1
tarafenton
Tara Fenton
 
Join Date: May 2005
Location: Brooklyn, NY USA
Posts: 346
Send a message via AIM to tarafenton
Default Error #2180: It is illegal to move AVM1 content (AS1 or AS2)

I have an actionscript project that loads in swfs and jpgs into the displaylist. It worked in Flash, but now that I converted to Flex, I'm getting this error when I add and remove the content in the displaylist:

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.

I've searched and I've seen AVM2Loader class, but not sure how to implement it or if that would even help. Besides that, there doesn't seem to be a whole lot out there on the subject. Can someone help me out and let me know how I can correct this error?

Thanks
tarafenton is offline   Reply With Quote
Old 02-17-2009, 09:54 PM   #2
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

You cannot reparent AVM1 SWFs... just move the loader, don't try to move loader's content separately.
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote
Old 02-23-2009, 09:43 PM   #3
tarafenton
Tara Fenton
 
Join Date: May 2005
Location: Brooklyn, NY USA
Posts: 346
Send a message via AIM to tarafenton
Default

I changed my array to a vector and put the loader into the array instead of the loaded image

LoadImages.as
ActionScript Code:
private var singleImage_arr:Vector.<Loader> = new Vector.<Loader>(); private function onImageLoaded(event:Event):void {     var loader:Loader=Loader(event.target.loader);     var image:Bitmap=Bitmap(loader.content);     singleImage_arr[current]=loader; } public function mySingleImage():Vector.<Loader> {     return singleImage_arr; }

but I'm getting an error in my ControlPages.as
1046: Type was not found or was not a compile-time constant: Vector.
ActionScript Code:
private var singleImage_arr:Vector.<Loader>=LoadImages.getInstance().mySingleImage();
tarafenton is offline   Reply With Quote
Old 02-23-2009, 09:54 PM   #4
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

Are you sure you're compiling against FP10 playerglobals.swc?
Check this page for more info:
http://opensource.adobe.com/wiki/dis...lash+Player+10
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote
Old 02-24-2009, 02:46 PM   #5
tarafenton
Tara Fenton
 
Join Date: May 2005
Location: Brooklyn, NY USA
Posts: 346
Send a message via AIM to tarafenton
Default

I didn't think it was that, but I did go to the page you posted and followed the instructions. I also tested it by changing the type to Array
ActionScript Code:
private var singleImage_arr:Array=LoadImages.getInstance().mySingleImage();

which gave me this error

1067: Implicit coercion of a value of type __AS3__.vec:Vector.<flash.display:Loader> to an unrelated type Array.

so I can safely say those classes are accessible.
Any other suggestions?

Thanks
tarafenton is offline   Reply With Quote
Old 02-24-2009, 03:49 PM   #6
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

You cannot get this error
Quote:
1046: Type was not found or was not a compile-time constant: Vector.
unless you compile for FP9... Vector is a top-level class... so there's no way it can be not found in the AS project targeting FP10
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote
Old 02-24-2009, 04:17 PM   #7
tarafenton
Tara Fenton
 
Join Date: May 2005
Location: Brooklyn, NY USA
Posts: 346
Send a message via AIM to tarafenton
Default

Even in my properties > Actionscript Compiler

Require Flash Player version 10 0 0


One thing that is funky with my FB3 though is that when I save it doesn't update my problems. I have to Project > Clean for my changes to be saved and new problems to update. What could be?

Thanks again
tarafenton is offline   Reply With Quote
Old 02-24-2009, 05:27 PM   #8
tarafenton
Tara Fenton
 
Join Date: May 2005
Location: Brooklyn, NY USA
Posts: 346
Send a message via AIM to tarafenton
Default

Could it be that I am pushing a Loader into the Vector array?
I used it as Vector.<MovieClip> in the same project and that worked
tarafenton is offline   Reply With Quote
Old 02-24-2009, 05:54 PM   #9
wvxvw
Holosuit User
 
wvxvw's Avatar
 
Join Date: Oct 2006
Location: Tel Aviv
Posts: 4,301
Send a message via ICQ to wvxvw
Default

I'd simply move / rename the old playerglobals.swc to make sure I'm compiling against the proper one... there seems to be an issue with FB, it may "forget" what major version ware you wanting to use... But I don't compile through FB, so, don't take my word there for ultimate truth here
__________________
The .NET open source editor for Flash and web developers
*This would be my contribution to the project*
couchsurfing if you need it
wvxvw is offline   Reply With Quote
Old 02-24-2009, 06:13 PM   #10
tarafenton
Tara Fenton
 
Join Date: May 2005
Location: Brooklyn, NY USA
Posts: 346
Send a message via AIM to tarafenton
Default

i've deleted it and added it again, so that doesn't seem to be it.
Do you think it has anything to do with my loader code?
ActionScript Code:
private function loadImage():void {                if (myArray[current][1] == "") {                 //create an empty bitmap for the loop to continue                 var emptyImage:Loader = new Loader();                 singleImage_arr[current]=emptyImage;                 //skip to loadImage                 current++;                 loadImage();             } else {                 imageLoader=new Loader();                 imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageLoaded);                 request=new URLRequest("images/" + myArray[current][1]);                 imageLoader.load(request);             }         }                 private function onImageLoaded(event:Event):void {             var loader:Loader=Loader(event.target.loader);             var image:Bitmap=Bitmap(loader.content);             singleImage_arr[current]=loader; }
tarafenton is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I use AS1 with AS2? metrov8 ActionScript 2.0 14 01-06-2009 07:59 PM
as1 to as2 problems taufiq ActionScript 1.0 (and below) 3 11-29-2008 05:00 PM
move all content at once er0ck Simple Stuff (Newbies) 2 11-14-2008 01:40 AM
Dragging the content of a scrollpane without first having to move the scrollbars bsprout Components 0 04-12-2005 09:20 AM
XML and menutext content sanderH Components 1 07-21-2004 06:01 PM


All times are GMT. The time now is 04:41 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.