Help making a button load a MC
Hey, Im creating a game in flash and i want to have it so that the button you click loads a MC from my library. I went into the properties of the MC and checked Export for Actionscripting, gave it an ID name and an instance name.
Heres the code i placed on the button:
my_btn.onPress = function() {
_parent.attachMovie('rainmovie', 'rain', _parent.getNextHighestDepth(), {_x:100, _y:100});
}
when i test the movie an error message pops up saying:
Statement must appear within on handler
my_btn.onPress = function() {
please help thanks!