0
votes

Well I am an absolute begginer on ActionScript, and I am having a doubt here: I need to add some code to my button symbol, created with F8 shortcut (called butplay). I need this code to be on every instance of the button, and there will be lots of instances, so I thought: is there any way to add the code to the symbol, so that every instance created will already have the code?

Code will be simple, like this:

on(release)
{
 //do stuff 
}

Any ideas?

1
If you are begginer on ActionScript you should definitely learn AS3 to begin with, AS2 is old. - null.point3r

1 Answers

0
votes

What you need to do is go into the button's timeline (make sure it is stored as an MC, not a button) and add your butplay function. If the buttons are all instances of the same movieclip, then you can stop there. But if they are different MCs in your library, then you will need to do it a little differently. You need to make an object/MC whose only purpose is to hold the function/procedure. Then you need to set its alpha to 0, and shape it over your button. In that MC's timeline, you need to store your function.

Or you can store a function/procedure in your root, and call it from the button. It depends on whether or not your buttons are identical children.