Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Section
Column
width15px

Column
Table of Contents
minLevel5
maxLevel5
Is there a mailing list where I can get help from the Swiz community?

Absolutely, you can find the Swiz group at http://groups.google.com/group/swiz-framework.

If I am building the Swiz framework from the source code, what compiler arguments do I need?
Code Block
-keep-as3-metadata+=Inject,Autowire,Mediate,Dispatcher,PostConstruct,PreDestroy
-namespace http://swiz.swizframework.org manifest.xml
-include-namespaces http://swiz.swizframework.org

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.

I try to access my injected property during creationComplete but the reference is still null?

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 [PostConstruct].

Does Swiz work with Flex 4?

Yes, Swiz works with Flex 2,3 and 4.

Does Swiz work with Adobe AIR?

Yes, there is in general no difference between Web or AIR development. An additional Desktop Extensions library is available to add desktop-specific features.

I have dispatched an event from a view but the dynamic mediator is not invoked?

Ensure that the bubbles property of the event is true.

Why aren't bubbling events dispatched from a PopUp handled by Swiz?

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.

Where is my application logic starting point?

Let your 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.

How should I dispatch events from bean classes?

You should inject a dispatcher using the [Dispatcher] metadata, and dispatch application events through this dispatcher.

Why did my view not get injections processed?

Be sure that the viewPackages in the SwizConfig tag are set correctly.

I can’t use [Inject] in my root Application container. What’s wrong?

Metadata can’t be used in the root Application container. It’s the only place where this is the case. But the solution is easy: Just create your own component to act as a parent view container, and add this as a child to the root Application. Swiz will autowire this component with no problems. So for example, something like this:

Code Block
<mx:Application
       xmlns:mx   = "http://www.adobe.com/2006/mxml"
       xmlns:view = "view.*"
       xmlns:swiz="http://swiz.swizframework.org">

       <swiz:SwizConfig
               strict="false"
               id="config"
               mediateBubbledEvents="true"
               viewPackages="view"
               beanLoaders="{[Beans]}" />

       <!-- Autowiring will work fine in this child container. -->
       <view:MyApplicationContainer
               width  = "100%"
               height = "100" />

</mx:Application>
I tried to compile the library from the SVN source but get the error: “Access of undefined property flex4.”?

You are missing the conditional compilation flag: -define=CONFIG::flex4 true or false for older Flex versions.

Column
width15%