# Playing different Flash Video Using the same AS3 FLVPlayback Component

**URL:** <https://forum.kirupa.com/t/playing-different-flash-video-using-the-same-as3-flvplayback-component/322677>\
**Category:** flash\
**Created:** [May 30, 2011, 9:15am UTC](https://forum.kirupa.com/t/playing-different-flash-video-using-the-same-as3-flvplayback-component/322677 "2011-05-30T09:15:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deaconpt](https://avatars.discourse-cdn.com/v4/letter/d/8797f3/32.png) [@deaconpt](https://forum.kirupa.com/u/deaconpt)\
**Post date:** [May 30, 2011, 9:15am UTC](https://forum.kirupa.com/t/playing-different-flash-video-using-the-same-as3-flvplayback-component/322677/1 "2011-05-30T09:15:30Z")

</div>

Hello there,

Noob alert ![](http://forum.kirupa.com/uploads/kirupa/6548/c9853fda77b909b3.gif)

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()

```auto

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;
}

```
