Posts Tagged “code snippet”

List 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 »

Share

Comments No Comments »

TxEff - The Flash Text Effects