user interface design by applying theories of aesthetics - Theseus
user interface design by applying theories of aesthetics - Theseus
user interface design by applying theories of aesthetics - Theseus
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
43<br />
APPENDICES<br />
var mySong:Song = new Song();<br />
var myChannel:SoundChannel = new SoundChannel();<br />
var soundPosition:int = 0;<br />
btnPlay.addEventListener(MouseEvent.MOUSE_UP, playSound);<br />
btnPause.addEventListener(MouseEvent.MOUSE_UP, pauseSound);<br />
btnStop.addEventListener(MouseEvent.MOUSE_UP, stopSound);<br />
function playSound(event:MouseEvent):void<br />
{<br />
myChannel = mySong.play(soundPosition);<br />
}<br />
function pauseSound(event:MouseEvent):void<br />
{<br />
soundPosition = myChannel.position;<br />
myChannel.stop();<br />
}<br />
function stopSound(event:MouseEvent):void<br />
{<br />
myChannel.stop();<br />
}<br />
Figure 19: Source code <strong>of</strong> music function