-
music buttons
i currently have a button that plays and stops music the same button.
how do i make it change appearance when it has stoped the music?
//MUSIC
var music: Sound = new Sound(new URLRequest("beach.mp3"));
var sc: SoundChannel;
var isplaying:Boolean = false;
stopbtn.addEventListener(MouseEvent.CLICK, stopMusic);
function stopMusic(E:Event):void
{
sc.stop();
isplaying = false;
}
playbtn.addEventListener(MouseEvent.CLICK, playMusic);
function playMusic(E:Event):void
{
if (!isplaying)
{
sc = music.play();
isplaying = true;
}
else
{
sc.stop();
isplaying = false;
}
}
this is my code for now.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|