ActionScript 3.0 :: Why Isn't Event Received
Apr 1, 2009Main class:
[Code]...
Main class:
[Code]...
ActionScript 3, just learning AS3 but know a handful of other languages. What would cause an event that the listen call executes without throwing an error and was successfully dispatched, to not be listened to?
Dispatch call (this runs ):
private function HandleMouseClick( e:Event ):void{
if ( m_MouseState == MOUSE_STATE_SELECTED )
m_MouseState = MOUSE_STATE_NONE;
else {
m_MouseState = MOUSE_STATE_SELECTED;
[Code] .....
The "Squares" are childed to a checkerboard that is childed to my main app ( which extends sprite ). the checkerboard displays and has all the behaviour I want, but when I click a square, the click event fires and dispatches the custom event, but the custom event is never received. That should be all code needed, the rest of the code is just to create a grid and put random numbers in the squares, which works fine. According to every website that has a "custom event tutorial" it would appear that i have everything needed to listen to the event, its just not happening.
I'm attempting to use a custom event and cant figure out what I'm doing wrong.The event just doesn't seem to be either triggering or received.I borrowed the code from the internet, but I only know enough about custom events to sort of figure out what the code is doing.I have a movieclip inside of another movieclip.I need to close the child movieclip when a button on the child mc is pressed.I'm attempting to listen for a custom "close button clicked" event on the parent mc.[code]again...the event just never happens.I never see the output of the trace in the parent movieclip.I do see the output of the trace "OK button pressed" from the child movieclip though.
View 1 RepliesI am writing test cases to test function with flexunit 4. I am using aysnc method.
But when I add two or more asyncHandlers to the instance. I meet the problem: Error: Asynchronous Event Received out of Order.
Code snippets:
[Test(order=1, async, description="synchronize content on line")]
public function testSynchronizeContentOnline():void
{
var passThroughData:Object = new Object();
[Code].....
I get the webservice(spring WebService) response properly ,but the event.result object is null.I can see the SOAP response body in the event.message.body variable.
## Soap Response ##
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/><SOAP-ENV:Body><getUserUserTasksResponse xmlns="http://ws.burr.com/BurWS/9_0">
<foundTasks>
[code]...
I have a custom event that is dispatched when a slider is moved but I receive no event from inherited dispatcher class I created whereas I followed the same syntax as solution for My flash custom event doesn't trigger
[Code]...
I have written a php code to echo a string of all the fields' contents of a table (select * from x) now I want flash to display the table in a flash move. website where I can find a tutorial on how to receive and parse such string?
View 2 RepliesI have this really weird problem. I'm making several calls to different php files (located on another server with crossdomain.xml changed so that it is allowed) and need to receive some response back in flash and work with the data received.The first call is done by the following code:
ActionScript Code:var urlRequest:URLRequest = new URLRequest("http://otherserver.com/assign.php");
var loader2:URLLoader = new URLLoader();
[code].....
I'm guessing the answer to my question is no, and the solution lies in the hitTest method. But just to be sure . . . if I create a new movie clip and then drag that movie clip over other movie clips that have MOUSE_OVER listeners is there anyway that those clips will get the mouse over?
View 3 RepliesI have got question,after extracting data from datagrid i want it to form into xml, and trace it in output window, in a shape like this:
[Code]...
I have an Air application with remote service in codeigniter.I'm trying to save a bytearray that I received from the Air app but when I save the data I get empty files with the correct filename.So there must be something wrong with my bytearray or the way I save the data.Does anyone have an idea what I'm doing wrong?I've debugged the Arraycollection I sent and the bytearray is definitely in there.
public function uploadImage($image)
{
foreach($image as $img)
[code].....
I�m trying change the value of a main timeline variable, properly a string variable, the new value is being sent from another flash file through LocalConnection, the receiver main timeline code is:
Code:
stop();
var menuactivo:String;
fscommand("allowscale", "false");
[code]....
So, as you see in the code, I need to refresh the value of the menuactivo variable using the value received at the LocalConnection onRecibir method, how do I do this?? am using a couple of dynamic texts in order to display the value received and to see if the value of menuactivo changes when my_str is received, but I just can�t refresh the value of menuactivo?
I'm making several calls to different php files (located on another server with crossdomain.xml changed so that it is allowed) and need to receive some response back in flash and work with the data received.
The first call is done by the following code:
PHP Code:
var urlRequest:URLRequest = new URLRequest("http://otherserver.com/assign.php");
var loader2:URLLoader = new URLLoader();
function selectHandler(event:Event):void
[Code]....
After the button is pressed and the php call is made, the completeHandler function is never called. But when I test it in Firefox (I have Firebug installed), it shows me that the call is made i.e:
[URL]
In PureMVC / ActionScript, after sending out notifications using send Notification or notify-observers, how do I make sure all the observers has received the notification and finished the work?On the other words, is sendNotification in synchronized way.
View 1 RepliesIf you write a simple object to a socket:
var o:Object = new Object();
o.type = e.type;
o.params = e.params;
_socket.writeObject(o);
_socket.flush();
Then on the client do you simply use:
private function onData(e:ProgressEvent):void
{
var o:Object = _clientSocket.readObject();
}
Or do you have to implement some way of checking all of the data has been received recieved before calling .readObject()
I'm creating a website for a friend which it's being made using Dynamic Texts (he wants different switchable languages).Problems come when submitting the Form... I've used the same Form model (formmail) for other websites which did not use any Dynamic Text and they worked without problems.
The exact problem is that the submitted Form is not received (don't think it's even sent) to the specified email address. However, if the same website does not contain any dynamic text, then the form works properly and the query is received at my mailbox.
i have the actionscript to allow an object to be manipulated by the sound received in the microphone:
m = Microphone.get();
attachAudio(m);
m.setUseEchoSuppression(false);
onEnterFrame = function () {
circle._xscale = circle._yscale = m.activityLevel+50;
};
but i need the script to allow the function that when sound is made it triggers a jump to a different frame.
I'm using a datagrid to display data received from an AMFPHP function. Here is a pared down version of this:
[Code]...
It's a bit vague - the whole thing with AMF. On one hand we have a client capable of serializing and sending everything from integers to XML documents and ByteArray streams, but on the other hand we have the FMS with a JavaScript host. Where is the bridge? :-) I mean how does one work with the objects, in particular, a ByteArray, received through the [generic] wire? It's easy with numbers and strings, but no word on more complex objects.
View 2 RepliesI have got a problem with my actionscript class. This is my code:
package {
import flash.display.MovieClip;
public class Main extends MovieClip
{
public function Main()
[Code]...
I'm having a problem to receive data from socket.io to Flash (actionscript).
I've tried:
Server (nodejs) socket.io :
var io = require('socket.io').listen(9000);
setInterval(function() {
[Code]....
Flash connects succesful to the server and trace "Connected to flash" but it cannot receive data.
I have a server written in C# (Visual C# .NET Framework), that I know for a fact works. When I run my Flash application, I am able to connect to the server (the server shows the message that a connection has been made), but I can't for the life of me get data to be received by the Flash application.
[Code]...
Im trying to pass the metadata information received in the following code to another class. The below code generates a trace response of 162... so I am receiving the data I just need to be able to call the totalLength variable from another class with the same response of 162. I know this should be relatively easy...
package com.bit.net
{
import flash.events.Event;
import flash.events.EventDispatcher;
[code]....
I have a display object that is set to mask another display object. I add a mouseEvent listener to the mask to listen to mouse events. It does not receive the mouseEvent unless I set its buttonMode property to true.
If the display object is not a mask, it receives mouseEvents with its buttonMode set to false.
Here is some fast example code. On the stage I have a circle that masks a square. if buttonMode of the mask is set to false, it won't receive mouseEvents.
Code:
circle.addEventListener(MouseEvent.CLICK, onClick);
square.mask = circle;
//if I set buttonMode = false, the mask (circle) won't respond to clicks.
circle.buttonMode = true;
[Code]....
I am trying to build my first CRUD application and cant get the update query to work. Here is the MXML and AS.
[Code]....
I want to replace "bad characters" in a text string received from an XML document but the replaced text seems to be undefined inside the for loop.
ActionScript Code:
for ( var i:Number = 0; i < l; i++ )
{[code]....
I received this error when i am trying to create a platform game. I cant manage to figure it out.[code]...
View 2 RepliesI've been making a simple RSS reader flash widget for my webpage. It works perfectly when I test it locally, but when I publishit, I always get the No.Data.Received error. I've played with allthe parameters on the XMLConnector and all the publish settings,but no dice.The only thing that I can think of is that I'm loading RSSfrom a different site, but it isn't restricted in any way.
View 2 RepliesI have editable grids which are 2-way binded to my model. What I want is to validate my data when user edits any cell before it get updated in model. I have applied my validation at ItemEditEnd handler, but, I want to apply validation in between itemEditBegin and itemEditEnd events.
View 1 RepliesI 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].....