Skip to main content
December 3, 2009
Question

Loading something into a game.

  • December 3, 2009
  • 1 reply
  • 742 views

Hey everybody. Ive been trying to load something into my game so that when i reach, lets say 1000 points another powerup comes into the game.

I tried doing the opposite of Unloading something into the game which's actionscript is

onClipEvent{

     if(_root.char.hitTest(this)){

     _root.char.speed=10;

     unloadMovie(this)

}

}

Saying that when the char hits this, its speed increases then the powerup goes away. so it worked fine but i wanted to do something that made the powerup come into the game. The actionscript i tried is.

onClipEvent{

     if(_root.score<=1000){

     loadMovie(this)

}

}

i didnt give it anything specific to do once it was loaded. but i tried that and it said that it didnt work. i guess load movies and unload movies are totally different. But if anybody could please help me, it would be much appreciated. Thanks =).

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
December 3, 2009

neither of those snippets would do anything.  there must be some event specified, for example:

onClipEvent(enterFrame){

...

}

December 3, 2009

this is actionscript 2... and the first one did work. The 2nd one didnt. i didnt ask could somebody tell me that im wrong. i asked for help... but thanks anyway

kglad
Community Expert
Community Expert
December 3, 2009

you're wrong.

neither of those would even compile.

go back to the fla that contains the code that worked and copy that code and paste it here.  there must be some significant differences between the code posted above and code that worked.