I dont use loader a lot
i asked a question before how to link a game over with unload action
but i started implementing it when i click the button to load
im getting unable to load source file wht ?
so my idea is a 3 levels game , i got the 3 levels built still needs some modifications etc
and i load these 3 levels form another swf file which is the UI
the 3 levels are programmed purely oop (i.e no time line scripting)
the user interface is build using time line scripting
so i programmed some buttons which will be responbsible for loading the level
for example button 1 loads level1 swf
the code
var myLoader:Loader = new Loader();
var url:URLRequest = new URLRequest("level1.swf"); myLoader.load(url);// load the SWF file addChild(myLoader);
i tested before on a simple thing it worked fine so when i wanted it to be implemented for my game it didnt work the ui interface stopped working so i was obliged to move all the main class of level to the timeline where i will load the game and thing worked ( didnt expect to work but it worked) thank you |
There is nothing wrong with that code as written. You haven't included any error messages, so there's no easy way to determine what might be wrong.
I recommend you take a step backwards and test again on a simpler level where you just have that code and one button. If you get that working, then you need to determine how it differs from what you have when it doesn't work.
North America
Europe, Middle East and Africa
Asia Pacific