Be a Supporter!

loadMovie help..?

  • 212 Views
  • 2 Replies
New Topic Respond to this Topic
Guil07
Guil07
  • Member since: Oct. 13, 2007
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
loadMovie help..? 2009-02-13 07:00:41 Reply

Hey..

I know a lot of flash-game developers use a button on their preloader which loadMovie...'s their actual game, in order to help protect their game from import..

I played around a little with loadMovie, but every time I load my game .swf, everything just seems to go crazy. Do I need to define variables and objects in my game to it's swf file; are local variables not seen as local if the swf is loaded from another swf...?
Help..? I haven't used loadMovie before, so I'm a little confused as to how exactly it works..

Thanks,

~Guil


BBS Signature
Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to loadMovie help..? 2009-02-13 07:11:09 Reply

Using _root within a loaded swf will refer to the holder swf, you'll need to replace _root.var with this.var or _parent.var within the loaded file


- - Flash - Music - Images - -

BBS Signature
Guil07
Guil07
  • Member since: Oct. 13, 2007
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
Response to loadMovie help..? 2009-02-13 07:27:18 Reply

Ah, I see.. That would be the problem.

It seems _root.loadMovie("MyApp.swf");
Keeps everything as before. So if I just remove anything that was there before the loadMovie - logically this would function perfectly, right? I'll try it out now.

Thanks a bunch Denvish, you hit the nail on the head.

~Guil


BBS Signature