[Extendflash] Here's code for some helpful (at least for me) Timeline navigation tools

Hawley, Geoffrey M. (Contr) Geoffrey.Hawley at ngc.com
Thu Jun 30 16:46:32 PDT 2005


This may be rookie stuff, but I've found this to be QUITE useful.
Hopefully someone else here will get some use out of it as well.

I could not believe that there was not a keystroke to shift focus from
one selected frame to the next. For example, if you had a frame selected
in the timeline and wanted to select the next one to the right / left,
the best the given Macromedia-supplied keystrokes could do was move the
playback head 1-over, but at the same time any and all frames become
deselected. So if you had a sequence with a bunch of 2-frame long
segments that you needed to expand to be 3-frame long segments, you had
to select a new frame (by mouse), then add a new frame (F5), then select
a new frame (by mouse), then add a new frame (F5), etc., etc...

I wrote some quick codes that actually move the selection from frame to
frame, not only left and right but up and down as well. I've chosen to
assign them to SHFT+Left, SHFT+Up, etc. but of course you can assign
them to any keystroke that works for you. So now I can move about my
timeline, adding and deleting frames as needed without ever taking my
fingers off the keyboard!

But enough preamble... Here's the code -- Enjoy:


Select Prev or Left Frame:

	var curDoc = fl.getDocumentDOM();
	var curTL = curDoc.getTimeline(); 

	if (curTL.currentFrame >= 1) {
		curTL.setSelectedFrames((curTL.currentFrame - 1),
(curTL.currentFrame), true);
	}


Select Above Frame:

	var curDoc = fl.getDocumentDOM();
	var curTL = curDoc.getTimeline(); 

	curTL.currentLayer = (curTL.currentLayer - 1);
	curTL.setSelectedFrames((curTL.currentFrame),
(curTL.currentFrame + 1), true);


Select Next or Right Frame:

	var curDoc = fl.getDocumentDOM();
	var curTL = curDoc.getTimeline(); 

	curTL.setSelectedFrames((curTL.currentFrame + 1),
(curTL.currentFrame + 2), true);


Select Below Frame:

	var curDoc = fl.getDocumentDOM();
	var curTL = curDoc.getTimeline(); 

	curTL.currentLayer = (curTL.currentLayer + 1);
	curTL.setSelectedFrames((curTL.currentFrame),
(curTL.currentFrame + 1), true);


If you don't know how to install commands, either follow the
instructions on pg. 26 of "Extending Flash MX 2004: Complete Guide and
Reference to JavaScript Flash" by Keith Peters and Todd Yard from
Friends of Ed, or email me and I'll walk you through it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.flashguru.co.uk/pipermail/extendflash/attachments/20050630/5fcdad87/attachment.htm


More information about the Extendflash mailing list