I'm using bulkLoader and I got it set up using the class from their simple-example.fla and I've got it loading a video and audio successfully and playing them both simultaneously when I set my file class to SimpleExampleMain.as
Now, when I change it so that my file class is empty (since my main file is already using a different class) and I use:
it loads the audio and plays it fine, the trace says it loads the video, but the video never displays. It traces the y position of the video, but nothing displays.Code:var se:SimpleExampleMain=new SimpleExampleMain();
Any ideas??
Driving me crazy...
Thanks!!
Here's the SimpleExampleMain.as:
Code:package{ import br.com.stimuli.loading.BulkLoader; import br.com.stimuli.loading.BulkProgressEvent; import flash.events.*; import flash.display.*; import flash.media.*; import flash.net.*; public class SimpleExampleMain extends MovieClip{ public var loader : BulkLoader; public var v : Video; public var counter : int = 0; // simple example with few features public function SimpleExampleMain() { // creates a BulkLoader instance with a name of "main-site", that can be used to retrieve items without having a reference to this instance loader = new BulkLoader("main-site"); // set level to verbose, for debugging only loader.logLevel = BulkLoader.LOG_VERBOSE; // now add items to load // add a video, and force it to load paused loader.add("videoPath.flv", {maxTries:6, id:"the-video", pausedAtStart:true}); // of course, options can be combined: loader.add("audioPath.mp3", {"id":"soundtrack", maxTries:1, priority:100}); // dispatched when ALL the items have been loaded: loader.addEventListener(BulkLoader.COMPLETE, onAllItemsLoaded); // dispatched when any item has progress: loader.addEventListener(BulkLoader.PROGRESS, onAllItemsProgress); // now start the loading loader.start(); } public function onAllItemsLoaded(evt : Event) : void{ trace("every thing is loaded!"); // attach the vÃ*deo: var video : Video = new Video(); // get the nestream from the bulkloader: var theNetStream : NetStream = loader.getNetStream("the-video"); trace("theNetStream "+theNetStream); addChild(video); video.attachNetStream(theNetStream); theNetStream.resume(); video.y = 300; trace("video.y "+video.y); // get the sound: var soundtrack : Sound = loader.getSound("soundtrack"); soundtrack.play(); } // this evt is a "super" progress event, it has all the information you need to // display progress by many criterias (bytes, items loaded, weight) public function onAllItemsProgress(evt : BulkProgressEvent) : void{ trace(evt.loadingStatus()); } } }




Reply With Quote