Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

event on movieclip

Status
Not open for further replies.

Cuban

MIS
Jan 23, 2003
2
US
Hi everyboby !!!
My written english is not so good, but I will try to explain me as good as I can.
I am try to create movieclip dinamically. I am using duplicateMovieClip :
duplicateMovieClip (_root.Option, "Op" + i, i);

In that way I can to obtain many instants: Op1, Op2... of the movieclip: Option
Now, I wonder how I can attach a event to these new instants
I mean,for example :I need that every new instants has diferent behavior when then event mousedown occurs.
Thank
 
If you have attached events to a clip those events will be duplicated when the clip is duplicated. To get different results on mouseDown for each one of the duplicated clips you could add a condition like this...

onClipEvent (mouseDown) {
if (this._name == "Op1") {
//do stuff e.g.
this._xscale += 100;
} else if (this._name == "Op2") {
//do other stuff e.g.
this._yscale += 100;
}
}

If you have a lot of duplicated clips and you're using MX you can put these options into a switch() statement which will be easier to keep track of than a whole bunch of ifs and elses.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top