Please previous post. Thought might not get an answer if I included as as an attachment. Couldn’t amend my post and didn’t want it to look like it had been answered! My movie is called movie.fla but I’ve given it class name of vid.
package {
import flash.display.*;
import flash.events.*;
import MyClasses.*;//Import local classes from MyClasses folder
/*
This app shows 3 different ways of showing video and animation. The video must be brought into the stage by importing it
Clicking the buttons at the bottom brings up each type of object. The all have their own actionscipt classes to control them.
If you have imported a video, placed it on the stage and given it the name vid, then you can uncomment the video code
*/
public class VideoMain extends Sprite{
//Create objects we can use with actionscript. These are linked to symbols in the library.
//Each has its own actionscript file to control it internally...
private var banner:AnimationBanner = new AnimationBanner();
private var frames:AnimationFrames = new AnimationFrames();
public function VideoMain() {//This code is run when our application starts. It has the same name as the flash file...
//
addChild(banner);
addChild(frames);
//Set them to be invisible...
banner.visible = false;
frames.visible = false;
//Set up actions for the buttons at the bottom of the screen...
banner_btn.addEventListener(MouseEvent.CLICK, showBanner);
frames_btn.addEventListener(MouseEvent.CLICK, showFrames);
//Can only refer to vid if you have imported a video component and called it "vid".
vid.visible = false;
vid.addEventListener(MouseEvent.CLICK, showVid);
}
//The (event:MouseEvent) means that the function will only work if it is called from a mouse event (in this case, the user clicks the mouse)
private function showBanner(event:MouseEvent):void{
banner.visible = true;
frames.visible = false;
vid.visible = false;
movie_flv.stop();
}
private function showFrames(event:MouseEvent):void{
banner.visible = false;
frames.visible = true;
vid.visible = true;);
movie_flv.stop();
}
private function showVid(event:MouseEvent):void{
banner.visible = false;
frames.visible = false;
vid.visible = true;
movie_flv.stop();
}
}
}