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


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

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

ActionScript 3.0 :: Custom Event Not Receiving?

Jul 19, 2011

This has literally been buggin me for days. I cant get my custom event "selectionEvent" to work. It works in the DocumentClass constructor, but when trying to dispatch from a child object it doesnt recieve!!!!also in my other thread about custom events, If I try to add the listener to the child object, it just says "undefined property loadplayscreen".DocumentClass: (dispatches fine here)EDIT: updated (little change)

Code:
package
{

[code].....

View 9 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

ActionScript 3.0 :: Custom Event Listener Not Receiving?

Jun 7, 2011

The event is not Firing!!!!!!!!!! Why? The "hitplayer" is supposes to fire and thats the one I'm having the problem with. It wont even trace. I know its a problem with the event because it works fine with Event.ENTER_FRAME.the listener:

Code:
public function FightingGame() {
adEventListener(Event.ADDED_TO_STAGE, FightingGameBuild, false, 0, true);

[code]....

View 4 Replies

ActionScript 3.0 :: Receiving Events From Custom Event Class?

Feb 1, 2007

I'm having a problem with a custom subclassed Event class. Or I should say, I'm having trouble receiving events from this custom event class. I'm pretty sure I have everything wired correctly, the event is dispatched properly and my trace shows the Event instance being spawned. However, my eventListener, which is in another class, never fires its handler function.Have any of you run across instances where custom event classes fail to fire? I'm about at my wit's end.

View 14 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

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

Actionscript 3 :: Flex 3 Event Propagation On A Composite Custom Component?

Jul 24, 2009

I have a custom component made up of a selectable control (radio button)and a text input. I want to perform some logic in response to the change events from both of those controls, but after that I want anything that is registered on the composite component's change handler to have a change to handle the events as well. The problem is, when I re-dispatch the events the event target has changed to my custom component, losing the originating event's target.

Here's my custom component:

<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" label="{listItem.@text}" data="{listItem.@level.toString()}">
<mx:Script>

[code].....

In the event handler that receives change events from this component, I see that event.target is an instance of SpecifyRadioButton, not the TextInput or RadioButton, as I'd expect. How should I propagate the event to get what I want here?

Getting event [Event type="change" bubbles=false cancelable=false eventPhase=2]
from question0.tabSurvey.questionForm.questionContainer.Single94.VBox95.SpecifyRadioButton111

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 :: 4 - Multiple Instances Of A Custom Component Listening The Same Event Of A Parent

Jan 28, 2011

In short: I need an event listener in a custom component so all its instances (without editing them) react at the same time, fired by a dispatched event in its parent container. In detail: I have a custom component with Tab navigator. (The tabs are intended to show different preferences for different Languages.) I have a button bar with buttons for all the languages. There are a lot of instances of the custom component.

I want to click in a button of the languages bar and get ALL the instances switched to the same tab (the custom component contains the logic to change the tab). I can do it by adding the event listener for EACH INSTANCE of the custom component, so it calls an internal function that changes the tab. But it seems to be very coupled, isn't it? I wonder if it can be done in the master CLASS of the component, so it listen for events in its parent container, whichever it is. In my mind this code shoud work, but it doesn't (obviously ill'use a custom event to pass the new language value): this.parent.addEventListener("lang_change", this.change_tab); This way I can just drop an instance of the component, and see it working for itself.

View 2 Replies

Flex :: Put Custom Code In A Custom Component In Flash Builder?

Dec 11, 2010

In the main file, I would write[code]...

But if I want the component to have that behaviour innately, where do I write it in the mybutton mxml file to have it reference itself?[code]...

View 2 Replies

.net :: Receiving Generic Typed Custom Objects Through AMF In Flex

Apr 27, 2010

Is it possible to receive custom generic typed objects through AMF? I'm trying to integrate a flex app with an existing C# service but flex is choking on custom generic typed objects. As far as I can tell Flex doesn't even support generics, but I'd like to be able to even just read in the object and cast its members as necessary. I basically just want flex to ignore the <T>. I'm hopeful that there's a way to do this, since flex doesn't complain about typed collections (a server call returning List works fine and flex converts it to an ArrayCollection just like an un-typed List).

The custom C# typed class
public class TypeTest<T> {
public T value {
get; set; }
public TypeTest () {
}}

The server method returning the typeTest
public TypeTest<String> doTypeTest() {
TypeTest<String> theTester = new TypeTest<String>("grrrr");
return theTester;
[Code] .....

Irritatingly if I change the result handler to take parameter of type Object it works fine. How to make this work with the value object?

View 2 Replies

Flex :: Not Receiving Event.Complete Callback

Feb 12, 2010

I created an image uploader for an app I am working on. I first used php for the server side script, and everything worked fine. I found out afterwards I had to use .net, so I created new serverside scripts. The problem I am having is that my event.COMPLETE listener is never firing. I can receive data back using a DATAEVENT listener, but then it stops at this error:
Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.

Here is how I am sending my file.
var fileRefReq:URLRequest = new URLRequest(FILE_UPLOAD_TEMP);
var fileReqVars:URLVariables = new URLVariables();
fileReqVars.subdir = "Temp";
fileRefReq.data = fileReqVars;
fileRefReq.method = URLRequestMethod.POST;
fileRef.upload(fileRefReq);

The file definitely gets uploaded to the first TEMP directory, but then it breaks with the above error.

View 2 Replies

Flex :: Not Receiving An Event Fired From An .AS Class

Jul 16, 2010

I have 2 files, 1 to dispatch the event and 1 to receive it (of course in addition to the event class itself).

I've done this before with both dispatching and receiving files being mxml, but this time the dispatching file is an actionscript class, and it's not working this time. Is it different for actionscript classes?

Here's a dumbed down version

The dispatching class dispatches the event as soon as it's created.

public class ASClass extends UIComponent{
public function ASClass(){
dispatchEvent(new MyEvents(MyEvents.FIRE_EVENT));
}
}

in my main mxml app, I instantiate the ASClass which automatically dispatch the event as soon as it's created and the main mxml app should receive back.

protected function appCComplete(event:FlexEvent):void{
addEventListener(MyEvents.FIRE_EVENT, gotEvent);
var asClass:ASClass = new ASClass();

[Code].....

View 1 Replies

Flash :: Flex Custom Component With More Inside?

Apr 14, 2012

I am creating a custom component in Flex with extends the BorderContainer class, and I would like to be able to place additional content within the tagset when I use it in my main application, like this:

<components:CustomComponent title="Hello">
<s:Label text="If you have one enter it below:"/>
<mx:Spacer height="15" />

[Code]....

This works just fine, except that my component definition had some additional things inside of it, such as a <s:Label/> and styling, which is replaced by the content within the tagset above when I go to use it.

If I do not put anything within the tagset, the content that was originally in the component is not replaced.

Is there a way that I can simply append additional content inside of the component when I go to use it, instead of it being replaced each time?

View 1 Replies

Flash :: Flex Custom Component Won't Resize?

Apr 5, 2011

I am trying to create an expanding object with the following event handler

public function pickerMove(e:MouseEvent):void {
trace("in mouse move");
var offsetX:int = e.stageX - touchX;

[Code]....

Is there something that I don't know about custom components resizing?

View 1 Replies

Flex :: Make A Custom Component Or Extend The List Component For A 2D Top Down View MAP ?

Nov 11, 2010

I'm building a top view 2D map, that it's objects are stored on the server.The kind of objects are 10 and might be a photo, label, button, lists, mix of them or labels with tooltips.The component must request the "areas" that are missing on screen.An area is 1000x1000 px and is cached in flex.To move in the map, will be like in google maps (drag-and-drop).I should be able to have another list and move objects from one to another using drag-an-drop on objects. Ex.: I grab an objects from a list and I move it on this map, I release the mouse button and the item is placed there.Now the problem is: I build a custom component for this trying to emulate the item renderer for performance and recyclage, implement drag-and-drop on objects and request the areas that are missing?

or

I extend the List component from spark and I add some features as multiple kind of itemrenderers and use recycle on them. Of course it must be able to request the missing areas on the screen and cache it's data.Maybe create a custom layout is needed too.What I need is something that must be really fluid, so the lighter this component is, the better.

UPDATE: *There will be not any object over another.

*I will not use hitTest on bitmaps because all bitmaps are wrapped in another component,as they,for now are itemrenderers.

Anyway I already begin to do this using a class that extends the SkinnableDataContainer and a custom layout. As the layout is not like a grid, is sparse, random items at diferent points(x, y).How to get the localX and localY, relative to item renderer and not to the Spark List, from a DragEvent in Flex 4?

View 1 Replies

Flex :: Flash - Which Container Is Mostly Used For Load New Custom Component

Jul 28, 2009

In AIR application i have link button like winner statistics . if i like this button then show winner statistics (canves) reports full page on my application . I Already created winner statistics using canves component .Which container is mostly used for view data ?
Please refer me ? i tried viewstack but it will overwrite Main page ?

View 1 Replies

Flash :: Events Not Firing In Custom Flex Component?

Jun 24, 2011

I'm taking my first stab at writing a custom flex 4 component by extending the UIComponent class. Unfortunately, I cannot get the component to respond to any sort of mouse events.I've tried setting mouseEnabled to true is the component, as well as setting mouseChildren to true in the parent (the stage object). It seems whatever I do, my click events can be detected from the stage, but not with the component.Here is my component class:

package components {
import mx.core.UIComponent;
public class DrawCanvas extends UIComponent {

[code]......

View 1 Replies

Flex :: Define Custom 'contentGroups' In A Custom Flex 4 Component?

May 12, 2010

The spark panel component for example can be written like this

<Panel title="Skinny">
<child components ... />
<controlBarGroup>
<child control bar components ... />
</controlBarGroup>

[Code]...

The motivation here is that I can now create a couple different skin files to change the look and layout of those subgroups. Reading source of the spark panel, there are some calls within the mx_internal namespace such as getMXMLContent() which is a method of the spark group component, but which I have no access to.

Does the description above make sense? How can I create custom 'contentGroups' in my custom Flex4 component that can use nested mxml child components? Should I approach this a different way?

View 2 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 :: Passing Properties To Custom Component In Flash Builder 4

Sep 7, 2010

I'm trying to pass some properties to a component I've created in Flash Builder 4. In my example below I want to pass the "label" property to update the label property of the Button.

// MyApp.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="[URL]"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:local="*">
[Code] .....

View 1 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

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

Actionscript 3 :: Why Won't Visual Elements Display Inside Custom Component Extended From Another Custom Component

Sep 6, 2011

I created a custom MXML component, TurboContent, that extends the NavigatorContent class:

<s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">

[Code].....

In this case, the 'myButton' component never shows up, but all the elements of the base component do (3 buttons and a datagrid).

View 2 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 :: 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







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