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 6068157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:41:07+00:00 2026-05-23T09:41:07+00:00

I’m in a Flex Mobile application project. I need to dispatch an event to

  • 0

I’m in a Flex Mobile application project. I need to dispatch an event to the FlexGlobals.topLevelApplication and it has to contain a custom message.

I’m trying to make an object and dispatch it like this:

//create the event Object

var receivedObjMsg:Object = new Object();
receivedObjMsg.name = "receivedMessage";
receivedObjMsg.message = messagevarhere;

FlexGlobals.topLevelApplication.dispatchEvent(receivedObjMsg);

and then receive it like this on the other view like this:

FlexGlobals.topLevelApplication.addEventListener("receivedMessage", receiveMsgHandler);


protected function receiveMsgHandler(event:Event):void
{
trace("IT WORKED!");
}

But its saying it cant make an object into an event:

Type Coercion failed: cannot convert Object@5a507911 to flash.events.Event.

I also tried putting this in the bottom of the main application mxml where i created the event;

<fx:Metadata>
[Event(name="receivedMessage", type="flash.events.Event")]
</fx:Metadata>

I can’t really seem to find an example that demonstrates what im trying to do. Any ideas how I can get this to work?

  • 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-23T09:41:08+00:00Added an answer on May 23, 2026 at 9:41 am

    dispachEvent() only accepts an Event object. You’ll need to make your own class ReceivedObjMsg.

    Details on creating your own class in an answer on a previous question of yours.

    Your issue is basically here:

    var receivedObjMsg:Object = new Object();
    receivedObjMsg.name = "receivedMessage";
    receivedObjMsg.message = messagevarhere;
    
    FlexGlobals.topLevelApplication.dispatchEvent(receivedObjMsg);
    

    Parsing Object through dispatchEvent()

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
In my XML file chapters tag has more chapter tag.i need to display chapters
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I need to clean up various Word 'smart' characters in user input, including but

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.