-
Stringing names on the hitTest actionscript
I was wondering how to string the MC names in the actionscripting for hitTest... for example i have this:
onClipEvent (enterFrame) {
if (this.hitTest( _root.object ) {
_root.play()
}
if (this.hitTest( _root.object2 ) {
_root.play()
}
if (this.hitTest( _root.object3 ) {
_root.play()
}
}
can i make the MC name object a part of a string in the actionscript above? any help is great!!
-
onClipEvent (enterFrame) {
for (i=0; i<3; i++) {
if (this.hitTest( _root["object"+i])) {
_root.play();
}
}
}
like this you mean?
only flaw is your first object will be called "object0" not just plain "object"
gparis
-
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
|