![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
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; } <mx ataGrid id='TOCGrid' x="10" y="114" width="192" height="470"dataProvider="{InstructorVideo.cuePoints}" change="JumpQue(event.currentTarget.selectedItem); "> <mx:columns> <mx ataGridColumn headerText="Table of Contents:" dataField="name"/></mx:columns> </mx ataGrid> |
| Sponsored Links |
|
|||
|
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. |
|
|||
|
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> |
|
|||
|
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. |
|
|||
|
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! |
|
|||
|
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; } |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise