This content has been marked as final. Show 7 replies
You can use the Color Object. Assuming your button is called "my_btn" you do it like this:
ok, so if i wanted to do this for a large number of identical buttons, would i rewrite my script like this:
try this, change the number 3 to your number of buttons
or if you don't want to use absolute references:
I love ya man, or woman, or whoever helped me out today. Thank you so much.
I'm still not sure when it would be appropriate to use either the "_root" or the "this" version of your code, but the "_root" version worked fine for me.
Also, for others who want to use this code, be sure to change the 6 to the number of letters that precede the number letters/characters in the instance names of your buttons. That confused me for a few minutes.
Other than that, thanks sly one!
> I'm still not sure when it would be appropriate to use
> either the "_root" or the "this" version of your code,
> but the "_root" version worked fine for me.
_root refers to the main timeline of the currently active document
level. If you're in _level0, for example (this is the default), then _root
refers to the main timeline of _level0, no matter how deeply nested you are.
this refers to whatever timeline or object you're in. If the code is
written in the main timeline of _level0, then "this" is the same as "_root".
If the code is written in the timeline of a movie clip with the instance
name myClip, then "this" refers to myClip.
stiller (at) quip (dot) net
Dev essays: http://www.quip.net/blog/
"Luck is the residue of good design."
you are welcome.
As long as you aren't loading other .swf files in, you can use absolute paths (_root...) all the time if that's more logical for you. The minute you load in a new .swf file though, you have to watch out that you don't use '_root' in the code of the loaded .swf, cuz it will no longer refer to the main timeline of the .swf, but to the main timeline of file that loaded it. This is where relative paths come in handy. They both bring you to the same point--they just get there in different ways.