views:

262

answers:

1

I created an AS3 preloader, and placed the code for that on frame one.

I then made a symbol, and placed it in the library. It was set to NOT export on frame 1, and the fla's settings had all classes exported on frame two. There were no references to the object until frame two.

Then, flash crashed whenever I compiled without the "Export in frame one" box checked.

To fix this, a friend suggested I start my game logic on frame 3, so it will have properly loaded frame 2. That seemed to work fine, the class was instantiating properly.

Then, it turned out that it was not loading the movieclip, only instantiating the class. Again, this could be fixed by exporting in frame 1, but I really cannot afford to do that.

The same friend suggested I place an instance of the symbol on the stage on frame 3, and perform game logic on frame 4. They said this would initialize the movieclip properly.

However, this was not the case. How can I load the entire symbol, graphics and all, without exporting to frame 1? This single symbol will contain probably 10-20 MB of graphics, so it needs to be preloaded.

Thanks for the help!

EDIT: To make a long story short, all I need is some way to load a movieclip so it can be used and visible and everything.

EDIT: Is there any way to force-load a movieclip via AS3?

+2  A: 

Hard to figure out from descriptions.

If you make a new .fla file, paste your large(10-20MB) clip on frame 2, set your export frame as 2, then try to preload from frame 1 and access the large clip's content in frame 2, do you get the same error ?

say you have this in frame 1:

stop();
this.loaderInfo.addEventListener(Event.COMPLETE, onComplete);

function onComplete(event:Event):void{
gotoAndStop(2);
}

and in frame 2:

trace(myLargeClip);//where myLargeClip would be your 10-20MB clip

It should be ok, otherwise, in case tracing your large clip returns null, you might want to try to invalidate the stage:

on frame 2:

stage.addEventListener(Event.RENDER,onRender);
stage.invalidate();

function onRender(event:Event):void{
trace(myLargeClip);
}

Basically what I'm suggesting is:

  1. Isolate the problem. See if your large clip is causing problems in a similar, but simplified scenario and why, then once you got a fix use it in your main fla.
  2. Try the stage invalidation, although, since I don't fully understand your setup, it's just a wild guess.

HTH, George

George Profenza
I actually figured it out, your advice about setting export frame for actionscript was what was breaking it...I set it back to frame 1, it wound up working since the symbols were being loaded.
Cyclone