Copy link to clipboard
Copied
I have a Flash presentation that allows me to pair videos with the slides using a nice piece of ActionScript. The presentation advances to the slide on the next keyfram when the viweer clicks the "next button" and the video for that keyframe (on a separate layer) begins playing.
owever, I am now trying to pair two slides with the same video without having the video restart or requiring the viewer to click the"next slide button" I was hoping I could just turn the two slides into a video clip, convert it into a symbol and insert the symbol in place of the static slide, but nothing seems to happen. I'm wondering if the "gotoAndStop" function in the ActionScript is preventing it from playing.
Any thoughts on how I can have the presentation be controlled by the next and previous buttons most of the time, but have the exception of one slide that changes on its own? The relevant (I believe) code is below.
Thanks!
Julien
// FUNCTIONS AND LOGIC
function fl_prevSlide():void
{
if(slides_mc.currentFrame > 1)
{
slides_mc.gotoAndStop(slides_mc.currentFrame-1);
if(transitionOn == true)
{
fl_doTransition();
}
if(pageNumberOn == false)
{
slideNumber_txt.text = "";
} else {
slideNumber_txt.text = String(slides_mc.currentFrame + "/" + slides_mc.totalFrames);
}
}
}
function fl_nextSlide():void
{
if(slides_mc.currentFrame < slides_mc.totalFrames)
{
slides_mc.gotoAndStop(slides_mc.currentFrame+1);
if(transitionOn == true)
{
fl_doTransition();
}
if(pageNumberOn == false)
{
slideNumber_txt.text = "";
} else {
slideNumber_txt.text = String(slides_mc.currentFrame + "/" + slides_mc.totalFrames);
}
}
}
Copy link to clipboard
Copied
what do you want to trigger one frame to move to another? the end of a video? if so, is the video playing in an flvplayback component?
Copy link to clipboard
Copied
Thanks for the quick response!
Yes, the video is in a flvplayback component, but I want the slide to advance partway through the video. I was hoping that the slide advance would be triggered after a certain amount of time. Is that feasible?
Copy link to clipboard
Copied
yes, you can use (among other things) a timer:
var t:Timer=new Timer(10000,1); //10000 ms = 10 seconds
t.addEventListener(TimerEvent.TIMER,f);
t.start();
function f(e:TimerEvent):void{
gotoAndStop(whatever);
}
Copy link to clipboard
Copied
Is there is metadata available in the video? If so you can use that to control advancement of the slides.
Copy link to clipboard
Copied
No, there is no metadata at the moment. I could add it if need be--is there a simpler solution? If not, how would I use metadata to trigger the advance?
Thanks for the response!
Copy link to clipboard
Copied
Try this code. Replace FLVmovie with the instance name of your FLV & set the time to when the frames shoudshould advance.
import flash.events.Event;
this.addEventListener(Event.ENTER_FRAME, checkTime);
function checkTime(e:Event):void {
if (this.FLVmovie.playheadTime >= 15) // This is the playhead time in seconds
{
this.gotoAndStop("frame label or frame #");
this.removeEventListener(Event.ENTER_FRAME, checkTime);
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now