How to detect collssion for random or Duplicated movie clips

Community Beginner ,
Jul 28, 2006 Jul 28, 2006

Copy link to clipboard

Copied

Hey guys .. i am back with set of query..till now .. key press movement a rocket (mc) is moving left right up down in a defined stage area. and i am able to generate some fire balls randomize falling from top. this is just i am duplicating the movie clip(fireball_mc) .... now i want incase or when the rocket (mc) touch the fire ball programm shold detect the collsion and generate a score board. well for this i have tried a script for two movie clips ... wchich is working but ..i don know or i m not gettng the logic how to detect the collission for duplicated movie clips... well i m just giving the script for oinly 2 movie clips coliding...can any one tell me how to do it with randmize or duplkicated mcs??

for 2 movie clip ...

_root.mc1.onEnterFrame = function() {
if(this.hitTest(_root.egg)) {
_root.result="Oh no..... we are dead";
} else {

_root.result="we are going fine";
}

}

(this is happening ..but let me know how can i get the same result for ranndom mcs)

hope someone can help me out ...

i appriciate ur valuable time to read this..

thanking you
TOPICS
ActionScript

Views

133

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jan 15, 2021 Jan 15, 2021

Copy link to clipboard

Copied

either put your movieclips of interest in an array or name them so they can be easily referenced in a for-loop. eg, mc1, mc2, etc.

 

you can then use one enterframe listener/function to check all you movieclip hittests. 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines