Helpful Information
 
 
Category: Apache Flex
How to display different dialogs for different points in a Video

Hey everyone,

I'm working here with the New Flex Builder and AS3.0

I would like to play a movie clip and display different popups based on different points in the movie (in my example here I want to display one popup if the user clicks in the first 5 seconds and a different one after that)

Perhaps better would be to just pass in a number or string so the dialog box could delegate internally what to display, suggestions on better ways of handling this are more than welcome! (keep in mind im relatively new at this)


anyway this is what I've tried and it doesnt seem to work, hoping someone out there could tell me where I am goofing up

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalAlign="middle"
width="418" height="385">

<mx:Script>

<![CDATA[

<!-- Handles creating the pop up manager for the what was that window -->
import mx.managers.PopUpManager;

private function launchMoreInfo():void {


if (videoPlayer.playheadTime>5){
var winialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
}
else{
var win2ialog2 = PopUpManager.createPopUp(this, Dialog2, true) as Dialog2;
}
PopUpManager.centerPopUp(win);
}

]]>

</mx:Script>

<mx:VBox backgroundColor="white" width="416" height="383">
<mx:VideoDisplay width="415" height="349" id="videoPlayer"
source="./test.flv" />
<mx:HBox width="412" horizontalAlign="center">
<mx:Button label="Play" click="videoPlayer.play()" id="playButton"/>
<mx:Button label="What was that?" click="launchMoreInfo();videoPlayer.pause();"/>
</mx:HBox>
</mx:VBox>
</mx:Application>

I do not know Flex or AS3, which is extremely different from older versions of Flash. There are a few people around here who know some so I hope they post. If you just used Flash, I would be better able to assist.

I don't completely understand that point of your messages? Are they just randomly timed or do they sync with the video?

Well yes in this example I was just going to make them randomly timed but I was planning on having those times correspond with the video (which is why I am trying to track where the video head is)

You can use cue points, which when you export a video into Flash Video format it will set a marker in the video for Flash to pickup. That way they are synced and not just timed. What if your video needs more time to buffer? Then your messages will be off.

I was thinking Cue points may work, should I just have the cue points cause some tracker variable to increase so that if they user clicks the button it will show different dialogs?

I will look into that

On the other hand if it buffered, the video head wouldnt move right? So it shouldnt have some serious effect

also I was thinking of this as more of a standalone application (though I would like to write to work over the web as well)

thanks again for taking the time to respond jeremy

Yeah the video head wouldn't move, I was thinking of an example which you just timed the messages independently of the video.

Cue points are probably the best if you can figure them out, but I honestly have not used them nor AS3 as we've covered. I've never needed them, but I've read up on them. I think they are more reliable.

Ok I will try and figure out the CUE points, I actually think It may not be that hard because I know that I can add them in the Adobe cs3 web pack I have, I just have to figure how to access them in FLEX










privacy (GDPR)