Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flash General Questions > Flash 8 General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-21-2005, 11:42 AM   #1
juststeve
Registered User
 
Join Date: Jun 2002
Posts: 7
Default FLV Cuepoint question

Given the potential utility of cupoints in general the supplied documentation seems umm....lite.

To import cuepoint information from an XML file structured as:

<listitem title="Introduction" name="unit1_320_20.flv" start="0" len="-1" thumb="chap1.jpg">
<qPoint qName="q1_1" qTime=":44" qText="Caption to show first."/>
<qPoint qName="q1_2" qTime="1:15" qText="This text shows up at 1:15 et."/>
<qPoint qName="q1_3" qTime="1:45" qText="This played last"/>
</listtime>

Cuepoints can be created by:
var xmlPlaylist = new XML(); //setup a variable to hold the XML
xmlPlaylist.ignoreWhite = true;
xmlPlaylist.load( "playlist.xml" ); //load the XML file

xmlPlaylist.onLoad = function( status ) {
//trace("loading xml");
if ( !status )
trace( status );
var entries = this.childNodes[0];
for ( var i = 0; i < entries.childNodes.length; i++ ) {
var entry = entries.childNodes[i];

for ( var q = 0; q < entry.childNodes.length; q++ ) {

//trace ("entry.childNodes[q] = " + entry.childNodes[q].attributes.qName);
MakeCue( entry.childNodes[q].attributes.qTime, entry.childNodes[q].attributes.qName, entry.childNodes[q].attributes.qText);
}
var entry = entries.childNodes[i];

} //end xmlPlaylist.onload

function MakeCue(myTime:Number, myName:String, myParam:Object){
if (myTime <> undefined) {

//trace("myTime = " + myTime + "myName" + myName + "myParam = " + myParam);
my_FLVPlybk.addASCuePoint(1, myName, myParam);
}
}

Except that documentation does not provide an example usage of the parameter nor an example of converting conventional time notation (hh:mm:ss:ms) into Number. Imagine the ass we could kick if it did!


I'd very much appreciate any direction in these documentary holes by anyone able to address.

thx,
--steve...
juststeve is offline   Reply With Quote
Old 10-24-2005, 03:40 PM   #2
juststeve
Registered User
 
Join Date: Jun 2002
Posts: 7
Default

I've made some amount of progress. I'm now able to handle the parameter
with:
var listenerObject:Object = new Object();

listenerObject.cuePoint = function(eventObject:Object):Void {
trace("Elapsed time in seconds: " + my_FLVPlybk.playheadTime);
trace("Cue point name is: " + eventObject.info.name);
trace("Cue point type is: " + eventObject.info.type);
trace("Cue point parameters are: " + eventObject.info.parameters); for (var x in eventObject.info) { trace ("x=" + x + " in " + eventObject.info[x]);

}
synchText_txt.text = eventObject.info.parameters; } myVideoHolder.myVideo.addEventListener("cuePoint", listenerObject);


function MakeCue(myTime:String, myName:String, myParam:Object){
//trace("Making Cue");
var myCTime:Number;

if (myTime <> undefined) {
var convert2Seconds = myTime.split(":");
//todo - add detection/support for hours
if (convert2Seconds[0] == ""){
myCTime = Number(convert2Seconds[1]);
} else {
myCTime = (Number(convert2Seconds[0] * 60)) + Number(convert2Seconds[1]);
}
}
trace("myTime = "+ myCTime );
my_FLVPlybk.addASCuePoint(myCTime, myName, myParam);
}
juststeve is offline   Reply With Quote
Reply


Thread Tools
Display Modes 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. The time now is 08:34 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.