- stop();
- var music:Sound = new Sound(new URLRequest("ghostwriter.mp3"));
- var sc:SoundChannel;
- var isPlaying:Boolean = false;
- uit.addEventListener(MouseEvent.CLICK, stopMusic);
- function stopMusic(e:Event):void
- {
- sc.stop();
- isPlaying = false;
- }
- aan.addEventListener(MouseEvent.CLICK, playMusic);
- function playMusic(e:Event):void
- {
- if (!isPlaying)
- {
- sc = music.play();
- isPlaying = true;
- }
- }

By: AS3 | Date: May 23 2010 20:00 | Format: None | Expires: never | Size: 423 B | Hits: 786
Latest pastes
41 minutes ago
1 hours ago
3 hours ago
16 hours ago
22 hours ago