26.12.2013 Views

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

SHOW MORE
SHOW LESS

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

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!