PDA

View Full Version : delay between music and main movie clip


miguel83
11-25-2009, 07:25 PM
hello guys
in my main timeline i have no movie clips. I have a jpeg called background that basically has all the moviestuff. however when i publish the file on the web i get a delay between the music and the movie. like almost 30 seconds. Im not quite sure how to fix this. I have a swf file that loads my main swf file. SWF file that loads the main swf is only a preloader.
here is the code for my music... i think that my problem is that the preloader is accounting for the movie clip but not the music, hence the difference in timing.

Thanks all for your help


var soundReq:URLRequest = new URLRequest("Matrix.mp3");
var sound:Sound = new Sound();
var soundControl:SoundChannel = new SoundChannel();
sound.load(soundReq);


sound.addEventListener(IOErrorEvent.IO_ERROR, function(evt:IOErrorEvent):void { trace(evt) } );

trace(sound);
trace(soundReq);
trace(onComplete);
sound.addEventListener(Event.COMPLETE, onComplete);

serv_btn.addEventListener(MouseEvent.CLICK, stopSound);
serv_btn.addEventListener(MouseEvent.CLICK, servButtonClicked);

function onComplete(event:Event):void
{
serv_btn.addEventListener(MouseEvent.CLICK, stopSound);
soundControl = sound.play();
}
function stopSound(event:MouseEvent):void
{soundControl.stop();
}


function servButtonClicked(event:MouseEvent):void
{
stop();
gotoAndPlay(87)
}