Hi
I'm trying to control the flv files using xml.
The format for setting cuepoints normally is 00.00.00.000
However action script requires you enter a number so the above is not allowed.
You can use 00.000 i.e. up to 99.999 however when you reach 100.000 it stops
working.
I noticed someone had the same query last year so I'm hoping that someone has
found a workaround since then!
David Stiller - 10 Jul 2007 16:42 GMT
Joanne-678,
> The format for setting cuepoints [for FLVs] normally is 00.00.00.000
I'm with ya.
> However action script requires you enter a number so the above
> is not allowed. You can use 00.000 i.e. up to 99.999 however
> when you reach 100.000 it stops working.
How are you coding this? Are these numbers something you're setting
with ActionScript, or via the video import wizard? If 99.999 refers to
seconds, that amounts to one minute, 39 seconds, and 999 milliseconds. In
the 00.00.00.000 format, that could also be displayed as 1.39.999, and one
more second than that would be 1.40.999.
David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
Joanne-678 - 10 Jul 2007 17:13 GMT
Hi
I'm using action script (flash professional 8)
I have videos of 8-15 mins duration and I want to have a cue points throughout.
I'm after downloading a trial version of cs3 which as an import/export
cuepoints function on flash encoder which is a workaround (for 30 days.)
I saw from that that it uses miliseconds so I'm after putting in the
milliseconds code in the flash 8 xml (i.e. 2:12.717 = 133717) file but it falls
over too.
I haven't tried that on CS3 but I guess I can.
I would prefer not to have to buy another version though!
David Stiller - 10 Jul 2007 17:39 GMT
Joanne-678,
> I'm using action script (flash professional 8)
That's no problem.
> I'm after downloading a trial version of cs3 which as an
> import/export cuepoints function on flash encoder which
> is a workaround (for 30 days.)
The importer is nice, because you can work with XML files for
convenience, but Flash 8 does allow you to specify cuepoints
visually/manually in the import wizard (see Advanced Settings) on the
Encoding page of the wizard.
> I haven't tried that on CS3 but I guess I can.
The upgrade is terrific, but you don't need it for what you're trying to
do.
When you say you're using XML, I'm not sure what that means in this
particular scenario. XML is as malleable as it gets, so there's really no
telling (without further detail) how you're using XML to accomplish what
you're after. Ultimately, though, it's not the XML that matters ... XML
files are nothing more than a text-file way to convey data to a SWF. You
could define these cuepoints entirely in ActionScript, if need be -- though
depending on the number of cuepoints and video files, XML is almost
certainly more convenient. ;) Just remember that data in XML will come
into your SWF as text, so you may need to convert strings into numbers,
Booleans, and so on.
Like GWD, I've had no problems specifying cuepoints beyond 99.999
seconds.
David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
GWD - 10 Jul 2007 17:14 GMT
If you are using FLVPlayback that's correct: cuepoints in work in seconds. You
can set them to 3dp, but in practice the precision for when actionscript-based
cuepoints fire is determined by the playheadUpdateInterval setting. From memory
I think the livedocs says the default precision is 100 ms. The cuepoint name
and timecode are two separate things. A cuepoint could be called 'yeehaa' with
a timecode of 127.773
I have no issues with setting them above 100.000 - I'm doing something similar
from xml and its working fine. Only thing I can suggest is that if you are
using flash 8 make sure you have the upgraded the FLVPlayback component. There
was a bugfix release mid 2006... although I can't recall it being related to
anything like what you describe (I think it was to do with problems playing 2
flvs in sequence...can't recall exactly).
GWD - 10 Jul 2007 17:28 GMT
Oops two replies before my post...
David, I'll leave this in your capable hands.
Two thoughts:
a) I don't know what happens if you pass a string value representation of a
number to FLVPlayback.addASCuePoint() .. I'd imagine it should convert to
number.. but perhaps its safest to check that's done first.
b) (David I think you're already heading in this direction) What is the
timecode format in the xml source and if its not in seconds how is it being
converted.
Joanne-678 - 10 Jul 2007 17:38 GMT
Hi
I was reading in from an xml file
<slide>slide01</slide>
<time>00.00</time>
using "slide" as the name and "time" as the timecode
The following is the code I use in the action script
my_FLVPlybk.addASCuePoint(masterArray[initialIndex][8][f_i][1],
masterArray[initialIndex][8][f_i][0].toString(),"navigation");
it looks confusing but the values passed are correct.
I've passed the name as a string but left the time as a number.
I have changed the number to the millisecond representantion but that doesn't
work either.
Because CS3 allows you to import XML files I can use that for this project.
HOwever it would be nice to be able to include everything in the one xml file
which specifies the entire session (and also it annoys the heck out of me when
I can't figure it out :) )
GWD - 10 Jul 2007 18:05 GMT
Ok...one quick reply.. perhaps you've already done this at the time you
populated your masterArray from the xml... but just in case:
The XML source will return a string for the content in the XML (as2 code
example)
var myXML:XML = new XML("<time>100.000</time>")
var numberContent = myXML.firstChild.firstChild.nodeValue
trace(numberContent); //traces 100.000
trace(typeof numberContent) //traces string... needs to be converted to
number with Number()
GWD - 10 Jul 2007 18:13 GMT
@David that lag with your posts arriving gets me every time. You already said the same thing as my last post. I should've done what I said earlier and left it to you...
David Stiller - 10 Jul 2007 18:50 GMT
GWD,
> @David that lag with your posts arriving gets me every time. You
> already said the same thing as my last post. I should've done what
I said earlier and left it to you...
Haha, no worries! I wouldn't have stated my reply any better than you
did yours. :)
David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."
Joanne-678 - 11 Jul 2007 09:53 GMT
thanks a million lads: I had searched for toNumber thinking it would be the same format as toString and when I didn't find it I thought that there wasn't such a function - duh!
LynxDaemon - 29 Jul 2008 14:45 GMT
Sorry to dig out a old post, but I got the same problem and haven't found the
answer yet. I upgrade the component and make shure it's a Number(), but it
still doesn't work.
My code look like this:
myVid.addASCuePoint(Number(captions[i].attributes.cue),
captions[i].firstChild.nodeValue);
While "Number(captions[i].attributes.cue" comme from an xml and show a number,
and captions[i].firstChild.nodeValue a string. It works perfectly fine until I
go over 100 seconds. Any idea?...
Rothrock - 29 Jul 2008 15:48 GMT
I would recommend against casting as a Number(). With XML there could be hidden
characters or what have you that can cause it to fail.
The proper function to use when you have something you want to change to a
number is parseInt() or parseFloat() -- I've never seen those fail.
Hector McDougal - 31 Jul 2008 10:45 GMT
I have the same problem as LynxDaemon in flash 8, AS2. Any cuepoint over 100 causes it to stop working properly. Very annoying.