Swiz.dispatchEvent  not working

Posted on 2011-10-04
Last Modified: 2012-06-21

I am using SWIZ framework. I have my code like this

public class AutoPopulate {

public var tradeLookUp : TradeDatagrid = new TradeDatagrid() ;      
public function AutoPopulate()  {
Swiz.dispatchEvent(new GlobalEvent(GlobalEvent.POPULATE_TRADE_LOOKUP));

[Mediate(event="GlobalEvent.TRADE_LOOKUP_DATA_RECEIVED", properties="data")]
public function populateLookUp( data:Object ):void{
tradeLookUp.serviceCollection = data as ArrayCollection;

Swiz.dispatchEvent  is dispatching the event but populateLookUp function is never invoked.

Any idea whats the problem?

Question by:royjayd
    LVL 29

    Expert Comment

    Millions reason why you cannot get a result. Server connectivity, invalid result format, backend errors, listeners was not added. How experts can help with your small code implementation?

    Author Comment

    can you point me to a good SWIZ tutorial?  thanks.

    Author Comment

    I am new to SWIZ and looking at some one else code, so plz bear with me.
    I want to know exactly what happens when this line is invoked
    >>Swiz.dispatchEvent(new GlobalEvent(GlobalEvent.POPULATE_TRADE_LOOKUP));

    public function GlobalEvent(type:String,  data:Object = null,callback:Function = null) {
    super(type, true); = data;
    this.callback = callback;
    LVL 29

    Accepted Solution

    LVL 11

    Assisted Solution

    Mediate is a custom meta-tag in the Swiz framework, so you have to tell the compiler about it with the following setting:

    -keep-as3-metadata +=Autowire,Mediate

    Open in new window

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
    In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now