Skip navigation
Haznut
Currently Being Moderated

Loading a game inside a movieclip (AS2)

Aug 1, 2012 9:57 PM

Hello.

I have a problem loading a game inside a movieclip (i´m using AS2)

 

I have a main timeline with 6 buttons, and each button calls for an external SWF, wich loads inside an empty movie clip.

 

Everything works ok, but when the game loads inside the movieclip, it won´t respond.

The game SWF loads ok inside the movieclip, but it doesn´t respond to commands.

 

If i execute the game.swf, it plays ok....but when loaded into the movieclip, it shows but you can´t play because the commands or buttons won´t respond.

 

Is there a way to load this kind of swf inside a movieclip and make it work?.

 

What i´m doing is:

 

The button has this action:

 

on (press) {

loadMovie("game6.swf", "cargador");

}

 

"Cargador" is the name i gave to the empy movieclip.

 

I´ll appreciate any help i can get. Thanx a lot for your time.

 
Replies
  • Currently Being Moderated
    Aug 2, 2012 5:52 AM   in reply to Haznut

    If the loaded game is using _root references in its code then that could be the problem since they could be targeting the file that loaded the game instead of the game's _root.

     

    What you might need to do is to set the _lockroot property of the file to be true.  Either that or do not use _root references in it.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 6:03 AM   in reply to Haznut

    Another possibility is that the game file is loaded from a different folder than the main file and any files it loads are not being targeted properly as a result.  So if the game file loads other files this is something to consider as well.  When a Flash file is placed in an html page, it is as good as being in the same folder as that html page, so any files it loads need to be targeted accordingly... that goes for any files that embedded swf loads as well, such as your games.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 6:56 AM   in reply to Haznut

    Setting the _lockroot property to true can be done 1) inside the swf game that you are loading (first frame would be best), or 2) can be done from the file doing the loading, but it has to be done after loading is complete, which means you need to use the MovieClipLoader class to determine when loading is complete.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points