Ultimate Gear War
Join the alien war, prepare your gear and protect your base at all cost!
4.23 / 5.00 13,899 ViewsThe AS3 preloader I have used to work, but doesn't seem to work anymore ever since I included certain movieclips in my library that have "Export in Frame 1" checked. Just the preloader is on the main timeline, and then rest of the game is done in various classes.
Is there any way I can fix this? How you do make a preloader when certain movieclips are exported in frame 1?
Here's the story of everything else I've tried:
I tried unchecking it and then dragging all of those mcs onto the second frame of the main timeline, but then this happens (the new game button doesn't work). If I then take off the fade mc used to fade to the main game, the game just fades to a white screen and I get the error "Cannot access a property or method of a null object reference."
I also tried opening the "Advanced AS3 Setting" and then setting "Export classes in frame" to 2. Then I made the first frame of the game blank and have it stop on the second frame with the preloader, but then the preloader doesn't work and all the methods in the main document class no longer work, and I get the error "Error #1009: Cannot access a property or method of a null object reference."
Thanks
I'd suggest looking into factoryClass and avoiding all this frame exporting class. You can handle preloading only using code.
At 6/19/12 10:17 PM, MintPaw wrote: I'd suggest looking into factoryClass and avoiding all this frame exporting class. You can handle preloading only using code.
Thanks, I'll look into that.
A very easy fix for preloader troubles:
http://www.kongregate.com/forums/4-programming/topics/139515
Check second post there.
At 6/20/12 07:26 AM, 4urentertainment wrote: A very easy fix for preloader troubles:
http://www.kongregate.com/forums/4-programming/topics/139515
Check second post there.
That seems a lot easier to do, I tried it earlier without much success but I'll try messing around with it and hopefully that'll be the solution. Thanks.
At 6/20/12 07:26 AM, 4urentertainment wrote: A very easy fix for preloader troubles:
http://www.kongregate.com/forums/4-programming/topics/139515
Check second post there.
Hey, this worked! Yay!
I had to make frame 1 the preloader, frame 2 a movieclip with the game inside of it. Then I scrapped my main class and put all the code inside the movielclip.
It's weird how it seems like if you want a working preloader, you can't have a main class, and you can't do the game in pure code unless you do some insane workaround.
At 6/20/12 06:26 PM, Snubby wrote: and you can't do the game in pure code unless you do some insane workaround.
Don't exaggerate, it was like 10 lines, just because you couldn't figure it out doesn't mean it's insane, nor is it a work around. Exporting all your stuff on frame 2 is a workaround.