A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Adding Sound to Bouncing Ball

Threaded View

  1. #1
    Senior Member
    Join Date
    Jan 2008
    Posts
    107

    Question 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:

    snd.play();
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center