What the hey? attachSound quits working when the movie is used in loadMovie?
s1 = new Sound();
s1.attachSound("sound1");
s1.start(0,1);
Works fine on it's own, not a peep out of it when loaded as an external to a clip. What's wrong? :confused:
Printable View
What the hey? attachSound quits working when the movie is used in loadMovie?
s1 = new Sound();
s1.attachSound("sound1");
s1.start(0,1);
Works fine on it's own, not a peep out of it when loaded as an external to a clip. What's wrong? :confused:
Maybe because sound1 is the Action Script name of your sound in the loaded Movies Library and it doesn't exist in your main movies library.
No, it doesn't exist in the main movie. It shouldn't have to, it's in the loaded movie where it's being called from. And I am using:
s1 = new Sound(this);
s1.attachSound("sound1");
s1.start(0,1);
Or am I missing something in the targetting? The id name is not a dupe, I know that.
I think I must have a corrupt file. I can use the exact code above in a new movie, load it into another movie and it works fine. The sounds are only in the library of the external.
The file I need this to work on will not do squat, until I drag the sounds to the main movie library. Then it purrs along like nothing was wrong. I hate it when the rules change in the middle of the game. Reminds me a lot of Nam. :mad:
Just in case your following this, it was a corrupt fla. I used an earlier model and rebuilt. Used the same code I gave above. No sound files in the main movie, and it works exactly as advertised.
I hate it when it does that... :D
The most likely problem is that you refer to _root somewhere in the loaded movie so when it is inside another one the path is different and it doesn't work ...
No, no _root used, except in the buttons to make the parts of the loaded movie do their thing, and you have to use it there. And they all worked. What didn't work was the sound. But, as I mentioned, the problem ended up being a corrupted fla for the main movie. I've had several fla files get corrupted and just quit working before. I never found the problem, cause you can't see the source file of a fla. But it did start working with a new makeover, with the original sound code:
s1 = new Sound(this);
s1.attachSound("sound1");
s1.start(0,1);
Then the buttons are probably the problem! (By the way, there is no need to use _root ANYWHERE.) If you upload your FLA, I'll have a look for you.Quote:
no _root used, except in the buttons
When you load a movie inside another one, _root is a different location to when the movie is playing on the main timeline.
As for file corruption: have you ever heard of the zebra diagosis? Just because it has hooves, doesn't make it a zebra, especially if you are in a country where horses are most common.