Thursday, October 04, 2007

Problems no one has

I've been getting this error in an all AS3 project and am not sure what to do about it.

"Warning: An ActionScript 1.0/2.0 SWF file has loaded an ActionScript 3.0 SWF; code in the ActionScript 3.0 SWF will not run."

I've googled and nothing come up, I'm doing something that is very tricky but I'm afraid I've found a bug in the flash player and I dont really what is causing it or what I could report. It must have something to do with,
ApplicationDomain.currentDomain.getDefinition( myclass )

If I can isolate it more I post more about it but it's messing me up.

if anyone knows anything let me know, thanks

Labels: ,

9 Comments:

Blogger Unknown said...

I get that warning, too, and after google I found your blog entry and still nothing more. :-/
I can report, that I also use embed meta tags for the compiler to embed symbols from an FlashCS3/AS3 compiled SWF into my AS3 application. I thought it came from there. But I also use getClassByDefinition....

8:32 AM  
Blogger Michael Prescott said...

I'm getting it to when trying to get the definition of a class as you say...
swfLoader.contentLoaderInfo.applicationDomain.getDefinition(qualifiedClassName)

The bug is occuring in 9.0.47.0, but not in 9.0.60.235

12:50 PM  
Blogger Michael Prescott said...

Adobe has an example of a ClassLoader, like what we're trying to do. In their example, you can cause the bug to occur if you merely place a vector shape on the stage of the FLA that has RuntimeClasses class applied as its Document Class.

2:51 PM  
Blogger Michael Prescott said...

And that is the solution... if I remove all items from the stage I can use MY swfLoader.contentLoaderInfo.applicationDomain.getDefinition(qualifiedClassName) with no errors.

So to re-iterate, the bug occurs in 9.0.47.0 on Windows XP and Windows Vista. It does not occur in 9.0.60.235 on Windows XP, but a silent failure occurs on Windows Vista (no hard crash, but flashlog.txt reveals incorrect error message that you're attempting to load a AS1.0/AS2.0 in a AS3.0) And the problem does not occur anywhere when NO items exist on the stage of a loaded swf.

8:17 AM  
Blogger Ziv Rosenzweig said...

My problem is that I'm realy trying to load as3 swf file using loaded as2.
Why can't you do it?
Is their a workaround for it?

12:23 AM  
Blogger Michael Prescott said...

AS3 code will not run in Flash Player versions earlier than 9. Also, considering Flash 9 player's new security model and significantly different loading methods, I would have the expectation that an AS2 swf could load and initialize an AS3 swf.

4:29 AM  
Blogger Michael Prescott said...

... I would NOT have the expectation ...

4:30 AM  
Blogger Ziv Rosenzweig said...

I know all that.
What I'm tring to do is to load SWF file created in AS3.
The catch is that the SWF file that try to load (using loadClip) is writen in AS2.

6:20 AM  
Blogger Michael Prescott said...

The first 3 posts here explain it better. http://www.flashden.net/forums/thread/load-as3-swf-in-as2-swf/1868

I've been porting a rather large AS2 product to AS3 for several months now and from that experience, I'd say, if you can... republish your AS2 swfs as AS3 swfs.

6:54 AM  

Post a Comment

Subscribe to Post Comments [Atom]

<< Home