-
loading a movie within a movie instance
I am attempting to load a movie within a movie instance. Each movie can be redirected either back or forth and loads a sound file attached to the library from a frame action. The swf files work great on their own, it is when I load them within a movie instance that they no longer retrieve the sound files located in the libraries. Below is the code that I am using. Please tell me what I am missing in order to load it within a movie.
--------------------------------------------------------
// main timeline
ifFrameLoaded (1) {
mysound = new Sound(this);
mysound.attachSound("new1");
mysound.onSoundComplete = function () {mysound.start(0,1);}
mysound.isPlaying = true;}
ifFrameLoaded (1) {
stopAllSounds ();
mysound = new Sound();
mysound.attachSound("new1");
mysound.start(0,1);}
/*
start sound at last pause position
*/
function playSound(){
if(mysound.isPlaying) { return; } // do not replay if already playing
mysound.isPlaying = true;
pos = mysound.position/1000 // convert ms to seconds
if(pos > 0){ // sound is paused
mysound.start(pos); // play without loop where ever last paused
} else { // first playback
mysound.start(0,1); // start sound looping
}
}
function pauseSound(){
mysound.stop();
mysound.isPlaying = false;
}[COLOR=blue]
-
I could be mistaken but don't you have to define the container that you place the swf in your code?
The way the code reads to me, it assumes that the code is in the _root. of the _parent which is why the swfs work when they are run individually. Just guessing but I seem to think that may help you out.
OR go _global. in your initial sound definitions and change them on the fly with declarations/re-definitions in your loaded swf's.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|