Developing with the Display List in ActionScript 3

Posted in "Articles, Flash" at 11:43 am on September 6, 2007 by Josh Tynjala |

If you’re migrating from AS2 to AS3, or you’re just getting started with Flash development, you may be interested in an article I wrote for the Yahoo! Flash Developer Center entitled Developing with the Display List in ActionScript 3. It focuses on the basics of display list manipulation, important changes you may encounter if you’re migrating from ActionScript 2, and best practices for communicating between MovieClips and other DisplayObjects.

As many new developers moving to ActionScript 3 discover, the new language is stricter and many of the shortcuts one may have taken in the past with AS2 will have certain roadblocks that must be crossed in AS3. The article tries to outline the best ways to understand the changes, work around them as needed, and most importantly, how to develop applications and websites in AS3 so that you don’t need to use these workarounds. I included several source code examples, including the progression of a simple application as I try to update it with best practices.

If you’re looking to write more flexible and maintainable AS3 code, or you’d like to help a fellow developer who is struggling with the changes from AS2 to AS3, I hope the article will be helpful.

Share: on Yahoo! My Web | on del.icio.us | digg it! | reddit!

7 Comments »

RSS feed for comments on this post. TrackBack URI

  1. I have been struggling with making a list component represent a display list.

    I would love to get some in put from you on this.
    You can follow with others as we try to figure it out.

    http://www.kirupa.com/forum/showthread.php?t=274308

    Please note that it was hard to formulate my question add it may seem vague at first, but I think I became more clear as to what I was trying to achieve in later posts. So you may want to skip to the end of the discussion to get a better idea of whats going on.

    - thanks

    Comment by josh chernoff — September 6, 2007 #

  2. josh,

    The suggestion by cesig near the end is probably the best idea. Place the items in the List in reverse, then do a conversion whenever you need to reference the real index.

    myList.dataProvider.length - index

    You don’t seem to be very interested in that idea though, and I’m not sure why. The alternative I think you’re trying to get someone to suggest is to reimplement the List component to make it display items from the bottom instead of the top. Sounds like a lot more work to me.

    Josh Tynjala
    Yahoo! Flash Platform

    Comment by Josh Tynjala — September 7, 2007 #

  3. OMG how did I not see this, lol.

    var childIndex:uint = (myList.dataProvider.length - index -1);

    you had it besides the (-1)

    thanks.

    Comment by josh chernoff — September 8, 2007 #

  4. Nice article!

    I’ve known these things before but it is always nice to see how the other do it :D

    g²,
    Johannes

    Comment by Johannes — September 14, 2007 #

  5. I’ve been using AS2 for a long time for semi-advanced stuff, and recently had a need for the superior processing power of AS3. I was a heavy user of _root, and your article was a huge help into why what I was used to isn’t there anymore, and why it shouldn’t be either. I wasn’t really interested in the display list, that all made sense to me, but the rest of the article really helped me understand AS3 much better! :)

    Thanks!

    Comment by Brent — October 22, 2007 #

  6. Brent,

    I’m glad I could help!

    Josh Tynjala
    Yahoo! Flash Platform

    Comment by Josh Tynjala — October 23, 2007 #

  7. Big thanks , it helped clarifying a lot of things for me !!!!

    Comment by Lau — March 31, 2008 #

Leave a comment

Note: Comments are moderated for first-timers. Spam deleted.

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Hosted by Yahoo!

Copyright © 2007 Yahoo! Inc. All rights reserved. Privacy Policy - Terms of Service

Powered by WordPress on Yahoo! Web Hosting.