Flex :: Event Listener Callback Not Firing?

Jun 17, 2011

In our app, I am periodically noticing that a particular event handler is not firing. 99% of the time, it works fine, but, every so often, it just dies. How can I find out whats happening? Is the DispatchEvent() not happening/working somehow? Is my listener still listening? Did something else catch the event, and not pass it along so that the 'right' listener can get to it ?

Here's a little bit of the code...

Thats a somewhat pruned down version of what the real code is, but I don't think I trimmed out anything important. The key, as I see it is that we fire up the params dialog, then start to listen for the closed event. Then, we show the param dialogs close function. What happens when it fails is that the trace message "caught close event.." is never generated, and, consequently, the closeHandler is not getting called at all.

View 1 Replies


Similar Posts:


Actionscript 3 :: Use The Same Event-listener Callback For Multiple Event Types?

Nov 18, 2011

This might be more of a subjective question, but is it generally best practice to have one dedicated method per event-types that you add an event-listener?

Such as:

myButton.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
myButton.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
//Somewhere else in the code...

[Code].....

And if you had a MouseEvent.MOUSE_UP, MouseEvent.MOUSE_DOWN and other relevant MouseEvents event-listeners to watch for, you could even set a switch statement to handle all the various MouseEvent types.

View 1 Replies

Javascript :: IE Onbeforeunload Not Firing ExtenralInterface Callback

Feb 12, 2010

I have a Flash movie embeded with swfobject in a html container. Through ExternalInterface I have registered a javascript function to fire callback to my flash app.

ExternalInterface.addCallback("notifyClose", notifyOnClose );

The javascript function is added as an event listerner to fire onbeforeunload.

