Sep
08
2008
Useful ActionScript code snippets: Snippet 1
Posted by SikoTiko in Code snippets, Problems, tags: ActionScript, ActionScript button, code snippetList of some useful ActionScript code snippets:
How to toggle button with two states in two lines of code,i.e. sound on/off button?
Let’s say you have a movieclip called “sound_btn” with two frames for the two states – sound on and sound off. Here is the code:
sound_btn.onRelease = function(){ this.gotoAndStop(Number(soundIsOn)+1); soundIsOn = !soundIsOn; }
The code soundIsOn = !soundIsOn; is equal to: Read the rest of this entry »


Entries (RSS)