Skip to main content
June 29, 2006
Answered

Loaded .swf loses functionality (Flash 8 Loader compnent)

Hi all...long-time listener, first -time caller...

I have a file with a Loader and ProgBar component. The Loader pulls in a swf with buttons. The buttons control Sound objects to play MP3 files. When the second swf loads, the MP3's dont play. The music is embedded, not loaded externally. If i call the direct URI of the swf, the dopey thing plays! But loaded through the Loader component...the swf loads, the buttons display their rollovers...but the sounds refuse to play...it fails in test movie too...

I'm certain that this is just a fundamental flaw I've created (the missing curly bracket syndrome), but i havent got a clue what it is and any help would be greatly appreciated.
This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer
July 2, 2006
Thanks Lon...sorry I havent gotten back but yesterday was my birthday and i was hanging with family all day...
Im such a bone head...here it is (referring to above posted code...)

Instead of mySound =new Sound();

mySound = new Sound(_root);

Thanks to both of you guys for your help....obviously this would've fixed the MovieClipLoader thingie too

Peace

Stephen McDaniel
New Century Graphics

9 replies

Inspiring
June 30, 2006
could you post the complete AS source used on the button?
Translate
June 30, 2006
Hi Jan-Paul...here it is...
_______begin code_______
on (press) {
stopAllSounds();
mySound = new Sound();
mySound.attachSound("pl");
mySound.setVolume(100);
mySound.start();
}
_______end code_______
I've tried declaring the sound var everywhere...the loader clip's main timeline...I even tried declaring it as a _global...still no joy...
It is clear that this is something to do with how I'm handling the Sound object, but still don't get why myLoader.content._lockroot=true didnt work...
Remember...the player works when called by itself...it just fails to play in the loader...
Your continues help is much appreciated...
Translate
Inspiring
June 29, 2006
did you experience the same problems when using the MovieClipLoader in order to load you external movie into the main movie?

I wouldn't be to surprised if the flash loader component doesn't do its job as intended on complex flash aplications. My experience is that it is faster and more flexibe to build your own preloders instead of using built in components.

simply try the following to load your external mc:

var mcl:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadInit = function (){
trace("done loading");
}
listener.onLoadProgress = function(target_mc, loadedBytes:Number, totalBytes:Number) {
trace(loadedBytes+ " of "+loadedBytes+" bytes loaded");
}
mcl.loadClip("sound.swf",target_mc);
Translate
June 30, 2006
Thanks Jan-Paul and Lon... your assistance is greatly appreciated...

I feel tantalizingly close, but using MovieClipLoader class to do an overt load (instead of using the Loader component) results in the same behavior. Clip loads, sound objects fail...
I always proceed from the assumption that whatever is wrong is my doing (and I am still assuming that), but this is getting irksome...
I've tried using "this.myLoader.content._lockroot = true" on the main timeline of the loader SWF, and it failed as well. It seems clear that the only problem is that the loader doesnt see the Library for the loaded clip (the MP3's), but I am not even referencing _root anywhere in the loaded clip! This clip is seven buttons that trigger sounds, not complex by any means...this stuff is making me long to go back to working in scenes (said ironically).
The buttons use attachSound()...so i kinda get whats happening...but if the Loader can't see the loaded clip's lib, why the heck are the buttons showing up?

Any and all help (including just telling me I'm a big dope and should give this up) is appreciated...
Translate
Inspiring
June 29, 2006
Not sure if this is what you need to consider:
http://livedocs.macromedia.com/flash/8/main/00002980.html

--
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
"devilmuzik" <webforumsuser@macromedia.com> wrote in message
news:e7v7a7$m9v$1@forums.macromedia.com...
> Hi all...long-time listener, first -time caller...
>
> I have a file with a Loader and PrgBar component. The Loader pulls in a
> swf
> with buttons. The buttons control Sound objects to play MP3 files. When
> the
> second swf loads, the MP3's dont play. The music is embedded, not loaded
> externally. If i call the direct URI of the swf, the dopey thing plays!
> But
> loaded through the Loader component...the swf loads, the buttons display
> their
> rollovers...but the sounds refuse to play...it fails in test movie too...
>
> I'm certain that this is just a fundamental flaw I've created (the missing
> curly bracket syndrome), but i havent got a clue what it is and any help
> would
> be greatly appreciated.
>


Translate
June 29, 2006
Thanks Lon...
I got really excited and set lockroot on the SWF I am loading...to no avail...
If I copy the sound files from the musicplayer.fla Library into the musicloader.fla Library, it works. This seems to make it clear that it is a _root mixup, but I am mystified why "this._lockroot=true" on the main timeline doesnt work. Obviously there isnt much point in having a 3 Mb preloader for a 3 Mb movie...
I'm still looking...
Translate