how to access a different movieclip within the flash in AS3
Posted
by Pieter888
on Stack Overflow
See other posts from Stack Overflow
or by Pieter888
Published on 2010-04-19T12:24:11Z
Indexed on
2010/04/19
14:13 UTC
Read the original article
Hit count: 162
I've been trying to learn Action Script 3 the past few weeks, making tiny interactive games to learn the basics. I stumble upon a problem every now and then but most of the times google helps me out.
But this problem has got me stuck so please help:
The main stage contains two objects(movieclips), the player and a wall. The player has got his own code so when I drag in the player object I don't have to write any code into the main stage to be able to move the player.
This all worked pretty well and I now wanted to add the wall so the player actually has something to bounce into.
Now here is the problem, I want to check if the player touches the wall, I've done this before but that was when I used the main stage as my coding playground instead of putting the code in movieclips. How can I check if the player hits the wall within the movement code of the player object?
© Stack Overflow or respective owner