I’m trying to load some external videos into my project but I’m having some problems. This is what I’ve done but I recieve this error when I run the swf file.
1046: Type was not found or was not a compile-time constant: btn_button1. Source: import flash.events.MouseEvent;
1046: Type was not found or was not a compile-time constant: btn_button2. Source: import flash.events.MouseEvent;
package
{
import fl.video.FLVPlayback;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.display.MovieClip;
public class main extends Sprite {
var myPlayer:FLVPlayback = flv_player;
var empty_mc:MovieClip = new MovieClip();;
public function Main()
{
addChild(empty_mc);
// remove instance of the flv player on the stage and put it in the empty mc
removeChild(myPlayer);
empty_mc.addChild(myPlayer);
btn_button1.addEventListener(MouseEvent.CLICK,
onButtonClick);
btn_button2.addEventListener(MouseEvent.CLICK,
onButtonClick);
}
function onButtonClick(event:MouseEvent):void
{
if(event.target == btn_button1){
myPlayer.source = "X:/Third Year/Final Year Project/aude.flv";
}
else if(event.target == btn_button2){
myPlayer.source = "X:/Third Year/Final Year Project/christian.flv";
}
}
}
}
Can anyone help me with this problem?
Thankss