Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Controlling Sound in a Loaded Movie |
From: | jwoodw - Jeffrey Woodward |
Date: | Mon, 05 Feb 2001 22:13:54 -0000 |
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();
}
When played alone, this movie works fine. The sound begins when the button
is released.
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();
}
The sound won't start with this code, and not even the test button in the
level 1 movie will start the sound. I've gotten it to work by just loading
the sound into a frame and targeting the frame label with a "gotoAndPlay"
action but would like to target it as an object in order to play around with
the volume and pan controls.
Thanks in advance for any suggestions!
Jeff
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]