|
-
AS3 refer to other movieclips from a movieclip
I have two movieclips on the stage... man and enemies, inside man there is a movieclip called sword, inside enemies there is a movieclip called enemy then inside that a movieclip called float.
stage -> man -> sword
stage -> enemies -> enemy -> float
Is there anyway I can refer to sword from within enemy?
the code would be for a hitTest like:
Code:
if (float.hitTestObject("way to refer to sword"))==true{
nextFrame();
}
-
Senior Member
have you tried:
_root.man.sword
?
-
Thats for AS2 fool!
-
Senior Member
Sorry, sorry, wasn't thinking clearly >_<''
I don't know the first thing in AS3
Last edited by Shnitzel; 03-10-2009 at 04:39 PM.
-
Any one else got any ideas?
In AS3 this time please
-
Senior Member
Alright, alright, I want to correct my mistake ><'
I checked google and it was surprisingly hard to find this.
AS3 replaced "_root" with "MovieClip(root)".
So the code should go:
MovieClip(root).man.sword
(Assuming both are in the same root)
I also saw something about stage, so if root doesn't work try stage :S
Otherwise, there's a category here for AS3
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|