Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:56:14+00:00 2026-05-10T18:56:14+00:00

Why are inline closures so rarely used in Actionscript? They are very powerful and

  • 0

Why are inline closures so rarely used in Actionscript? They are very powerful and I think quite readable. I hardly ever see anyone using them so maybe I’m just looking at the wrong code. Google uses them in their Google Maps API for Flash samples, but I think thats the only place I’ve seen them.

I favor them because you have access to local variables in the scope that defines them and you keep the logic in one method and dont end up with lots of functions for which you have to come up with a name.

Are there any catches of using them? Do they work pretty much the same way as in C#.

I actually only just discovered that AS3 supports them, and I’m quite annoyed becasue I had thought I read that they were deprecated in AS#. So I’m back to using them!

private function showPanel(index:int):void {      _timer = new Timer(1000, 1);         _timer.addEventListener(TimerEvent.TIMER, function(event:Event):void  {     //  show the next panel     showPanel(index++); }); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:56:15+00:00Added an answer on May 10, 2026 at 6:56 pm

    The biggest gotcha to watch out for is that often ‘this’ is not defined in the inline closure. Sometimes you can set a ‘this’, but it’s not always the right ‘this’ that you would have available to set, depending on how you’re using them.

    But I’d say most of the Flex code I’ve worked on has had inline closures rampantly throughout the code–since callbacks are the only way to get work done, and often you don’t need the bring out a whole separate function.

    Sometimes when the function nested is getting to be too much, I’ll break it out slightly with Function variables in the function; this helps me organize a bit by giving labels to the functions but keeping some of the characteristics of inline closures (access to the local variables, for example).

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 79k
  • Answers 79k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Use hashlib as hash() was designed to be used to:… May 11, 2026 at 4:09 pm
  • Editorial Team
    Editorial Team added an answer parseFloat can convert a string to a float and toFixed… May 11, 2026 at 4:09 pm
  • Editorial Team
    Editorial Team added an answer Here are just a few answers to your question that… May 11, 2026 at 4:09 pm

Related Questions

I have a table-valued, inline UDF. I want to filter the results of that
We are sending out Word documents via email (automated system, not by hand). The
I call my JavaScript function. Why do I sometimes get the error 'myFunction is
I really don't understand the fascination with XHTML strict. Inline JavaScript typically requires a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.