Attachsound and preloading

iam trying to break down one heavy flash swf into portions and loading each with a preloader.
As suggested by :

http://www.flashmove.com/forum/show...c+sound+loading

The soundloading has been an issue with flash, and so i tried to make a container flash file with prelaoders that load smaller swfs in sequence. Everything works fine, the movies get loaded in line, their internal navigation etc… works (all links are relative), But the sound doesnt work, it laods but doesnt start.

i am putting this code in the swf that i load:

ActionScript:



_root.my_sound = new Sound();
_root.my_sound.attachSound("song");
_root.my_sound.start(0, 999);
//
//*/
//*
var stopped:Boolean = false;
var mute:Boolean = false;
function startSound() {
   _root.my_sound.start(my_sound.position/1000, 999);
   //_root.content_mc3.image_mc << this is the container for this swf.
   music_btn.gotoAndStop("play");
   _root.stopped = false;
}
function restartSound() {
   if (_root.mute) {
      stopSound();
   }else{
      startSound();
   }
}
function stopSound() {
   _root.my_sound.stop();
   music_btn.gotoAndStop("stop");
   _root.stopped = true;
}
music_btn.onRelease = function() {
   if (_root.stopped) {
      startSound();
      _root.mute = false;
   } else {
      stopSound();
      _root.mute = true;
   }
};
///*/


now i may be going wrong with the relative paths, but nothing seems to work and thus this thread.

Did a search but i think the problem is in the code setup/heirarchy.

Thanks guyz…!

Report this post to a moderator | IP: Logged

SInce I don’t know where you have this code…
_root.my_sound.start(my_sound.position/1000, 999);

See if it helps to change it to:

_root.my_sound.start(_root.my_sound.position/1000, 999);

hey thanks for the reply…

but it didnt work, i have tried doing that. the code above is in the first frame of the external swf file. this file is being loaded in a content_mc.image_mc on teh root of the main file, thru a preloader.

its pretty simple organization of files, i mean all othe rexternal swf’s are working good , an dthe dont have sound, the interactive features with this one are also working, ,but just the sound is giving problems…

do i send you the structure of the Fla…?

lemme know…