Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: [flasher] Controlling Sound in a Loaded Movie
From: Muzak
Date: Thu, 08 Feb 2001 01:30:23 -0000

You have to secify the level you want the sound object to *live in*
When using/creating a sound object in a different level movie, use 'this' as the target when creating the sound object

//Level1 movie
s = new Sound(this);
s.attachSound("mySound");

//start sound from main timeline within the level 1 movie
on (release) {
s.start();
}

//start sound from level0 movie
on (release) {
_level1.s.start();
}

HTH,
Muzak

----- Original Message -----
From: "jwoodw - Jeffrey Woodward" <jwoodwatacxiom [dot] com>


> Hi all,
>
> In experimenting with sound in Flash 5 I've reached a stumbling block that
> has me perplexed. I've got a movie clip in which I created a sound object
> using the Actionscript Reference Guide's suggestions. I imported a sound,
> selected the sound in the Library and chose "Linkage" from the Options menu
> to give it the identifier "mySound", and in the first frame of the movie
> included the following script:
>
> s = new Sound();
> s.attachSound("mySound");
>
> Just for testing, I created a button in this movie with script to start the
> sound as follows:
>
> on (release) {
> s.start();
> }
> The problem comes when I try to load this movie into another movie and
> target the sound to start. I load the movie into level 1 as follows...
>
> loadMovieNum ("sound.swf", 1);
>
> ...and then try to target the sound with a button like this:
>
> on (release) {
> _level1.s.start();
> }




[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]