Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-05-2008, 05:31 AM   PM User | #1
cain
New to the CF scene

 
Join Date: May 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
cain is an unknown quantity at this point
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>
cain is offline   Reply With Quote
Old 05-06-2008, 04:51 PM   PM User | #2
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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?
gnomeontherun is offline   Reply With Quote
Old 05-06-2008, 04:54 PM   PM User | #3
cain
New to the CF scene

 
Join Date: May 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
cain is an unknown quantity at this point
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)
cain is offline   Reply With Quote
Old 05-06-2008, 05:15 PM   PM User | #4
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.
gnomeontherun is offline   Reply With Quote
Old 05-06-2008, 05:38 PM   PM User | #5
cain
New to the CF scene

 
Join Date: May 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
cain is an unknown quantity at this point
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
cain is offline   Reply With Quote
Old 05-06-2008, 05:42 PM   PM User | #6
gnomeontherun
Senior Coder

 
gnomeontherun's Avatar
 
Join Date: Sep 2007
Location: Houston
Posts: 2,846
Thanks: 10
Thanked 238 Times in 229 Posts
gnomeontherun will become famous soon enoughgnomeontherun will become famous soon enough
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.
gnomeontherun is offline   Reply With Quote
Users who have thanked gnomeontherun for this post:
cain (05-06-2008)
Old 05-06-2008, 05:46 PM   PM User | #7
cain
New to the CF scene

 
Join Date: May 2008
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
cain is an unknown quantity at this point
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
cain is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:13 PM.


Advertisement
Log in to turn off these ads.