-
Dynamic Text Box Buttom
Hi all,
I just want to create a sound button to stop and play.
But I dont want to draw button or use image(for 2 frames).
I want to Play and Stop sound on single frame using Dynamic Text Box(DTB) containing values "Off the Sound" and "On the Sound".
When sound is playing DTB should display "Off the Sound" and when we click on it, the Sound must stop and DTB should display "On the Sound".
How can I do it using variables to text box.
-
Try something like this,...
PHP Code:
var pArray:Array = ["On the sound", "Off the sound"];
var playState:Boolean = false;
b1.pState.text = pArray[0];
b1.onRelease = function() {
if(playState == false) {
trace("sound off");
b1.pState.text = pArray[0];
playState = true;
} else if(playState == true) {
trace("sound on");
b1.pState.text = pArray[1];
playState = false;
}
}
HTH.