Hello there,
Noob alert
I am working on flash (as3) template that I downloaded.
I created a movieclip that is placed in the root where I have a AS3 FLVPlayback Component, and also an animation, and a button.
By default the animation is always running, and only when I hit the button the video automatically loads and on the end of the video since I didn’t know how to unload it I made it to be transparent.
Well it may not be the best to do, but it actually works.
My problem started when I wanted to load another video from another mc/frame, I tried the code on both sides, but when I try to test it I get the error:
(TypeError: Error # 1010: A term is undefined and has no properties)
TypeError: Error #1010: Um termo é indefinido e não tem propriedades.
at pnlsite_v9_fla::video_5/frame1()
import com.greensock.*;
import com.greensock.easing.*;
import fl.video.VideoEvent;
/************** Slide button 1 **************/
var invisible_menu : Number = menu_mc.x;
var visible_menu : Number = 182;
menu_mc.addEventListener(MouseEvent.ROLL_OVER,showMenu);
menu_mc.addEventListener(MouseEvent.ROLL_OUT,hideMenu);
function showMenu(event:MouseEvent) :void{
TweenLite.to(menu_mc, .4, {x:visible_menu,ease:Linear.easeNone});
}
function hideMenu(event:MouseEvent):void {
TweenLite.to(menu_mc, .4, {x:invisible_menu,ease:Linear.easeNone});
}
//Button on the same frame as videoplayer component
menu_mc.btn1.addEventListener(MouseEvent.CLICK, vid1);
function vid1(e:Event):void{
vidPlayer.source = "hancock.flv";
vidPlayer.volume = 1;
};
//video end-transparent
vidPlayer.addEventListener(VideoEvent.COMPLETE, completePlay);
function completePlay(e:VideoEvent):void {
vidPlayer.alpha=0;
}
//calling from other(page)mc/frame button
Object(this).flashmo_contents.vbtn.wvideo1.addEventListener(MouseEvent.CLICK, vid2);
function vid2(e:Event):void{
vidPlayer.source = "video1.flv";
vidPlayer.volume = 1;
};
//quando o video terminar fica transparente e permite mostrar a animação por trás.
vidPlayer.addEventListener(VideoEvent.COMPLETE, completePlayx);
function completePlayx(e:VideoEvent):void {
vidPlayer.alpha=0;
}