A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: sound object preloading

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    146
    ok - i have an swf with a sound object (loop) that loads and plays called sound.swf. now i've heard that the best way to play this is keep it in an external swf and load it into your movie cos the sound object loads befor ethe first frame of the movie.

    ok, so ive done that, but the sound doesnt play once its loaded into the movie clip. the sound.swf plays on its own, but doesnt when loaded into the main clip. is it something to do with the referencing?

    this is driving me mad. any tutorials specifically on sound object preloading?

    sid

  2. #2
    NerdInside's Avatar
    Join Date
    May 2001
    Location
    Penguin Island
    Posts
    3,439
    yourSoundName = newSound(this);

    Assuming you are using a new Sound(); script you need to add "this" (without "") to the in between the ()'s.

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Posts
    11
    Hi Sidrao,

    Try something like,
    As usual give the linkage for export to as many
    sound (or just one for that matter) and create a function
    ------------------------------
    //A FUNCTION ON YOUR FLASH DOCUMENT WHERE YOU
    //HAVE YOUR SOUND FILES
    function mysound(idname){
    mysoundobj=new Sound(this);
    mysoundobj.attachSound(idname);
    mysoundobj.start(0,999);
    }
    ---------------------------------

    //THE ABOVE FUNCTION IS CALLED
    //FROM ANYWHERE ONCE IT IS PRELOADED
    mysound("idname");

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