Actionscript, Old Articles - 1 year, 5 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

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

furious
Jul 22, 2007 16:54

Hmm.. its very useful.

Keith H
Oct 21, 2007 16:24

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.

Han Sanghun
Oct 24, 2007 7:51

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.

    Shu Player allows you to distribute your AIR Applications to users that dont have the AIR Runtime by converting them to standalone applications. Shu Player also adds more commands to do things like open external applications etc…


    If you hate the Adobe Updater like most of us, then just get rid of it.


    Want to quickly find out what version of the Flash Player a client has installed? Send them to www.playerversion.com


    Yet more pv3d goodness. Im loving this funky 3D Flash Lab, the work of Mathieu Badimon. [Update: Apparently this uses Five3D not PaperVision]


    There is an old interview with me on The FWA, its fairly long at 8 pages.


    If you do alot of travelling then it makes sense to get yourself a Priority Pass, which will get you access to over 500 airport lounges worldwide, regardless of whether your flying enconomy, business or first.


    Freelance Switch is a freelancer community with forums, jobs, daily tips and a complete 212 page e-book titled “How to be a rockstar freelancer” for sale.


    Lots of new media jobs at Creative Pool.


    BBC IPlayer is awesome, but its ashame that BBC News is still using Windows Media Player and Real video. Real player is officially badware.


More In Actionscript


More In Adobe Flash


More In Freelancing