-2

ok this has been bugging me, I have a maze, it uses a movie clip inside a button for the player and maze to work now i want to make the movie play on keypress and stop on release so the player will "walk cycle". I've tried

Player.tswalk //(button.movie clip)
this.player... 
root.player... 
_root.player...

and every other combination I can think of and none work

(i would also like to swap out the movie clip in action script to change to different directional sprites)

Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
NekoLLX
  • 219
  • 6
  • 19

1 Answers1

0

For starters you shouldn't use root in actionscript 3. Also, this question is extremely vague. I'll try to help though. I'm assuming you have the keyUp and KeyDown event handler's working. If not, that's an entirely different problem. But referencing the movie clip in AS3 can be done by simply referencing its name. If the instance name of the movie you want to play is "MyMovieClip1" then you would simply do:

MyMovieClip1.play();

To stop it from playing you would do:

MyMovieClip1.stop();
vagabond80
  • 31
  • 2
  • 8
  • the movie clip is called tswalk, and ive tried tswalk.play() and stop i get a error "acess of undeviend property tswalk" Sorry got distacted in the last week or so with finals and other things – NekoLLX Jul 06 '12 at 19:53