I have this video button, with a class attached, All works ok but when I come to press the button I get my trace but the player does not work.
MY BUTTON is in a Container
MY FLVPlayer is in another Container
my button class is as follows:
package com.ppr.buttons{
import flash.events.*;
import flash.display.*;
import flash.media.Video;
public class lrgPlayButton extends MovieClip {
//-- some setting/properties or variables as I know them
private var videoContainer:MovieClip;
public function lrgPlayButton(vCont:MovieClip) {
// constructor code
stop();
this.alpha=.4;
videoContainer= vCont;
this.buttonMode = true;
this.addEventListener(MouseEvent.MOUSE_OVER, buttonOver);
this.addEventListener(MouseEvent.MOUSE_OUT, buttonOut);
this.addEventListener(MouseEvent.CLICK, buttonClick);
}
private function buttonClick(e:MouseEvent)
{
trace("Play " + videoContainer);
[COLOR="DarkOrange"]//-- how do i reference the flvplayer on the
//--- on the stage within a container named videoContainer and flvplayer instance named _flvPlayer[/COLOR]
[COLOR="Red"]videoContainer._flvPlayer.play();[/COLOR]
}
private function buttonOver(e:MouseEvent)
{
this.gotoAndStop(2);
this.alpha=1;
}
private function buttonOut(e:MouseEvent)
{
this.gotoAndStop(1);
this.alpha=.4;
}
}
}
on the Stage of my flash I have the following as to attach the button within a container:
var lrgPlayBtn:lrgPlayButton = new lrgPlayButton(videoScreenContainer);
_contentCont_mc.addChild(lrgPlayBtn);
lrgPlayBtn.y=140;
lrgPlayBtn.x=245;
My flv player is in a container called: videoScreenContainer with a instance name of _flvplayer, and this is placed on the stage.
At the moment I am passing the name of the video container into the above constructer ‘public function lrgPlayButton(vCont:MovieClip) {..’ then assigning that to a variable called ‘videoContainer= vCont;’ thus…
thinking it would be 'videoContainer._flvPlayer.play();'so I thought.
any ideas how I can do this?
many thanks
Si