Jump to content
Search Community

Warning: An ActionScript 1.0/2.0 SWF file has loaded an Acti

sprog test
Moderator Tag

Recommended Posts

I am getting the following error:

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.

 

In my preloader when I am loading my main content swf with LoaderMax. I am not understand what could cause this problem. All the assets get generated with mxmlc of Flex 3.5a. Only sound files get embedded via swc generated by Flash CS4. But this is also publishing to AS3.

 

My code is the following after the content swf has been loaded:

 

SWFLoader code

_contentLoader = new SWFLoader( "game.swf", {name:"mainSWF", container:this,
  x:0, y:0}
);

preloader = new CommonGamePreloader( this, _contentLoader );
preloader.completionDelay = 1; // time to show the preloader after movie fully loaded
preloader.waitingFrames = 2; // time to display the branding

 

Code after the file has been fully loaded or LoaderEvent.COMPLETE has dispatched and the out animation has finished

// go to the next frame, the FrameFactory metadata adds the preloader-class to Frame 1 and document class to Frame 2
gotoAndStop(2);

var appEntryClass: Class = _contentLoader.getClass("Application");
if ( appEntryClass ) {
var app: Object = new appEntryClass();
stage.addChild( DisplayObject(app) )

if ( preloader ) {
   preloader.dispose();
   preloader = null;
}

if ( app is IPreloadable ) {
	app.onApplicationPreloaded( this );
}
}

Link to comment
Share on other sites

Sounds very fishy to me - that warning didn't come from LoaderMax/SWFLoader, that's for sure. It sounds like the root/parent swf is (or thinks it is) published as AS2. Without having your files to compile myself, it's tough to troubleshoot. If you could reproduce the issue in a separate, very simplified set of files, feel free to post them here so we can try compiling and getting the error.

Link to comment
Share on other sites

Yes, I really strange. If you check the two preloader and content swf with ASV they both are marked AS3-based SWFs. I will see if I can reproduce it. I understood that by default the content swf gets loaded in it's own new ApplicationDomain so shared classes can't be of issue here.

 

After the application appears to work fine, though. I will keep hunting.

Link to comment
Share on other sites

Aah, looks like it was caused by creating the document class twice. Once when the SWF itself got loaded and later in my createApplication-method.

I have changed the code to:

 

       protected function createApplication(): void {
           // go to the next frame, just to be sure
           gotoAndStop(2);

           stage.addChild( DisplayObject( _contentLoader.rawContent ) );

           if ( _contentLoader.rawContent is IPreloadable ) {
               _contentLoader.rawContent.onApplicationPreloaded( this );
           }
       }

 

After that I am not getting the error anymore. Oh well, it works.

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