A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: loadSound() question

  1. #1
    Junior Member
    Join Date
    Feb 2004
    Posts
    14

    loadSound() question

    Code:
    var targetSound:Sound = new Sound();
    targetSound.loadSound("whatever.mp3", false);
    targetSound.start();
    i'm trying to load the sound as and "event" and not as "streaming" with the 2nd parameter as false. however, the sound would never play. what is wrong?

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    I believe you have to wait until the sound is completely loaded before calling start.

    try the onload event.

    targetSound.loadSound("whatever.mp3", false);
    targetSound.onload = function() {targetSound.start();}

  3. #3
    Junior Member
    Join Date
    Feb 2004
    Posts
    14
    thanks for that help again! i missed that point. u r cool!

  4. #4
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    so, just to help others reading the thread, did this solve your problem?

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