Adobe Dreamweaver Forums



Last 10 THreads :         RoboHelp 7 Skins (Last Post : HelpDev - Replies : 7 - Views : 35 )           »          Code that can effect two movie clips (Last Post : Alessandroy - Replies : 0 - Views : 1 )           »          Clock .getUTC not working (Last Post : kglad - Replies : 3 - Views : 4 )           »          problems linking PDFs (Last Post : Alan - Replies : 1 - Views : 2 )           »          Changing RadioButton Label (Last Post : justintoflex - Replies : 2 - Views : 5 )           »          Table Borders MIssing in JavaHelp (Last Post : soxmann - Replies : 3 - Views : 8 )           »          cfimage error (Last Post : masoud_amen - Replies : 2 - Views : 3 )           »          Dragging components (Last Post : hsfrey - Replies : 2 - Views : 4 )           »          Is file too large? (Last Post : tweaked_eye - Replies : 0 - Views : 1 )           »          Could not find the included template (Last Post : azuro28 - Replies : 2 - Views : 3 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-28-2008, 01:53 PM
rckehoe
 
Posts: n/a
Diggs:
Default playheadTime issue

I am having a small issue with playheadTime. I have a datagrid that lists all
the cuePoints for my video... I am trying to jump to certain cuePoints when you
select an item from the grid. I have not been having much luck, for some reason
it when I use this playheadTime function, it always jumps me 20 seconds for
each cuePoint...

For Example:
Point 1: 20 Seconds
Point 2: 40 Seconds
Point 3: 60 Seconds (or 1 Minute)

I have manually entered my info, but for some reason is not working...

Here is my script, any help would be appreciated.

private function JumpQue(SELObj:Object):void{
var NewTime:int = SELObj.time;
InstructorVideo.playheadTime=NewTime;
}


<mxataGrid id='TOCGrid' x="10" y="114" width="192" height="470"
dataProvider="{InstructorVideo.cuePoints}"
change="JumpQue(event.currentTarget.selectedItem); ">
<mx:columns>
<mxataGridColumn headerText="Table of Contents:" dataField="name"/>
</mx:columns>
</mxataGrid>



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-30-2008, 05:54 PM
rtalton
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

Is this a progressive download? If it is, seeking to a cuepoint will take you
to the first keyframe after a cuepoint, not the cuepoint itself. Place your
cuepoint before the keyframe nearest the time you are seeking to, and it will
jump to the correct position.

Reply With Quote
  #3 (permalink)  
Old 11-30-2008, 11:53 PM
John Hall
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

So you're saying no matter what you click on, it jumps to the first cue point, right?
Reply With Quote


  #4 (permalink)  
Old 12-01-2008, 02:33 AM
rckehoe
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

I am new to Flex, so I will try to answer these questions as best that I can...

I did not encode the FLV videos that I am going to use, I am creating the
cuePoint array in the VideoDisplay tag like the code below...

And no, it doesn't jump to the first cue point. It always jumps 20 seconds for
each cuepoint...

For example:
The first line in the data grid jumps to 20 seconds (rather than 11)
The second line in the data grid jumps to 40 seconds (rather than 22)
The third line in the data grid jums to 60 seconds (rather than 33)

This goes on for all the lines in the datagrid, all of which are spaced 20
seconds apart.

<mx:cuePoints>
<mx:Array>
<mx:Object name="01 - eTraining" time="11"/>
<mx:Object name="02 - Attend and Retake" time="22"/>
<mx:Object name="03 - Keyfactors" time="33"/>
<mx:Object name="04 - Consistent Learning" time="56"/>
<mx:Object name="05 - Certifications" time="69"/>
<mx:Object name="06 - Global Access Training" time="88"/>
<mx:Object name="07 - Save!" time="108"/>
</mx:Array>
</mx:cuePoints>



Reply With Quote
  #5 (permalink)  
Old 12-01-2008, 03:33 AM
rtalton
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

The event handler should be looked into next.
I wouldn't use "event.currentTarget.selectedItem" as the parameter.
Simply pass the event object itself and it will contain the selected item that
you want to get to...

Edit your change event on the Data Grid like so:
change="JumpQue(event)"

Edit your handler like so:
private function JumpQue(event:ListEvent):void{

Put a break point in the handler. Now go into debug, click a row in the Data
Grid, and look at the event.currentTarget in the handler.
Look for the value of the Data Grid item you cliked on and that it contains
the value you are expecting. Many times you will see that you need to use a
different "path" to get to the selected item's property, and the correct time
value you are looking for.

If you can post complete code, this might help also.

Reply With Quote
  #6 (permalink)  
Old 12-01-2008, 03:53 AM
rckehoe
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

I don't mean to sound like a complete Newb... But... I get an error... Here is
the error, perhaps you can lead me in the right direction.

1046: Type was not found or was not a compile-time constant: ListEvents




Reply With Quote


  #7 (permalink)  
Old 12-01-2008, 04:03 AM
rckehoe
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

Actually, I think the syntax was incorrect... I tried the following, and there are no more errors...

private function JumpQue(ListEvent:Event):void {

Is this the same thing as what you said ?
Reply With Quote
  #8 (permalink)  
Old 12-01-2008, 04:33 AM
rtalton
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

Close! It should read:
private function JumpQue(event:ListEvent), not:
private function JumpQue(ListEvent:Event) -you have it backwards in the
parenthesis from what I wrote.

Just to be clear, "event" is a made-up variable name/word, and "ListEvent"
tells Flex what kind of event is coming into the function. You could substitute
any suitable word instead of "event", like:
JumpQue(wowzah:ListEvent), or
JumpQue(evt:ListEvent), or
JumpQue(dirtyHarry:ListEvent)...
...but you should tell Flex that this is a ListEvent dispatched by the List
control.
Your syntax works because you are telling Flex to use a made-up word
"ListEvent" of type "Event"-a generic Event object. Not real accurate, but it
should work.
I think you have it now, since you are not getting an error. Read the help
docs on the error object. Then when you are setting up an event handler (oops,
er, "listener"), also look in the help docs for the control (DataGrid, List,
Image... whatever you are using) and see the "Events" section for the control.
There you pick the event that makes the most sense to you and "listen" for that
event. This will tell you what event type to put into the parenthesis after
your variable name. Remember, it's "(variablename:EventType)"

Good Luck!




Reply With Quote
  #9 (permalink)  
Old 12-01-2008, 04:33 PM
rckehoe
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

ok... I got the ListEvent deal working without error, but when I click on an
item from the datagrid it still doesn't advance the video to the correct spot.

So... I add a response.text at the bottom of the function to see what the
variable is. In the textbox I created, it shows the correct number...

My question is... Am I to put a whole number in seconds like... 33 seconds, 26
seconds... Or should it be a decimal or something... 0.3, or 0.26 ??

here is the NEW function that you had me change...

private function JumpQue(TimeEvnt:ListEvent):void {
var NewTime:int = TimeEvnt.currentTarget.selectedItem.time;
InstructorVideo.playheadTime=NewTime;
response.text = TimeEvnt.currentTarget.selectedItem.time;
}

Reply With Quote


  #10 (permalink)  
Old 12-01-2008, 04:43 PM
rtalton
 
Posts: n/a
Diggs:
Default Re: playheadTime issue

I'm going to look at this and get back to you in a bit...
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 11:55 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk