arthur-debert/BulkLoader — Issue #137: Audio playing before completely loaded (swf)
Author: hagmic
Created: 2012-01-12 21:14:26+00:00
State: open

I've searched the web for hours trying to find solutions for this (and I've found some that are closs), so I apologize for posting my own, but I am having issues with the audio playing before the swf has fully loaded. The audio will play and ten seconds later the swf video will show up. If I just test my movie, they start at the same time, but when I "simulate download", the audio starts a good ten seconds before the video.

Also, if I take out the addChild in the handleLoadComplete function, the audio still plays. Thanks in advance for any help!

package {

import flash.display.MovieClip;
import br.com.stimuli.loading.BulkLoader;
import flash.events.ProgressEvent;
import flash.events.Event;
import br.com.stimuli.loading.loadingtypes.LoadingItem;

public class BulkLoaderTester extends MovieClip {

private var bl:BulkLoader;
private var uniqueId:String = "content";

public function BulkLoaderTester() {
bl = new BulkLoader("tester");

bl.add("content/01_Introduction/01_01.swf", {id:uniqueId});

bl.get(uniqueId).addEventListener(ProgressEvent.PROGRESS, handleLoadProgress);
bl.get(uniqueId).addEventListener(Event.COMPLETE, handleLoadComplete);

bl.start();

}

private function handleLoadProgress(e:ProgressEvent):void{
trace(e);
var li:LoadingItem = LoadingItem(e.currentTarget);

trace("Is SWF:" + li.isSWF());
}

private function handleLoadComplete(e:Event):void{
trace(e);

var mc:MovieClip = new MovieClip();
mc.addChild(bl.getMovieClip(uniqueId));

addChild(mc);
}
}

}