|  | dynamically position button with action inside |  | |
| | | tobycraftse |  |
| Posted: Wed Jul 23, 2008 10:11 pm Post subject: dynamically position button with action inside |  |
I have 100 button icon, when flash program runs, how to dynamically choose button i want and put it on canvas using action script?
for example, when user choose computer - all icon button related to computer will get put on canvas ... etc
each button will have action script attach to it and do something.
any examples? |
| |
| | | kglad |  |
| Posted: Wed Jul 23, 2008 11:53 pm Post subject: Re: dynamically position button with action inside |  |
use the attachMovie() method of movieclips if all your icons are in your fla's library:
useBtn.onRelease=function(){ yourbutton = maintimeline.attachMovie(userselectedID,"mc"+dep,dep++); yourbutton.onRelease=function(){ // do whatever } } |
| |
|
|