dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: question on the Sound object and loadSound

  1. #1
    Member
    Join Date
    Jun 2002
    Posts
    45

    question on the Sound object and loadSound

    i have a movieclip which after hitting the last frame does the following:


    _root.ss = new Sound();
    _root.ss.loadSound("track.mp3",false);


    (makes a new sound object called 'ss' and gives it some sound.) this is all fine, now i have some sound but if i want to make a button called "change Track" that will change the '_root.ss'sound from 'track.mp3' to say 'track2.mp3' how can i do that?

    i tried:

    on(release){
    _root.ss = new Sound();
    _root.ss.loadSound("track2.mp3",false);
    }

    thinking that it would sort of overwrite it with this new track but it either just stops or or doesn't work at all.



  2. #2
    Maya * ActionScript Addict DangerAhead's Avatar
    Join Date
    Jun 2000
    Location
    San Francisco
    Posts
    299
    try this:
    Code:
    ss = new Sound();
    function loadNewSound (newOne){
       ss.loadSound(newOne,false);
       ss.start();
    }
    loadNewSound("track1.mp3");
    
    
    // then on the button put
    on (release){
      loadNewSound("track2.mp3");
    
    }
    Geordie Martinez
    www.citizenparanoid.com | email

  3. #3
    japanese nayades's Avatar
    Join Date
    Mar 2002
    Location
    neptune's mercenary canteen
    Posts
    1,713
    i have another question about this kind of sound attachment..
    there's only one sound to be streamed, therefore, i have:

    mysound = newSound();
    mySound.loadSound("track.mp3",true)

    really straight forward. however, my doubt is: can i work out the totaltime and the current second the sound is at by modifiyng or adding to this.. or do i need to make use of a different streaming method?

    thx

  4. #4
    Member
    Join Date
    Jun 2002
    Posts
    45
    no luck.

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