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


Similar Posts:


Actionscript 3 :: Keyboard Event Only Fired From Original Class?

Nov 21, 2011

Using FlashDevelop, I've got a bit of code to detect keyboard events. The problem is, if I run this code from the main class (Main.as) it'll trigger the event, but not if I go to another class.

For instance, I have the main class, and it has this function

addEventListener(KeyboardEvent.KEY_DOWN,onKeyDown);
public function onKeyDown(e:KeyboardEvent):void
{

[Code]....

There's no message from either class. If I put the event in the second class, nothing happens. All the other events besides keyboard events still work.

View 1 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 - Get Event Type That Is Fired?

Dec 2, 2011

I am working on Flex project these days and having java background. In my current task, same pop up is opened when two different types of custom events are being fired and I have to hide a button for one event type. So, how i can get event type.

View 2 Replies

Flex - Label DataChange Event Not Getting Fired?

Feb 23, 2010

<mx:Label id="myLabel" dataChange="{trace('changed!!');}" />

I change the text in the above label:

myLabel.text = "new text";

But nothing is traced as it's supposed to.

Am I using a wrong event? I thought dataChange is fired when text in the label is changed.

View 1 Replies

Flex :: What Event Is Fired When All SkinSparts Are Available In A SkinnableComponent

Feb 12, 2011

I'm (slowly) learning Flex 4 and working on skinning a custom component that extends SkinnableComponent. The component is all in ActionScript and essentially looks like this:

[Code]...

The issue I'm having is on NULL REFERENCES in the Constructor for the various SkinParts, because they're not created yet. I'm trying to find out when is the best time to access them to assign their .text values. I know I can override partAdded() and add the .text value as each part is added, but I'd rather just listen for some magic event that is dispatched when they're all available.I'm not sure whether or not it matters, but the accountName, accountNumber variables are assigned by using a repeater with a dataProvider on the host component. I'm not sure if that too has something to do with when the data is available to the AccountSummary component - which may also needed to be waited on. I was able to successfully use FlexEvent.CREATION_COMPLETE to assign all my .text values to the SkinParts, but is that the right event/best practice?

View 1 Replies

ActionScript 3.0 :: Which Event Gets Fired When We Move Out Of Flex Screen

Mar 16, 2009

I want to validate the user detail screen and infrom user ifany error when he moves out of flex screen.Basically we have submit button out of flex area and userenters detals in flex screen and submits using jsp header

View 1 Replies

Flex :: Which Event Gets Fired When Click On ViewNavigator In Mobile App

Aug 19, 2011

<s:ViewNavigator id="trends" label="Trends" width="100%" height="100%" firstView="views.TrendsView" icon="@Embed('assets/column-chart-icon32.png')"/>
<s:ViewNavigator id="attach" label="Attach" width="100%" height="100%" firstView="views.AttachView" icon="@Embed('assets/paperclip-icon32.png')"/>

Now, I know if you click on "trends" then firstView "views.TrendsView" will be shown. Now you are in that view and click again on "trends" (bottom nav bar) which event will flex dispatch?

View 3 Replies

Flash :: Flex Load Modules READY Event Not Fired

Oct 12, 2009

Using flex builder with flex sdk 3.4.0 if the module is remote like url...The READY event is never fired, i don't understand why.Do you get the same behavior? Original code is from url...[code]

View 3 Replies

Flex :: Which Event Is Fired After The Data Is Loaded Into Datagrid Or Combobox

Feb 26, 2011

Which event is fired after the data is loaded into datagrid or combobox ? (Assuming the dataprovider is set to the datagrid).

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

ActionScript 3.0 :: Event.AddedToStage Being Fired Twice?

Mar 19, 2011

I've just been working on a splash page/main menu for my game, and when tracing a value in the function fired when added to stage, I noticed it was tracing twice.After a process of elimination I found it was caused by some text inside a movieclip in the library.

This is literally my first time using MovieClips in AS3, as I generally just render everything manually, but I used one to knock up some quick text.When converting the text to vector graphics, the problem disappeared. Still the same MC being created and added, yet no problem. It was caused by the text.Doing away with MC's completely, embedding the required font and just using manual TextFields is my solution.Tested on 2 different FP10 builds by the way, same behaviour on both.

View 2 Replies

ActionScript 3.0 :: Combobox Change Event Isn't Fired

Feb 12, 2009

I've got this weird problem with Flash in a embed browser in an ASP.NET Windows Application. I've got this Flash Movie that runs in the Windows application and has got a couple of comboboxes. I've added an eventlistener to such a box, but his change event isn't triggerd on some computers. When I click on the combobox it opens up, but when I click on an item in the combobox it closes before he could trigger the change event.

The weird part is that this occurs on some computers, on others it works as it should. And when I load the swf directly in the browser the comboboxes work all the time. So it has something to do with the Windows Application and Flash. All the tested computers have the Flash plugin version 9 and higher (needed for my movie) installed.

View 0 Replies

ActionScript 3.0 :: Remove The Event Listener As Soon As That Even Gets Fired?

Jan 18, 2010

i have to remove the event listener as soon as that even gets fired. i added the listners like this.

btn1ClickHandler function:
-------------------------
private function btn1ClickHandler(evt:MouseEvent):void

[code].......

View 1 Replies

ActionScript 3.0 :: Loader Event.COMPLETE Never Fired?

Feb 2, 2010

I'm loading in a jpeg and sometimes the Event.COMPLETE is never fired. I have a ProgressEvent that traces out the bytesTotal and bytesLoaded... and it goes all the way up until the bytesTotal equals bytesLoaded... but randomly, the Event.COMPLETE is never fired!

View 3 Replies

ActionScript 3.0 :: Event.COMPLETE Listener Not Getting Fired?

Sep 15, 2010

ok this seems to look like it should work.. but for some reason the Event.COMPLETE listener for the loader is not getting fired..

does anyone see something that I missed..

i put in trace statements in to see where its not getting to..

I verified this so far..

- the constructor function does appear to add the even listener to the loader.

- Unit3DPreview.load() function gets called (from the parent class) and receives the _path string properly..

- the loader does have an Event.COMPLETE listener at the time of the loader.load() call..

- the renderAnimation listener function never gets fired off.. even though the listener has been added..

there is no IO error.. the image is in the correct location.. I know this because if I remove it .. I get an IO error..

one thing is that there is an instance of this class already placed inside a library symbol that is associated to another class that passes a bunch of data .. the preview image path being one part of it.

not sure if having it be already existing vs me creating it via code would make a difference .. that is something I have not tried yet.

[Code].....

View 1 Replies

Flash :: Get Associated URLRequest From Event.COMPLETE Fired By URLLoader

Feb 25, 2010

So let's say we want to load some XML -

var xmlURL:String = 'content.xml';
var xmlURLRequest:URLRequest = new URLRequest(xmlURL);
var xmlURLLoader:URLLoader = new URLLoader(xmlURLRequest);

[Code]....

I hate that you can't just say e.target.src or whatever - is there a good way to associate URLLoaders with the URL they loaded data from?

View 3 Replies

Flash :: Prevent A Parent Movieclip Event From Being Fired?

Mar 19, 2011

I have an AS3 movieclip with a button. Both the movieclip and button needs a click event but when I click the button it also fires the parent movieclip's event handler.

View 1 Replies

ActionScript 3.0 :: When I Double Click / Event Doesn't Get Fired

Jul 5, 2009

when I double click, the event doesn't get fired,[code]

View 2 Replies

ActionScript 3.0 :: Context Menu And No Mouse Up Event Fired

Jan 19, 2010

the issue i face right now is that there is an item that can be dragged around the screen and if this item is dropped, physics will bring it back to the floor. all good so far. however, when i am currently dragging the item and i right click and choose "show redraw regions" or any other option available in that menu, there is no mouse up event fired, making it impossible for me to simulate the release of the item. i have looked in the googles and the doc:

[Code]...

View 2 Replies

ActionScript 3.0 :: Custom Event Fired / Yet Not Performing Actions In Method

Aug 19, 2009

I have a Custom Event that takes the name of a file uploaded through FileReference and bubbles the variable back up to the parent class. The Custom Event works and when traced in the parent class, it appears the variable came through as well and traces out in the output. However when trying to use this variable in the text field and assigning it anywhere in the parent class, nothing happens, not even an error.[code]

View 3 Replies

Actionscript 3 :: What Is The Event That Gets Fired When Click On A Datagrid Column To Sort It

Apr 28, 2011

What is the event that gets fired when you click on a datagrid column to sort it? I could use that to know which column is getting sorted and hence have a common sortcomparefunction for all columns.

View 2 Replies

ActionScript 3.0 :: Custom Event Fired, Yet Not Performing Actions In Method?

Aug 20, 2009

I have a Custom Event that takes the name of a file uploaded through FileReference and bubbles the variable back up to the parent class. The Custom Event works and when traced in the parent class, it appears the variable came through as well and traces out in the output. However when trying to use this variable in the text field and assigning it anywhere in the parent class, nothing happens, not even an error.

parent class
____________

package classes {

import classes.gs.*;[code]..........

View 0 Replies

ActionScript 3.0 :: Video Conferencing - Camera Blocked When Timer Event Fired

Apr 18, 2011

I am trying to make an application which will do the video conferencing. I have read some article on actionscript and started making the application. I am capturing image from web cam and copy it in an array which acts as a buffer. Then I am running a timer which pops each image from array and converting it into bytearray and send it via socket. When timer event is fired camera gets blocked and the whole process gets slow down. Is there anyway to do the video conferencing smoothly ?

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

ActionScript 3.0 :: Not Receiving COMPLETE Event In URLLoader?

Aug 18, 2009

I'm querying a web application in a remote server through XML files and receiving answers in the same file format. Until now, sometimes I received a connection error:

Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: http://server/Services/startSesion.com
at reg_jugadores_fla::MainTimeline/queryGQ()
at reg_jugadores_fla::MainTimeline/reg_jugadores_fla::frame1()

When this occurs, trying to access the services through a web browser, there's a test page where you can try queries, returns a "500 Internal server error". I managed that problem adding a listener to catch the error:

xmlSendLoad.addEventListener(IOErrorEvent.IO_ERROR , catchIOError);

But since yesterday I can't connect anymore using Flash while it's possible to access the test page. I'm not able to talk to any support guy as the company is closed for vacations! I added listeners to try to know what's happening and this is the result in the output window:

openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2]
progressHandler loaded:154 total: 154
httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=200]

AFAIK, status=200 means OK but why the COMPLETE event isn't dispatched?. So, is there anything I can do or just wait until the tech guys return from the beach?

/************************************************** ********/
queryGQ(sessionURL,sessionQS); // Start session
stop();
/************************************************** ********/

[code].....

View 3 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 :: Dispatching And Event In Parent SWF & Receiving It In Child SWF?

Jul 17, 2011

would like to receive an event(Dispatchd in Parent swf) in Child SWF, the bold italic text represents the piece of coding i

//in PARENT SWF i have -----------------------------
dispatchEvent(new Event("CloseDoors"))
// in Child SWF --------------------------------

[code].....

View 4 Replies

ActionScript 3.0 :: ClasaAscultatoare Is Not Receiving The Event Dispatched By EvDispathcer?

May 17, 2010

i have the following class that dispatches a custom event:

[Code]...

My question is why clasaAscultatoare is not receiving the event dispatched by EvDispathcer?

View 3 Replies







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