-
Adding Sound to Bouncing Ball
Hi. So here's the deal. I have a as 3.0 .fla where a ball is just roaming around hitting walls and I would like to play a sound each time the ball hits one of the stage's wall, just like this.
I have this on my file:
Code:
var snd:Sound = new Sound(new URLRequest("TennisBall.wav"));
And on each if (when the ball hits one wall and changes it's course) I have:
Each time I run the game, I get no sound and the following error message:
Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at game_fla::MainTimeline/game_fla::frame1()
ArgumentError: Error #2068: Invalid sound.
at flash.media::Sound/play()
at game_fla::MainTimeline/moveBall()
What am I doing wrong here? All the code is placed on the first frame in the timeline.
Thanks.
Last edited by Hurdarr; 05-23-2009 at 02:09 PM.
-
are you certain you can load an external wav file? I havent tested this lately, but older versions of flash only supported external mp3 not wav.
-
Not sure what you mean as I started messing around with flash. I´m using flash cs3.
-
try loading mp3 instead of wav
-
How do I do that? Is my previous code correct?
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
|