Ted Patrick > { Events & Community } > Adobe Systems


"BX" - Initial event list

I put together a detailed list of initially supported events. These map to the events available in Flash Player 9+.

surface events:
instance.events.down
instance.events.up
instance.events.over
instance.events.out
instance.events.move
instance.events.wheel
instance.events.drag
instance.events.drop
instance.events.drag_over
instance.events.drag_out
instance.events.click
instance.events.double
instance.events.key
instance.events.key_down
instance.events.key_up
instance.events.focus_in
instance.events.focus_out

system events:

bx.events.activate
bx.events.add
bx.events.stage_add
bx.events.deactivate
bx.events.frame
bx.events.remove
bx.events.stage_remove
bx.events.render
bx.events.tab_children_change
bx.events.tab_enabled_change
bx.events.tab_index_change
bx.events.focus_in
bx.events.focus_out
bx.events.key_focus_change
bx.events.mouse_focus_change
bx.events.key
bx.events.key_down
bx.events.key_up
bx.events.click
bx.events.double
bx.events.down
bx.events.move
bx.events.out
bx.events.over
bx.events.up
bx.events.wheel
bx.events.drag
bx.events.drop
bx.events.drag_over
bx.events.drag_out
bx.events.out
bx.events.over

I will be adding several other higher level events to capture more detailed interactions. Examples of the higher level events would be "drag", "drop", "drag_over", "drag_out". With better higher level events, much more complex interactions are possible.

Also due to the naming conflict with BRIX-CMS, I have opted for a codename of "BX". All good.

Cheers,

Ted :)

360Flex SJ 2008 - Filthy Rich Flex Clients by Chet Haase

One of the great things about the Flex platform is that you can get up and running with good-looking GUIs quickly. But what if you want to go beyond the built-in component capabilities and add some extra richness to your UI? What about animated effects to make your application more dynamic? This session will cover various graphics and animation techniques that you can use in your Flex development to create applications that aren't just rich clients; they're filthy rich.



Cheers,

Ted :)

http://www.microsoft.com/windows/#

What is funny is that they included the Silverlight.js files to make it seem like Silverlight is in use here. Right click, it is Flash.



Cheers,

Ted :)

"BX" - My hobby AS3 framework

Now that I have entered the world of management I have been feeling a bit lost without a project to code on as a hobby. For the past 2 years at Adobe I have been thinking about a simple light framework for building apps using XML/AS3. Whether it turns into anything or just a big pile of experiments, who knows. The plan is to dedicate evening time to "BX" and blog about my finding regardless of where they go. The first stop for "BX" is looking at events and rethinking them.

"BX":Events
------------------
About 6 months ago I ran some tests with the event model in FP9 and did a little proof on the scalability of various event models. In FP9 DOM level 2 events were added and these events provide the benefit of propagating across the display list from root to target and back. Now events are powerful things but if you get to many of them in your app or framework things can become hard to manage and ideally you want to have as few events subscribed as possible. So in "BX" I want to implement events differently and provide a bit more flexibility and allow name based events and system level events like so:

//name based events
import brix.Surface
class MyButton extends Surface{
   function MyButton():void {
      this.events.click = this.upClick; //event wiring
   }
   function upClick( event:Event ){ trace('upClick');}
}

or
//system level events
bx.events.click.push( myInstance.upClick );
bx.events.doubleclick.push( myInstance.upClick );


Notice addEventListener is never used. If you compiled this to a SWF and clicked on this an instance it would fire the click event. The "BX" framework simply handles dispathing the events directly, no muss or fuss. So then I got to thinking about bubbling and whether it was really necessary. I know I survived 6 years without it and looking back at the majority of my FX apps I never really leveraged bubbling or capture. I am going to leave it out for now, maybe a good use case will hit the project and I will add it in later.

So how is this possible, well the base class using "BX" has several event listeners that catch events when they are dispatched at the root in capture phase. The trick is that they are immediately canceled and use the event object passed to dispatch an event directly. Basically this short circuits the system and passes the event direct to the target. Where the player might waste time walking the display list, "BX" simply skips to the target. What I like is that regardless of how deeply nested the target it, the event always hits its target first without any walking or time wasted. I say this with a word of caution, this is a hack and although it speeds things up and simplifies how events work, the loss of DOM level 2 behavior a one way trip (but I could reverse that later). Instead of tracking who is subscribed to what, I simply change the names of the events and am able to rewire everything quickly with simple property changes.

I am seeing an issue with needing to fire 1+n things with a single event but this seems easy to solve as well. The event dispatcher here is simply calling a function and passing a single argument. So at runtime I can detect if it is an Array/Object and do something different like walk the Array dispatching events or simply call it if it is a function instance. This also allows you to chain events or dispatch events to a parent. With closure support in as3 I can set events to functions in other display objects and things just work without delegation.

There are some issues in terms of organizing events. I want to organize events into an object path for named events like so:

myInstance.events.click = this.myClick


The nice thing here is the ability to pass an entire events tree preconfigured. You might have 3 states within a component where events need to be shifted around and by simply swapping out the 'events' object you get sets of events to change all at once.

Well that is a long post for a single evening. I will keep blogging about "BX" and my progress. It should be a fun exploration into the unknown. Next time some code to munch on.

cheers,

Ted :)





cheers,

Ted :)




Jobs


Flex Jobs
city, state, zip


© 2008 Ted On Flex