Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6597219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:10:51+00:00 2026-05-25T18:10:51+00:00

I am using the Swiz framework with Flex. I am trying to use the

  • 0

I am using the Swiz framework with Flex. I am trying to use the the mediate tag with some luck here is my problem:

public class Locale {
    private static function onLoadSuccess(event:Event):void 
    {
        // I have a break point here.  I can tell that this code is being executed sucessfully
        Swiz.dispatchEvent(new DynamicEvent(ConfigConstants.LOCALE_RESOURSE_LOADED));
    }
}

In another class I have this code here:

public class AcordianPane {
    ...
    [Mediate( event="localeResourseLoaded")]
    public function onLocaleResourseLoaded( ...rest):void
    {
            this.label = Locale.getUiString("title.map.broadcast");
    }
    ...
}

The code above works as expected. I am experiencing a problem when I change the Mediate tag to a constant:

public class AcordianPane {
        ...
        [Mediate( event=ConfigConstants.LOCALE_RESOURSE_LOADED)]
        public function onLocaleResourseLoaded( ...rest):void
        {
            // THIS IS NOT EXECUTED NOW!
            this.label = Locale.getUiString("title.map.broadcast");
        }
        ...
}

Anyone have any idea why this is happening? For reference this is my ConfigConstants class:

public class ConfigConstants {
    public static const LOCALE_RESOURSE_LOADED:String = "localeResourseLoaded";
}

Note: The Mediate tag is identical to the EventListener tag the name was just changed several releses ago. I know that it is now depreciated but I don’t think there is any reason to do a find and replace on our code base.


Edit 1: I just tried substituting EventHandler with Mediate but the same problem occurs.


Edit 2: Here is the relevant documentation from the Swiz webpage.


Edit 3: I have also tried putting the event in quotations (thanks @Gerhard’s s) like this:

[EventHandler( event="ConfigConstants.LOCALE_RESOURSE_LOADED")]
public function onLocaleResourseLoaded( ...rest):void
{
    this.label = Locale.getUiString("title.map.broadcast");
}

But the event is still not being received. I think that the problem may lie in my main mxml file where I initialize Swiz:

<swiz:SwizConfig
    strict="true"                             // set by a co-worker
    mediateBubbledEvents="true"               // set by a co-worker
    viewPackages="com.sixtyfootersdude.views" // set by a co-worker
eventPackages="com.sixtyfootersdude.model" // <-- Just added!  
    beanLoaders="{ [ com.sixtyfootersdude.admin.AdminBeans ] }" /> // set by a co-worker

Also note that

  • AcordianPane is in com.sixtyfootersdude.views
  • Locale is in com.foxtrot.util
  • ConfigConstants is in com.sixtyfootersdude.model

Edit 4: The last thing that I tried is this:

[EventHandler( event="com.sixtyfootersdude.model.ConfigConstants.LOCALE_RESOURSE_LOADED")]
public function onLocaleResourseLoaded( ...rest):void{
    this.label = Locale.getUiString("title.map.broadcast");
}

And

<swiz:SwizConfig
    strict="true"
    mediateBubbledEvents="true"
    viewPackages="com.sixtyfootersdude.views"
    beanLoaders="{ [ com.sixtyfootersdude.admin.AdminBeans ] }" />
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:10:52+00:00Added an answer on May 25, 2026 at 6:10 pm

    You can’t use constants in metatags. Unfortunatly that’s a restriction of Flex. Instead you have to use the constant’s names as strings. However, Swiz will check if those constants exist while it’s getting initialized. Therefor you’ll get an error during the applications startup if you misconfigured an [EventHandler].

    So, in your case the solution would look like this:

    [EventHandler(event = "ConfigConstants.LOCALE_RESOURSE_LOADED")]
    public function onLocaleResourseLoaded():void
    {
    }
    

    Make sure that the package of ConfigConstants is configured as eventPackage in your SwizConfig.

    For more information take a look at Event Handling Using Class and Constant Names and Swiz Configuration.

    BTW: You shouldn’t use the deprecated [Mediate] anymore.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to set up the swiz framework in flex but cant seem to
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C#, I need a class called User that has a username, password, active
Using preview 4 of ASP.NET MVC Code like: <%= Html.CheckBox( myCheckBox, Click Here, True,
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange
Using the navigator.geolocation object in JavaScript. Trying to establish accurate ranges, but wondering exactly
Using Rails 3.2.0 with haml, sass and coffeescript: Basically I am trying to disable
Using Entity Framework CodeFirst, how do I create a created datetime column that gets
Using jQuery UI Resizable I'm trying to prevent resizing based on various rules. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.