Flash CS3 JSFL Bugs: timeline.setSelectedFrames()
I’ve decided to put up a post for every bug I find in the current Flash Extension API - there’s a lot of them and it’s worth jotting stuff down for other Flash JSFL developers. (All 3 of us *wink*). This bug is in the timeline.setSelectedFrames() method.
Certainty: 98% certain it’s a JSFL bug. I usually mess with this stuff more to be sure, but I have found it getting tweaky on me in about 6 different Flash extensions I’ve been working on, and I’ve stopped the code in mid-stream at the point that the API should have made it’s frame selection using the “setSelectedFrames()” command… but no luck.
Problem: Run some JSFL code, somewhere in it I use the timeline.setSelectedFrames([layernum,startFrameNum,endFrameNum]) format of the command. I haven’t pinpointed the specific bug-trigger, but I suspect it has something to do with how the API has problems updating it’s view of the currently active timeline. I will explain this more in another post about a JSFL bug having to do with adding multiple keyframes to a timeline. For now, be aware that this method works 95% of the time… but in some odd circumstances it just refuses to work properly. If you encounter it, you can test it by stopping the code just after the line where you make your selection call. (Test the values for layernum, startFrameNum, endFrameNum just to be sure, but you will find they are legal and it’s a language bug, not a problem with your code logic.)
As a side note, other forms of the command don’t seem to cause the same errors. That is a damn good thing, too, cuz it makes the work-around a snap.
Bug Workaround: Fortunately, the solution is very simple. Use the same values as before and make use of following commands instead…
timeline.currentLayer = layernum;
timeline.setSelectedFrames(startFrameA,startFrameB);
So there you have it. This is one of those cases where knowing of a bug is more important that finding a solution to it, cuz the solution is so obvious. But man, I can’t tell you what a pain-in-the-arse it is to not know of it. Avoid using the extended form of the timeline.setSelectedFrames() method, and you will breathe easier.
Posted in JSFL bugs |










