For technical questions, feel free to ask on the Swiz mailing list.
Absolutely, you can find the Swiz group at http://groups.google.com/group/swiz-framework.
Because the Swiz swc is built with arguments to instruct the compiler to retain the Swiz metadata, you shouldn't normally need to do this yourself. However, if the metadata isn't retained for some reason, you can add this to the compiler arguments for your project:
When compiling for the Flex 3.x SDK, use
-define+=CONFIG::flex4,false -define+=CONFIG::flex3,true. Be sure you only compile the /src directory into the library. Trying to compile the other packages, such as /tests, will result in library compile errors.
You will also want to mark the metadata.xml and manifest.xml files as Assets in your Build Path panel.
Lastly, using the Ant build script will take care of all of these things for you, so that is the easiest way to build Swiz from source.
Swiz injects dependencies when the view's addedToStage event is dispatched, which is after creationComplete. Inject to a setter function to have direct access to the injected reference, or move your logic into a method decorated with
Swiz works with Flex SDK 2, 3, 4 and 4.5. Flash Builder 4.5 added code completion for Swiz metadata!
Yes, there is in general no difference between Web or AIR development. An additional Desktop Extensions library is available to add desktop-specific features.
[EventHandler]is not invoked?
Ensure that the event handler method is public, and that the
bubbles property of the event is true.
Swiz can't know what else you may have done with the Prototype, so it is not automatically torn down. If you wish to tear down a Prototype bean when a view is removed, implement a
[PreDestroy] method and dispatch a
TEAR_DOWN_BEAN event for the Prototype bean.
Because PopUps and NativeWindows are not part of the standard display list, Swiz has no way to know which Swiz instance is the owner of the window. To deal with this, you can have the class that creates the window implement
ISwizAware. Once you have the correct Swiz instance injected, you can call the
registerWindow() method on that Swiz instance to associate that window with the specified instance of Swiz. The window can then be processed correctly.
Swiz uses the display object where it was created as its "root event dispatcher", and it listens for events on that event dispatcher. However, PopUps are not added to this display list, they are added as direct children of the SystemManager object, since they must appear above everything else in the application. As a result, events dispatched from PopUps don't bubble up to the Swiz dispatcher. However, the solution to this is simple: just use
[Dispatcher] to inject the Swiz dispatcher into your PopUp, and dispatch events through it. This way, Swiz can process them.
If your startup logic only involves one bean, let that bean (probably a "main controller") implement IInitializingBean, or decorate a method with
[PostConstruct], and start with your application logic in that method. Swiz calls these methods on beans when the injection process is complete.
If your startup logic depends on events that must be handled by other beans, you need to be sure that all of your beans have been properly set up. In this case, you can use an event handler method such as
[EventHandler( "mx.events.FlexEvent.APPLICATION_COMPLETE" )]. This will mediate the applicationComplete event, and only kick off processing once all of the beans have been set up.
You should inject a dispatcher using the
[Dispatcher] metadata, and dispatch application events through this dispatcher.
Be sure that the viewPackages in the
SwizConfig tag are set correctly.
The Flex WebService class actually has two implementations, one for MXML and one for AS3. If you define a WebService within a UIComponent, the Flex framework automatically triggers a load of the web service's WSDL in the UIComponent's creationComplete() handler. However, the AS3 version does not (it has no creationComplete() handler). Because the BeanProvider is not a UIComponent, this automatic loading of the WSDL is not done by the Flex framework. As a result, you must call loadWSDL() on your web service before you can use it, because you are actually using the WebService's AS3 implementation.
Researching this seems to indicate that it can happen with any .swc where the .swc was compiled using a version of the SDK other than the version used by the project. Since there are so many possible SDK versions, creating separate versions of Swiz for all of them is not possible. If you need to use Design View, and you're using an SDK other than the one the framework was compiled with, we recommend that you download the source code, set up the framework as a library project, and add the library project to your application project. This should resolve the Design View error.