I’m trying to reset videoBG to “0” what I mean is to start over from play, and alpha, anytime the video is replayed???
SO confused right now. So if the playhead is being replayed from the beginning so goes the videoBG? How would I do that?
THANKS SO MUCH FOR ANY HELP!!!
import fl.video.VideoEvent;
import fl.video.VideoState;
stop();
this.bgPlayed = false;
videoBG.alpha = 0;
shareBtn.alpha = 0;
videoPlayer.addEventListener(VideoEvent.PLAYHEAD_UPDATE, onTick, false, 0, true);
//videoPlayer.addEventListener(VideoEvent.STATE_CHANGE, onStateChange, false, 0, true);
function onTick(e:VideoEvent):void
{
//videoBG.alpha = e.target.playheadPercentage / 100;
var fadeStartTime:int = 45;
var triggerTime:int = 55;
if (e.playheadTime >= fadeStartTime)
{
videoBG.alpha = (e.playheadTime - fadeStartTime) / (triggerTime - fadeStartTime);
shareBtn.alpha = (e.playheadTime - fadeStartTime) / (triggerTime - fadeStartTime);
}
if (e.playheadTime >= triggerTime && !videoBG.playing && !this.bgPlayed) {
this.bgPlayed = true;
videoBG.play();
}
//trace(e.target.playheadPercentage);
}
function onStateChange(e:VideoEvent):void
{
if (e.state == VideoState.STOPPED)
{
}
}