[Extendflash] Detecting keyframes
Barbara Snyder
brsnyder at macromedia.com
Mon Jun 27 10:56:42 PDT 2005
I found the following example in the layer.frames entry in the Extending
Flash book. I don't know if you are trying to do this in ActionScript or
JavaScript, but here is one way to do it in JS:
The following example sets the variable frameArray to the array of Frame
objects for the frames in the current document:
var frameArray = fl.getDocumentDOM().getTimeline().layers[0].frames;
To determine if a frame is a keyframe, check whether the
frame.startFrame property matches the array index, as shown in the
following example:
var frameArray = fl.getDocumentDOM().getTimeline().layers[0].frames;
var n = frameArray.length;
for (i=0; i<n; i++) {
if (i==frameArray[i].startFrame) {
alert("Keyframe at: " + i);
}
}
________________________________
From: extendflash-bounces at flashguru.co.uk
[mailto:extendflash-bounces at flashguru.co.uk] On Behalf Of Hawley,
Geoffrey M. (Contr)
Sent: Monday, June 27, 2005 9:09 AM
To: extendflash at flashguru.co.uk
Subject: [Extendflash] Detecting keyframes
Is there a way to test a given frame and find out wether it is already a
keyframe? I feel like this should be very obvious, but I've been
reading/looking/testing for a while with no results...
Thanks for your time,
Geoffrey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20050627/e93db00c/attachment.htm
More information about the Extendflash
mailing list