I have ten videos that I want to play, pause,scale up, change volume and unload. I created ten vars representing each video. EXAMPLE:
var sterling1:VideoLoader = new VideoLoader(“assets/sterling1.mp4”,{name:”sterling1”, container:this, onProgress:progressHandler, onComplete:completeHandler, autoplay:false});
I have ten MCs representing each video, each one with an ID. EXAMPLE:
sterlingButs.sterling1.ID = “sterling1”;
I created a function called playVid that I want to use to play the videos.
function playVid(event:MouseEvent):void {
targetMovie=event.target.ID;
trace("targetMovie "+targetMovie);
VARIABLE_HERE.load();
choreoButs.gotoAndStop("none");
sterlingButs.gotoAndStop("one");
break;
ETC…
I also have functions representing Rewind, Forward, scaleUp, and ScaleBack. EXAMPLE:
controls.RewBut.addEventListener(MouseEvent.CLICK,RewVidHandler);
function RewVidHandler(event:MouseEvent):void {
trace("Fwd");
trace(VARIABLE_HERE.videoTime);
VARIABLE_HERE.gotoVideoTime(VARIABLE_HERE.videoTime-5);
I can’t seem to figure out how to cast the variable I get when clicking the button into the VideoLoader instance name. Sorry if this seems too basic, but I just have a hard time with data types.