Flash :: Custom /Flex Event Object?

Jun 23, 2011

I'm in a Flex Mobile application project. I need to dispatch an event to the lexGlobals.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;

[Code]...

View 2 Replies


Similar Posts:


Actionscript 3 :: Flex 4 Disptaching Custom Event From Custom Component (why Flex Converting Custom Event To Mouseevent)?

Mar 2, 2012

This is NOT duplicate of my earlier post (its is slightly different)But this is similar issue with similar error but its not the same error The error I am getting now is below while dispatching the custom event from my custom component

TypeError: Error #1034: Type Coercion failed: cannot convert events::MapEvent@a74ab51 to flash.events.MouseEvent.
dispatchEvent(new MapEvent(MapEvent.CLICKED_ON_MAP));

Note: The error in my earlier post is giving below error message

Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent

The difference here are two things, the earlier error is while converting flash event to custom event and now this one is while converting custom event to flash event and secondly, I have no clue why it is trying to convert to the mouseevent where I am just dispatching my custom event with proper listeners.

This is my custome event

package events
{
import flash.events.Event;
import ui.map.MapElement;

[code]...

View 1 Replies

Actionscript 3 :: Trigger Custom JQuery Event From Flash Passing Some Data Through Event Object?

Dec 2, 2010

How to trigger a custom jQuery event from Flash, passing some data through event object?

View 2 Replies

Actionscript 3 :: Flash Object Dispatch Custom Event To Itself?

Apr 7, 2011

My prog here doesn't work there's no syntax error My flash custom event doesn't trigger

so my question is can flash object dispatch custom event to itself because that's what I wanna do ?

View 1 Replies

Flash :: Bubbling Work For Custom Event And Object Hierarchy?

Jun 14, 2011

I have searched on the Internet and didn't find any clue on how to do so, any idea ? I don't want flex only flash (my objects are not visual components).

View 3 Replies

ActionScript 3.0 :: Listening For Custom Event Dispatched From Parent Object In Child Object?

May 25, 2010

I want to listen for a custom event dispatched from the document class in a custom subclass. For example, let's say in the document class I have:

ActionScript Code:[code]....

So that the subclass will trace 'Event from document class received' when the 'customEvent' event from the document class is listened by the eventlistener. However, the output is only 'customEvent dispatched', meaning it wasn't heard in the subclass.

View 7 Replies

Actionscript 3 :: Flex 4.5 Not Listening To Custom Event Dispatched In Custom Class?

Nov 4, 2011

I have the following situation:I have an event handler, that displays small messages in my application's statusbar.These messages get passes through by dispatching events from custom components.A simple message could be like "HTTP Error" or so.Now, the main event listener, in the main application file, listens to the event dispatched by any custom component,but seems to refuse listening to events dispatched by custom AS classes.Here is my code for the custom event:

package main.events
{
import flash.events.Event;[code]..

So to sum it all up:

- The event listener listens to the custom event dispatched by any custom component.

- The event listener does not listen to the custom event duspatched by an AS class.

Those who wonder, the event really gets dispatched, that's why I added a trace call.

View 2 Replies

Flex :: Event Flows For Built-in Event And Custom Event

Aug 22, 2011

I hava a custom component and it contains a child icon. If I add a mouse-click event listener to both component(click-listener1) and icon(click-listener2), the event dispatched sequence is click-listener2, then click-listener1. I can understand it. But if I add a custom event to component (listener1), and mouse-click event to icon(listener2), when icon is clicked, the component will dispatch the custom event. In my test, the event dispatched sequence is listener1, then listener2. It doesn't match with event-bubbles rule.

In my opinion The custom event is dispatched in listener2, which triggers listener1. Why event flow sequence is not listener2, listener1?

In component.

icon.addEventListener(MouseEvent.CLICK, iconClickHandler);
private function iconClickHandler(event:MouseEvent):void
{

[Code].....

View 1 Replies

Flex :: Dispatching Custom Event From A Custom Component?

Sep 8, 2011

I have a custom Flex 4.5 component (to be used in a List) -

Game.mxml (represents a clickable playing table in a card game):
<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer [code].......

But I never see the "game clicked: " trace. Does anybody please know why? I'm probably missing something minor, because I can see the "Clicked: 8946" trace.

View 3 Replies

Flex :: Disptaching Custom Event From Custom Component?

Feb 16, 2012

This is similar to the question asked here. I am dispatching custom event "ShopEvent" but i am getting error "Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent"Note: Error is thrown from the parent custom component (3rd code snippet), I have added more details thereThis is my custom event. See the first constant, I copy pasted the event name in custom components.

package com.events
{
import flash.events.Event;

[code]......

View 3 Replies

FLEX :: Flash - Component Not Receiving It's Own Custom Event?

May 10, 2011

I made a movieclip in flash that dispatches a custom event: MyEvent.THE_TYPE = "the_type"in flex I have: <local:my_flash_mc the_type="do_something()"however, this is not working.in flash, my event bubbles is set to true. everything works fine in flash.in flex I am NOT using:

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

[code]....

View 3 Replies

Flex Custom Event - Dispatch An Event From Inside Two Nested Components And Receive

Apr 12, 2009

I am having trouble using a custom event in flex. I need to dispatch an event from inside two nested components and receive it in the main application file. The basic set up is a main application file importing a custom "gallery" component.

[Code]..

View 1 Replies

Flex :: Propagating Event From A Built-in Component To A Custom Event?

Jan 27, 2012

I am trying to understand event propagation in Flex framework and have a following doubt on it:

Scenario: I have a built-in component DropDownList on change of which I want to create a custom event refreshPreview and want to propagate it to a custom component PictureComponent.

In the custom component's mxml, I have added the Metadata directive as follows to register a refreshPreview event with the compiler

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

Layout Details: In my main mxml application I have laid out DropDownList and the custom component such that both are siblings (i.e. have a common indirect parent)
e.g.

<s:Group id="contentGroup">
<s:Group id="formGroup">
<s:Form x="11"

[Code]....

I am seeing that the refreshPreview event is not getting propagated to the custom component.

I doubt this is because the built-in component is a sibling of the target (where the event got generated) and not a parent. how to make refreshPreview event propagate to custom component?

View 1 Replies

Flex :: Custom Event Not Being Registered With The Following Event Listener?

Apr 20, 2010

printableInvoice.addEventListener(batchGenerated, printableInvoice_batchGeneratedHandler);Results in this error: 1120: Access of undefined property batchGenerated. I have tried it as FlexEvent.batchGenerated and FlashEvent.batchGenerated.

The MetaData and function that dispatches the even in the component printableInvoice is all right. It I instantiate printableInvoice as an mxml component instead of via action-script it well let put a tag into the mxml line: batchGenerated="someFunction()

View 2 Replies

ActionScript 3.0 :: Create Custom Event Class If I Dont Need To Pass Custom Property With That Event?

Dec 28, 2009

Is there a point of creating custom event class if i dont need to pass custom property with that event?

View 3 Replies

ActionScript 3.0 :: Custom Event Bubbling From Non Display Object?

Dec 17, 2009

I have a utility class that I use to load images that never gets added to the stage and is extending EventDispatcher, it simply loads the data and spits it back out on request.

I want to add a custom event to track loading progress from outside the class. The events are firing but not (i think) bubbling because they aren't in the display list.

Is there a good way around this? I was thinking: Can I have a non display list object tell a display object to send the custom event for it?

View 9 Replies

ActionScript 3.0 :: Custom Event That Bubbles Up From Items Object

Apr 22, 2007

I'm trying to make a custom event that bubbles up from the Items object in this code to the Main object, and start the changeInfoHandler there. For some reason, it works when I put the dispatchEvent in the Items object inside a handler for a mouse click, but when I try to bypass that and call the function directly, it seems to only work in the scope of the Items object.

Main.as:
Code:
package{
import flash.display.*;
import flash.events.*;
import ChangeEvent;
[SWF(backgroundColor="0xefefef", frameRate='60', width='640', height='480')]
[Code] .....

View 2 Replies

Flex :: Dispatching Custom Event From Repeater Component And Listen Event In Other Repeater Components

May 4, 2011

I have a repeater component with custom event. My repeater components fires custom event holding data. My need is to dispatch event so other repeater components can access data from dispatching component.

Edit: Added whole stuff here.

<!-- AttributeMapping.mxml -->
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"

[Code].....

View 1 Replies

Flex :: Event In A Custom Component?

Sep 11, 2010

I'm just getting started with custom events in a custom component. And I don't quite have the hang of it, yet. I've got a component with a button in it. When it's clicked, I want to call a function in the main app.

Custom Component:
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" >

[code].....

View 1 Replies

Flex :: 3 - How To Dispatch Custom Event

May 14, 2011

how to dispatch custom event in flex in my main mxml file i have put this code to dispatch this function

[Code]....

i want to ask what i am missing why my customevents not working

View 2 Replies

Actionscript 3 :: Flex Custom Event Dispatching

Oct 10, 2010

I got a question about event dispatching in flex.my goal is to get a custom event loaded up with some data and than bubble up to the eventlistener. my main application has and AMF service request inside which calls an service class. that class is supposed to dispatch an event when the AMF service request returns a result or fault and the main application is listening for that event.so inside my mainapp i add and listener like this:[code]
However, this event never reaches the main application. Looking closely to it with the debugger, i found out that when the event is dispatched the listeners property of it is set to null.

View 5 Replies

Flex :: Dispatching Custom Event From ItemRenderer?

Feb 15, 2012

I'm trying to dispatch a custom event from a custom ItemRenderer. This is my custom event
package events {
import customClass.Product;
import flash.events.Event;
public class CopyProductEvent extends Event {
public static const COPY_PRODUCT:String = "COPY_PRODUCT";
public var picked:Prodotti;
[Code] .....
The event from the function is dispatched correctly... I can't intercept it..

View 1 Replies

ActionScript 3.0 :: Flex Custom Event Capturing?

Jan 25, 2009

I created a new CustomEvents object which I want to use to let the main class located in .mxml file to know about an event which had finished it's work in Crop class. However when I dispatch a CustomEvent from Crop class I can not catch it in my main .mxml file's class.

CustomEvents class

Code:
package actions
{
import flash.events.Event;
public class CustomEvents extends Event

[code]....

View 4 Replies

Actionscript 3 - Flex :: Click - Outside Event On Custom Components

Jul 18, 2009

Is there a way to write a custom event that gets triggered when the user clicks outside of that custom component instance? Basically anywhere else in the main flex app.

View 2 Replies

AS :: Flex - Handle Custom Event In Parent Component?

Feb 6, 2010

I defined a simple event class:

public class NewMoveEvent extends Event
{
public function NewMoveEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=true)

[code].....

View 1 Replies

Flex :: Event-based Interaction Between Two Custom Classes?

May 25, 2010

I have 2 custom components, which have their own nesting hierarchy ... One is container for another. I have to "familiarize them" with each other. The way I'm trying to achieve that is using global events (one side is firing and the other one is catching):

Application.application.addEventListener("Hello", function (data:Event):void{
// .. some actions
});

[Code]...

Then should be created the connection between container and it's child.

BUT, the only thing I could acheive is passing a reference to the Container in the DynamicEvent. Is there any chance that I could access the child at the event-handler function.

View 3 Replies

Flex :: Call A Custom Event From An Item Renderer?

Jun 17, 2010

I have a Renderer:

<?xml version="1.0" encoding="utf-8"?>
<s:ItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" [code].............

View 5 Replies

Flex :: Listen To A Custom Event Dispatched By A Renderer?

May 2, 2011

I'm having the following problem: I've implemented a custom headRenderer for my DataGridColumn. The idea is to have a dropdown menu when clicked on the column header. The problem is I don't know how to add a listener or pass a variable to the renderer since the renderer class is instantiated by the ClassFactory.

The renderer class:

<?xml version="1.0"?>
<!-- itemRenderersdataGridmyComponentsRendererDGHeader.mxml -->
<mx:HBox xmlns:mx="library://ns.adobe.com/flex/mx"

[Code].....

View 1 Replies

Flex :: Custom Event Dispatch And Listening With Viewstack?

May 27, 2011

I got a question about event dispatching and dispatching in flex.

My goal is to pass an email address captured in one component (Comp1) and be passed to another (Comp2). These two components are navigator content of a viewstack. The custom event dispatched the email correctly from Comp1 but somehow could not reach Comp2. The application (Main) looks like :

<fx:Script>
<![CDATA[
import events.LoginEventComplete;

[Code].....

View 2 Replies

Flex :: Custom Event - Cross Domain Objects

Sep 14, 2011

I have an object being passed between flash and flex using the a custom event. I am importing a library in flex containing a copy of the object's class. The classes are identical. But when I attempt to access the object in flex I get this error:
TypeError: Error #1034: Type Coercion failed: cannot convert com.cackleberries.data.api::ApiObject$ to com.cackleberries.data.api.ApiObject.

This function is passed into flash as a callback from AIR / flex
public function airEventHandler(type:String, data:Object):void {
switch(type) {
case "air_api_call":
if(data) {
if(data.hasOwnProperty("apiObject"))
[Code] .....

I am getting the error when I pass the apiobject to serverApi.makeApiCall. That function takes a ApiObject as its parameter. Initially, the data object is created with with the apiObject key with a ApiObject as the value (done in flash).

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved