how do I add onclick events to MCs or Dynamic Text Fields
Printable View
how do I add onclick events to MCs or Dynamic Text Fields
myMC.onPress = function (){
trace("clicked");
}
If I have nultiple instances of a movie clip, how can I have it use an onclick method for everyone, ,but have different actions.
myMC.onClick() {
action(someVariable);
}
withotu haveing to type the code into every MC
to target multiple instances, if they have a serail naming convention (mc1, mc2,mc3, etc.) use a for loop. If not use an array and a for loop.Quote:
Originally Posted by Gemione
for different actions, same thing. Either a for loop or an array and a for loop.
For more info on these methods see the livedocs a adobe.com. Or your help files.
gparis