Actionscript, Old Articles - 1 year, 9 months ago - 3 Comments
Undocumented Actionscript 3
A little undocumented feature for you that might come in useful, mainly for people who use the Flash 9 Authoring Tool to create their Flash Movies.
It allows you to specify a function that is called when the playhead of the Movieclip timeline enters the specified frame number.
Their are four parameters to the method, i only completley understand the purpose of the first two, the other two are worth investigating more.
MovieClip.addFrameScript(frame:uint,notify:Function)
Example:
function output()
{
trace('Timeline is on the 10th frame')
}//frame numbers are zero based
addFrameScript(9,output)
Ensure the timeline you add this code to, has atleast 10 frames.
Removing frame scripts
Ive worked out that passing false as the third parameter and anything as the fourth parameter, clears the function, so that it is no longer called when the playhead enters a previously defined frame number/function combo.
//stop calling the output function addFrameScript(9,output,false,false);
3 Comments
furious
Do you think “addFrameScript” will be official?
I noticed the keyword show up in Flex Builder’s auto-completion list, but did not see the keyword in the Help docs.
Thanks for the post. This is very handy.
Note: This is an old article!
Please be aware that the content of this article may no longer be accurate and the links contained within could be broken.
Update Notifications
You can add our RSS feed to your favorite feed reader or recieve an email when a new article is posted by entering your email address below.
FLASH EXPERTS
- Andre Michelle
- Aral Balkan
- Big Spaceship
- Chafic Kazoun
- Colin Moock
- Craig Swann
- Erik Natzke
- Grant Skinner
- Jesse Warden
- John Grden
- Keith Peters
- Lee Brimelow
- Lord Alex
- Mario Kingemann
- Matt Voermn
- Ralph Hauwert
- Richard Leggett
- Trevor McCauley
FLASH COMPONENTS
- AFComponents
- Components Network
- Extend Studio
- Flash Relief
- Flash Store
- Flashden
- Flashloaded
- Ghostwire
- Image Vue
- Jumpeye
- Page Flip Component
- Slideshowpro
FLASH VIDEO
- Akamai
- FFMPEG
- FlashComGuru
- Flashstreamworks
- FLV Player
- FLVMDI
- flvPlayerPro
- FLVTool2
- Influxis
- JW FLV Player
- Vital Stream
FLASH RESOURCES
- Actionscript.org
- Adobe Labs
- Developer Center
- Flash Interface
- Flash Player Statistics
- Flashkit
- Kirupa
- MDM Zinc
- OSFlash
- PaperVision3D
- SWXFormat
- Tweener
SPONSORS
More In Actionscript
- Adobe MAKE SOME NOISE
- Undocumented Actionscript 3
- BitmapData.loadBitmap gone in AS3
- Actionscript 3 - New Capabilities
- Flash 8 - setTimeout


Hmm.. its very useful.