Some things for component developers in Flash 2004

Some of the little things that will make life easier for component developers in Flash 2004

  • Auto Live-Preview: As long as your component knows how to redraw itself, converting a component to an swc will give it a live preview automatically.
  • Meta tags: Using special Meta-tags in your class file of your component, Flash can automatically pick up the parameters rather than you needing to specify it in the component inspector (example: [Inspectable(name="Title Position",enumeration="top,bottom",defaultValue="top")])
  • Easy event dispatching: The component framework has built-in support for broadcasting events. All that you would have to do to is “dispatchEvent({type:”click”});” and the rest is taken care of for you. No more AsBroadcaster.initialize(this)

I’ll try to post some more when i get the chance.

6 thoughts on “Some things for component developers in Flash 2004

  1. about events: is this merely a built in asbroadcaster or is it more advanced (capture/bubbling phase etc)? ie what other object properties can you use in dispatchevent and what for?

  2. hello,

    Didn’t have the chance to test the future flash version. Could you elaborate a litte more about the format .swc ?
    Is it actually a true runtime shared swf ?…

  3. Hi Claus,

    It is an ActionScript implementation, but does not truly mimic AsBroadcaster. It does not support event bubbling. The real improvement is that you are able to subscribe to a specific event rather than to a whole object. Also each event will contain an event info object. This object will contain some useful information about the event (event name and event source target). You can use this information to your advantage by having one function handle events from multiple sources (I personally like to centralize my event handling).

    Another nice addition is key events. UI Components broadcast a “keyDown” “keyUp” event, the event object for those events includes some extra information that can be useful. Information like if the shift key was pressed down when the event occurred.

    The new best practice is to broadcast a single object containing the all information you would like to broadcast rather than broadcasting multiple objects (there really wasn’t a standard in MX). Every component event should include the “type” and “target” event although if you don’t include a target it will be added automatically for you. The rest is really up to your specific needs.

    I’m not sure what you mean exactly by “what other object properties..”?

  4. SWC’s are compiled components (MovieClips) that can run in the authoring environment. An swc will include all the assets a component needs in one convenient package. When a component is added from the components panel, the swc is automatically added to the project’s library. They are not runtime shared swf’s (by shared I am assuming you mean a shared library)

    There are several benefits of swc’s

    1.When using an swc, the compiler has to do less work when you compile your project since some of the code in your project is already compiled
    2.It’s easier to distribute an swc rather than an fla and multiple as files
    3.A swc will give you a live-preview automatically as the ide will run the swf in the authoring environment

    Some other things about an SWC. They are really just zip files. You can uncompress them if you want to look at the internals.

  5. Hello, Claus

    i whant to tell you about new and fresh
    software for managment and exchange of
    *.swc files (SWC Repository), it can easily view,store,catalogise and edit
    .swc file content, put some ReadMe.txt-like
    files to .swc file for futher users of this
    component.

    Software homepage: http:\swcr.shuriksoft.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>