foomonger's blog

Tips and Musings on Software Development, Flash, and Flex

Archive for the ‘signals’ tag

foomonger-swizframework Updated With Swiz v1.0.0 and AS3Signals v0.8

without comments

You can find the source, SWC, and examples here: http://code.google.com/p/foomonger-swizframework/

Thanks to the Swiz Framework team and Robert Penner for delivering free useful code!

Share

Written by Sam Ahn

January 5th, 2011 at 12:53 pm

Posted in Uncategorized

Tagged with , ,

foomonger-swizframework Updated With Swiz 1.0.0 RC1

with 2 comments

Swiz 1.0.0 RC1 was recently released so I've updated my custom metadata processors to work with it. Head over to Google Code to check out [MediateSignal] and [Resource]. Happy coding...

Share

Written by Sam Ahn

May 23rd, 2010 at 2:26 am

Swiz, Signals, and [MediateSignal]

with 2 comments

Joel Hooks created this RobotLegs/Signals demo. Ben Clinkinbeard then created this Swiz-version of Joel's demo. I then took Ben's demo and Swiz-ified it even more by using a custom [MediateSignal] processor. Here's the source.

[MediateSignal] is the Signal equivalent of [Mediate]. Here's an example:

[MediateSignal("galleryUpdatedSignal")]
public function galleryUpdated(gallery:Gallery):void

[MediateSignal] takes a Signal Bean name or type and adds the decorated method to the Signal (see GalleryThumbnailsPresentationModel for examples).

This is what I changed from Ben's demo:

  • Created the MediateSignalProcessor
  • Added [MediateSignal] metadata to the Signal listeners
  • Made the Signal listeners public
  • Named the Signal Beans
  • Removed [PostConstruct] methods that added the Signal listeners
  • Removed injected Signals that weren't being using to dispatch

[MediateSignal] makes using Signals in Swiz very parallel to using Events (especially if you define the Event dispatcher as a Bean and inject it by name). And just like Events, you only need to [Inject] the Signals into Beans who are dispatching Signals. I was pretty excited to create my first custom processor and play with Signals for the first time. Let me know what you think!

Disclaimer: I set up MediateSignalProcessor to also handle DeluxeSignals and remove listeners, though to be honest I didn't test those.

* Update: I've posted the processor on Google Code and it contains unit tests (including DeluxeSignals and removing listeners).

** Update: I've created a bare-bones example application: SWF and Source.

Share

Written by Sam Ahn

February 26th, 2010 at 11:37 pm

Posted in flex

Tagged with , , ,