Script crashes IDE and Flash Player but works in browsers
Question posted by: activa
(Newbie)
on
May 1st, 2008 07:22 PM
I'm building a game program and I've got a script that loads an external swf, and then duplicates the clip for the user to play. It worked until a few days ago when I reinstalled my OS (Mac OS 10.4.11) to fix an unrelated problem. The strange thing is that I had reinstalled the browser plugin to fix a related problem. Now the code works in the browser, but crashes the IDE and the Flash Player every time. I called Adobe Support but they were no help since it's "project related." I've reinstalled CS3 and Flash itself, but nothing helps.
Here's the code that crashes:
Code: ( text )
// INITIALIZE LOADER AND ADD TO STAGE var myLoader:Loader = new Loader; addChild (myLoader); myLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, isLoaded); // DUPLICATE CLIP WHEN LOADED function isLoaded (event:Event):void { event.target.content.width = 100; event.target.content.height= 200; // THIS IS THE LINE THAT CRASHES var copyClass:Class = Object(event.target.content).constructor; var newThing:DisplayObject = new (copyClass); addChild (newThing); newThing.x +=50; } myLoader.load (new URLRequest('coloring/coloring1.swf'));
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
Not the answer you were looking for? Post your question . . .
183,965 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|
|
|
Latest Articles: Read & Comment
Top Flash / Actionscript Forum Contributors
|