<script language="JavaScript">
function getSWF(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1){

[Code].....

I have tested in FF and IE. Firefox works as expected but not in IE. In IE I get notified in Flash with the onload message, but not onbeforeunload.

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 :: Pass An Extra Parameter To Callback Event And Have It Evaluate Early?

Jun 30, 2011

For example:

for(var i:int=0; i<someArray.length; i++)
{
var loader:Loader=new Loader();
loader.load(new URLRequest("http://testurl.com/test.jpg"));

[Code]....

The second paramter (i) for imageLoaded is always 1, I guess because i no longer exists and is defaulting to 1. Is it possible to get that second paramter to be evaluated when the load is started rather than on complete?

View 2 Replies

Actionscript 3 :: Flex Adding Event Listeners With Callback Functions Which Have No Arguments

Jun 10, 2009

fileReference.addEventListener(Event.COMPLETE, uploadCompleteHandler);
private function uploadCompleteHandler(event:Event):void {}

Above is one way to add an event listener in Actionscript. By default the callback function needs to have an argument with name event and type Event. Is there a way to declare this function without any arguments :

private function uploadCompleteHandler():void {}

Edit : It's possible to add an event handler without any arguments in mxml. So one student wanted to know, why isn't it possible to do the same in actionscript?

View 2 Replies

Flex :: Event Listeners Not Firing In Code

May 15, 2011

event listeners not firing in this code can anybody guide me what is problem with this code.[code]

View 2 Replies

Actionscript :: Flex 4 COLLECTION_CHANGE Event Not Firing?

Aug 25, 2011

I'm currently trying to achieve 2 way binding of an ArrayCollection object. However, the COLLECTION_CHANGE event is not firing.

App.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"

[code]....

I'm trying to achieve 2-way binding with the Booths variable.the COLLECTION_CHANGE event never fires even when I add 2 new items in the Booths variable in the App.mxml

View 3 Replies

Flex :: Programmatically Firing Event Listeners

Nov 10, 2011

I would like to programatically fire an event on a spark checkbox. I have a tab bar which has tabs enabled according to various checkboxes. I am loading data into these tabs. Sometimes tabs 1 and 2 will be enabled. Other times tabs 2 and 3. Other times tab 4 by itself (and all the other combinations). I have tried to enable the VBox (in action script) which is in my view stack but it seems to freeze the application. The VBox enables correctly upon user input on the check box. If I set the checkbox to be selected it does not fire the event and so does not enable the tab.

Is it possible to manually fire an event in Flex. I have tried to see if I can take the checkbox and get the event and fire it. Unfortunately I can only see addEventListener, hasEventLister and removeEventListener. There is no way of getting the events that are already on the checkbox

View 1 Replies

Flash :: Flex - Registering A Function As Callback Using CreationComplete Event Fail On Linux?

Jan 13, 2011

I have created a flex project on flash builder 4. In the MXML I have

xmlns:mx="library://ns.adobe.com/flex/mx" creationComplete="init();"

And to check if it runs

[Code]...

View 2 Replies

Flex :: DragDrop Event Not Firing For TextArea Control?

Feb 2, 2010

I'm working on a simple view in my app that allows a user to drag an item from a list control and drop it onto a textarea.

Seems the dragEnter event fires just fine, but the dragDrop event does not.

View 1 Replies

Flex :: Swfloader Component Not Firing Complete Event?

Mar 25, 2010

enter code hereBeen really frustrating just trying to load a swf from a swfloader in Flex and then accessing it's content. I'm sure once I figure out how to do it once then it'll be fine, but I've gone thorugh a bunch of tutorials and somethings not right. Here's my flex code:and the as code:

public function initHeaderSwf():void
{
trace("INITIATIED");[code]........

Here's the problem: The swf loads, there is no problem there.i see it in my compiled swf. but the complete event doesn't fire. CreationComplete will fire, and then I try, after that, to make a event listener for loading the actual swf, that doesn't fire.I've tried it a variety of different ways with no luck.All I am trying to do is change a text field in the loaded swf.I imagine this might be a problem with the sequence of things loading or something like that, but not sure.

View 1 Replies

Flex :: OnResult HTTPService - Event Possibilities Not Firing

Sep 1, 2010

I have a HTTPService:
<mx:HTTPService id="scoreService" url="http://" method="POST" result="onResult(event)">
<s:request xmlns="">
<name>{..}</name><score>{...}</score>
</s:request></mx:HTTPService>

And a script for (event):
private function onResult(e:ResultEvent):void {
if (e.result.status == true) {
currentState='...';
} else {
Alert.show("...", "...");
}}
The problem is that none of the event possibilities fires after I POST data to my php.

View 1 Replies

Flex :: DataGrid Editing Cells In Same Row Not Firing Collection Change Event

Mar 20, 2010

I am using the flex datagrid to allow the user to edit some data. My update process relies on a CollectionEvent of type update. Basically I catch this event package the values and update the database. However, if the user edits a cell then moves to edit a cell in the same row the value is updated but a collection event is not fired. Only when clicking out of the row the event is fired. Has anyone had experience with this. I have heard the datagrid is a little quirky is this one of those quirks or am I doing this all wrong?

View 1 Replies

Flex :: Loader Object Not Firing Complete Event After An External Css / Swf File Got Loaded

Jan 18, 2011

I am a bit stuck here for the past few days. I have a SWF running in Security.LOCAL_TRUSTED sandbox. I can load my JPEGs and simple SWFs without any problems

[Code]....

View 2 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 :: Events Firing Before Listener Is Set

Nov 18, 2009

I keep running into problems where I want to add an event listener onto a class instance RIGHT after it's instantiated, like this:
Code:
storiesXML = new XML(XMLdata);
storyBook = new vStories(XML(storiesXML.stories));
storyBook.addEventListener("storyBookLoaded", storyBookLoaded);
. . .

But by the time we arrive at the third line, the "storyBookLoaded" event has very often (inconsistent) already been dispatched from my class instance:
Code:
var evt:Event = new Event("storyBookLoaded", true, false);
dispatchEvent( evt );
...

(Even though quite a lot has happened in the class before that.) To be clear, I don't want to add storyBook as a display child, and even if I did, the addChild() method would have to be called after instantiation of storyBook, so we'd have the same problem. I know I could set a timer in the vStories class to artificially delay the dispatching of the event, but that seems really hack-ish, and would have a real compounding problem if I have to do it too often as everything builds up. How to make sure custom communication events happen after their listeners are set?

View 4 Replies

ActionScript 3.0 :: ROLL_OUT Listener Not Firing?

Jan 16, 2010

I am loading an external image into a movieclip and the rollout works fine if I move the mouse slowly. If I scroll quickly across the stage, the rollover state stays and the rollout doesn't happen. Slowly rolling back over the movie clip doesn't fire the rollover, but does fire the rollout according to the traces.

container.getChildByName("dot").getChildByName("id ").addEventListener(MouseEvent.ROLL_OUT, dotRollout);

Unfortunately, I don't have a small example of this. It is a piece of a rather large conversion from AS2 to AS3 and this is just about the last bug.

I could use a trick to track the listeners that are added and removed.

Am I creating the problem by adding and removing the listeners everytime a hover or src image gets loaded?

I should mention that it is failing in Flash player 10 since one post called it a player bug. No great info there.

View 4 Replies

Flex :: Accurate BPM Event Listener In AS3?

Dec 7, 2009

I'm trying to sync animation to music at a specific BPM. I've tried using the Timer but it isn't accurate when dealing with small intervals in milliseconds. I did some reading and found an alternate method that uses a small silent audio file and the SOUND_COMPLETE event as a Timer.[code]...

View 4 Replies

Flex :: Reference To ArrayCollection And Add Event Listener

May 26, 2010

I got a reference to an arrayCollection and add event listener like this:
collection.addEventListener(CollectionEvent.COLLECTION_CHANGE, onCollectionChange);
That's fine. Now some other component does have the same reference and is adding items to and removing items from that collection.

Each time the handler is called:
private function onProjectPersonsChange(event:Event):void {
if (event.kind == CollectionEventKind.ADD) {
//do something
} else if (event.kind == CollectionEventKind.REMOVE) {
[Code] .....
Why the removed item is not in 'items'?

View 1 Replies

Flex :: Putting The Event Listener In Different Class?

Jul 18, 2011

let's say that i have this button which is called "Click_Here" and i added an event listener to it in some class file in order for it to run the event handler in a different one .. so it will be like this

classfile1.as

Click_Here.addEventListner(MouseEvent.CLICK , buttonClicked ) ;

classfile2.as

public function buttonClicked (e:MouseEvent){ trace ("hello");}

View 3 Replies

Flex :: Attaching An Event Listener To All URLRequest's?

Oct 13, 2011

We have a flex application that connects to a proxy server which handles authentication. If the authentication has timeout out the proxy server returns a json formatted error string. What I would like to do is inspect every URLRequest response and check if there's an error message and display it in the flex client then redirect back to login screen.

So I'm wondering if its possible to create an event listener to all URLRequests in a global fashion. Without having to search through the project and add some method to each URLRequest.

View 3 Replies

Actionscript 3 :: Using A Callback (instead Of An Event)?

Aug 30, 2010

how to write a callback instead of using an event to communicate between two classes (objects) in Actionscript 3.0?

View 2 Replies

ActionScript 3.0 :: Event Listener - Error #2007: Parameter Listener Must Be Non-null?

Feb 4, 2009

this is the error I am having:

TypeError: Error #2007: Parameter listener must be non-null.at flash.events::EventDispatcher/removeEventListener()
at project1_fla::MainTimeline/btnName()

here is my code:

ActionScript Code:
import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;[code]..........

View 1 Replies

Actionscript 3 :: Flex 4: Event Listener Created, But Not Being Called?

Sep 13, 2010

I'm trying to call an event I've created in another component. I've added trace() into my methods so I can see what's being called. Everything except for the event listener (myEvent) is being called.

// TestApp.mxml (application)
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code].....

View 1 Replies

Flex :: Tree Space Default Event Listener?

Oct 7, 2010

I have noticed that when I select tree node if space is clicked the selected node gets opened... how could I remove this event?

View 1 Replies

Actionscript 3 :: Add Parameters In Alert Event Listener In Flex?

Feb 28, 2011

I know I can create a custom event and associate data with it and retrieve it in respective Event Listener. But What I am interested to know is, is there a short method (without having to extend Alert Event Class) to associate parameters to its alert Listener.

View 2 Replies

Flex :: Default Button Switcher By Using Event Listener?

Jul 29, 2011

make the nearest button to the clicked text input default. For this purpose, I wrote the below code.

why is my buttonSwitcher function following behind the MouseEvent.CLICK?

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="addListeners()">
<mx:Script>

[Code]....

View 1 Replies

Flex :: Add Event Listener To Components Inside A Repeater

Oct 11, 2011

I want to add an event listener to each component inside a repeater, but don't know how. Here's some code I have tried:

<mx:Repeater id="rp" dataProvider="{dataProvider}" width="100%">
<mx:Button id="attach" creationComplete="addListeners(attach[rp.currentIndex])"/>
</mx:Repeater>

This doesn't work. creationComplete is not called until the repeater has finished instead of (as I expected) when the creation of the button is complete. I'm not sure how to accomplish this.

BTW - I also tried placing the creationComplete on the parent component to the repeater, but it would only be called the first time the component was rendered (the data inside the repeater sometimes changes) so that didn't work.

View 1 Replies

Flex 3.5 :: Flash HSlider Event Listener Not Triggered When Value Is Updated

Aug 16, 2010

I am writing a web application that will serve as a configuration for a random data generator that I have written in Java.The values that I set in this application will write to xml. The xml data is updated by a file called simulationParams.as and that file is added to each child in the "viewStack" so that when I change any of those values the simulationConfig file will be automatically updated.The problem is that when I press the randomizeBtn the proper events are fired and the listeners grab those events.My problem exists when I uncheck the randomize button.For some reason an event is triggered or the listener isnt listening so that when I uncheck randomizeBtn the values go back to their last position or value on the slider. Ex. if my initial value is 0 then press randomize the slider will go to 100. The config file updates and all is well.When I uncheck the randomizeBtn, the sliders value goes back 0 but the config file isnt update.The same thing happens when I press the useDefaultBtn for both selected/unselected, nothing gets updated.[code]

View 1 Replies







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