A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: external swf, sound not playing

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    272

    external swf, sound not playing

    hello flash-masters,

    i'm almost positive this question has been asked before, but my search turned up nothing that would help me.

    okay, i have a main flash file called "intro".
    then i load a navigation into this intro file called "nav.swf". this is done by first placing a black square where the nav is supposed to be loaded, and then replacing it by using

    _root.nav.loadMovie("nav.swf");

    (obviously, the instance name of the black square is "nav")

    within this nav.swf file i have a bunch of buttons, and i want a sound to be played when the mouse moves over a button, using

    on (rollOver) {
    s_multimedia. start (0,1);
    }

    i did all the newsound/attachsound things required, and it works fine when i open nav.swf directly.

    but when i play the intro.swf, no sound is heard.

    now i guess it's probably caused by an incorrect path to the sound, so i tried

    on (rollOver) {
    _root.nav.s_sound.start (0,1);
    }

    which didn't work out either.

    then i tried

    on (rollOver) {
    _root.nav.placeholder.s_sound.start (0,1);
    }

    since the black square is called "placeholder", and on the stage i gave it the instance name "nav".

    but this didn't work either.

    HELP.
    there must be a way to do this.
    i'd like to leave the mp3 sounds in the external swf files, since i want to continue this way by "outsourcing" the content into seperate swf files (so i can have a pretty preloader, a slim intro file and generally a better overview of things)

    thanks in advance,

    rgds daniel

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    272
    okay, i found the bug, i forgot THIS


    it was indeed the

    s_sound = new Sound ();
    s_sound.attachSound("sound");

    part that was wrong.
    i need to tell it WHERE the new sound is going to be loaded, and since it's inside the nav.swf i need to do this:

    s_sound = new Sound (this );
    s_sound.attachSound("sound");

    works like a charm.

    i thought i'd post the solutionin case any other noob is having headaches because of this.

    THANKS FOR NOTHING, YOU GURUS.

    j/k

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