Skip to main content
Inspiring
December 29, 2012
Answered

why is my swf loading the wrong swf file even though the url is correct?

  • December 29, 2012
  • 1 reply
  • 2502 views

I am creating a game that consist of multiple external SWF files that I connected using the loader class. I have 3 levels. At first the connection of the swf is woking well. But after finishing level 2, when the congratulatory screen appears and then pressed the button so that I can proceed to the next level, it goes back to level 2 instead of proceeding to Level 3. >.< When I check the URL, it is correct.

This topic has been closed for replies.
Correct answer kglad

i have deleted the unload code and used only one loader but still the stage2.swf loads the congratulatory_screen_1.swf even though the url i used is supposed to load the congratulatory_screen_2.swf. this happens when i load it from the first level but when i load it from stage2.swf it correctly loads the next swf. why is that?


assuming the top snippet is stage2.swf and it loads a congratuloary.swf that uses that 2nd snippet, your code shows stage2.swf loading congratulatory.swf and congratulotory.swf loading stage2.swf and that's a problem.  fix that.

1 reply

kglad
Community Expert
Community Expert
December 29, 2012

copy and paste the relevant code.

Inspiring
December 29, 2012

One more thing, when I play the swf file of Congratulatory Screen, it works well. It proceeds to Level 3 when I pressed the button. But when I start on Level 1, the Congratulatory Screen doesn't proceed to Level 3 but instead goes back to Level 2.

Inspiring
December 29, 2012

i think it is doing nothing except making you think it is doing something.

to confirm it's doing nothing, put a trace() in your unloadme listener function and see if it's ever traced.


you're right it's not tracing anything. is my way of loading and unloading swf files correct? if not, how can i correct them?