Search Tutorials
Adding the ActionscriptNow it's time to add a little actionscript. Select the black button. Open the object actions window by pressing ctrl+alt+A. Press the + button and select setVariable from the dropdown menu (actions>setVariable). Insert the name of the color, in this case black , in the variable field. In the value field insert newColor(Background ) by selecting it from the dropdownmenu (objects>color>new color) and replacing the active selection(RRGGBB) with Backgound.
Now you have to select setRGB from the dropdownmenu (objects>color>setRGB). Insert the variablename you used in front of this method and the desired hexadecimal color after the 0x between the bracelets as shown in the example. Repeat this with the other buttons. Make sure you don't use duplicate variable names, it will prevent the user to switch colors more then once !
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|