I have some code that works great for external SWF files, but I'm struggling to find good samples and what I have to tweak to load FLV or MP4 files...
Basically my problem is in completeHandler where I simply want to play the video - I can't get it to go, and get this error - and I've tried .playVideo(); and no go either... I know I'm missing something basic - so basic it isn't even IN the samples I've been reviewing...
Although I poke around in as3, I am not good enough to dig into the API documentation and make heads or tails out of it - and I just can't find *complete* samples of how to do this that don't make assumptions which I guess I don't have setup right.
TypeError: Error #1034: Type Coercion failed: cannot convert flash.media::Video@2be513f9 to flash.display.MovieClip.
var Comic_mc:MovieClip;
import com.greensock.*;
import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;
function PreviewLoad(ComicSWF:String) {
// for testing, hardcode
//ComicSWF = "SWFTest.swf";
//ComicSWF = "MP4Test.mp4";
ComicSWF = "FLVTest.flv";
var queue:LoaderMax = new LoaderMax({name:"comicQueue", onProgress:progressHandler, onComplete:completeHandler, onError:errorHandler});
if (ComicSWF.indexOf(".mp4") > 0) {
queue.append( new VideoLoader(ComicSWF, {name:"comicClip", container:this, width:640, height:360, z:1000000, autoPlay:false}) );
}
if (ComicSWF.indexOf(".flv") > 0) {
queue.append( new VideoLoader(ComicSWF, {name:"comicClip", container:this, width:640, height:360, z:1000000, autoPlay:false}) );
}
if (ComicSWF.indexOf(".swf") > 0) {
queue.append( new SWFLoader(ComicSWF, {name:"comicClip", container:this, width:640, height:360, z:1000000, autoPlay:false}) );
}
queue.load();
}
function progressHandler(event:LoaderEvent):void {
trace("progress: " + event.target.progress);
}
function completeHandler(event:LoaderEvent):void {
var ComicDisplay:ContentDisplay = LoaderMax.getContent("comicClip");
trace(event.target + " is complete!");
Comic_mc = ComicDisplay.rawContent;
Comic_mc.x = 10;
Comic_mc.y = 10;
addChildAt(Comic_mc,0);
LoadingPreview_mc.y=2000;
Comic_mc.s
Comic_mc.play();
}
function errorHandler(event:LoaderEvent):void {
trace("error occured with " + event.target + ": " + event.text);
}