Hi all,
I can't play a simple wav file in the flash target. Here's my test code:
Strict
Import mojo
Global testApp:Test
Function Main:Int()
testApp = New Test()
Return 0
End Function
Class Test Extends App
Field sfx:Sound
Method OnCreate:Int()
sfx = LoadSound( "swoosh.wav" )
SetUpdateRate(30)
Return 0
End Method
Method OnUpdate:Int()
Return 0
End Method
Method OnSuspend:Int()
Return 0
End Method
Method OnResume:Int()
Return 0
End Method
Method OnRender:Int()
Cls()
DrawText( "Press left mouse button to play a sound!", 10, 10 )
If( TouchDown( 0 ) ) Then PlaySound( sfx )
Return 0
End Method
End Class
Link to the wav: http://www.xaron.net/dl/monkey/swoosh.wav
Complete project: http://www.xaron.net/dl/monkey/flashtest.zip
|