Event, target null, currentTarget undefined

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Event, target null, currentTarget undefined

hiedra

Hi, see if anyone can help me ...

 

I have a MyEvent event that I launch from a MyView view (MVC):

 

public function SecurityEvent(type:String)

{

super(type, true, true);

            //_targetViewPopup = target;

}

 

 

var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);

dispatchEvent(mEvent);

 

I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.

I have debugged and I do not see any property or variable that contains this data.

Where can I get it? Any method?

 

I would appreciate any help.

Thank you all.

 

Hiedra.

 

Reply | Threaded
Open this post in threaded view
|

RV: Event, target null, currentTarget undefined

hiedra

Sorry, there was an error ... (when renaming for the example)

 

 

public function MyEvent(type:String)

{

super(type, true, true);

            //_targetViewPopup = target;

}

 

----------------------------------------------------------------

 

Hi, see if anyone can help me ...

 

I have a MyEvent event that I launch from a MyView view (MVC):

 

public function SecurityEvent(type:String)

{

super(type, true, true);

            //_targetViewPopup = target;

}

 

 

var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);

dispatchEvent(mEvent);

 

I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.

I have debugged and I do not see any property or variable that contains this data.

Where can I get it? Any method?

 

I would appreciate any help.

Thank you all.

 

Hiedra.

 

Reply | Threaded
Open this post in threaded view
|

Re: Event, target null, currentTarget undefined

Harbs
The event target is set when the event is dispatched.

You can’t save the target in the constructor because it does not exist yet.

If you are not getting the target in an event handler, please provide some more code to show the issue.

HTH,
Harbs

On Dec 26, 2019, at 12:57 PM, Maria Jose Esteve <[hidden email]> wrote:

Sorry, there was an error ... (when renaming for the example)
 
 
public function MyEvent(type:String)
{
super(type, true, true);
            //_targetViewPopup = target;
}
 
----------------------------------------------------------------
 
Hi, see if anyone can help me ...
 
I have a MyEvent event that I launch from a MyView view (MVC):
 
public function SecurityEvent(type:String)
{
super(type, true, true);
            //_targetViewPopup = target;
}
 
 
var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);
dispatchEvent(mEvent);
 
I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.
I have debugged and I do not see any property or variable that contains this data.
Where can I get it? Any method?
 
I would appreciate any help.
Thank you all.
 
Hiedra.
 

Reply | Threaded
Open this post in threaded view
|

RE: Event, target null, currentTarget undefined

hiedra

Ok, it makes sense, I try to capture it in the controller and I tell you

 

Thank Harbs

 

De: Harbs [via Apache Royale Users] <ml+[hidden email]>
Enviado el: jueves, 26 de diciembre de 2019 14:12
Para: Maria Jose Esteve <[hidden email]>
Asunto: Re: Event, target null, currentTarget undefined

 

The event target is set when the event is dispatched.

 

You can’t save the target in the constructor because it does not exist yet.

 

If you are not getting the target in an event handler, please provide some more code to show the issue.


HTH,

Harbs



On Dec 26, 2019, at 12:57 PM, Maria Jose Esteve <[hidden email]> wrote:

 

Sorry, there was an error ... (when renaming for the example)

 

 

public function MyEvent(type:String)

{

super(type, true, true);

            //_targetViewPopup = target;

}

 

----------------------------------------------------------------

 

Hi, see if anyone can help me ...

 

I have a MyEvent event that I launch from a MyView view (MVC):

 

public function SecurityEvent(type:String)

{

super(type, true, true);

            //_targetViewPopup = target;

}

 

 

var mEvent:MyEvent = new MyEvent (MyEvent.ON_CHANGE);

dispatchEvent(mEvent);

 

I need to save the reference to the view that generated the event, the target, but I don't get it: target is null and currentTarget is undefined.

I have debugged and I do not see any property or variable that contains this data.

Where can I get it? Any method?

 

I would appreciate any help.

Thank you all.

 

Hiedra.

 

 

 


If you reply to this email, your message will be added to the discussion below:

http://apache-royale-users.20374.n8.nabble.com/Event-target-null-currentTarget-undefined-tp3149p3151.html

To start a new topic under Apache Royale Users, email [hidden email]
To unsubscribe from Apache Royale Users,
click here.
NAML