He's surprised that the popup isn't parented by the app.  Popups are
parented by the systemMgr which also parents the app.

 

Id's are per-document (or per-mxml file) so you can traverse documents
and pull objects by their ids.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Gordon Smith
Sent: Tuesday, August 12, 2008 7:54 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] AS 3.0 event target problem!!!

 

What do you mean by "I don't have the path to the root"?

 

If you assign an id to each component, the toString() method will use
that instead of a dynamically generated name like Button498.

 

Gordon Smith

Adobe Flex SDK Team

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of zoran_101
Sent: Tuesday, August 12, 2008 4:30 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] AS 3.0 event target problem!!!

 

I have an interesting problem regarding event.target in Flex 
2/ActionScript 3.0. I am using the Flex Grocer app in order to try 
something out. I am attaching listeners to all the click events and 
then printing out event.target to keep track of my events and where 
we clicked, nothing revolutionary here very easy stuff. Once I get 
the paths I would like to run code that will execute my steps and 
play the clicks back based on the event.target information that I got 
and I was able to do that except when we have popups. Here is the 
problem:

When I execute a click on a button with event.target =
DataEntry0._UpdateDeleteProd1.Form10.FormItem102.HBox103.Button104 
A poupup appears and then I click on the close button on that popup 
with event.target=
ConfirmScreen464.UIComponent494.Button498

COUPLE OF PROBLEMS HERE:
1) I don't have the path to the root (DataEntry0) even though I 
use the standard event.target.
2) This is even a bigger problem, the DOM path 
(ConfirmScreen464.UIComponent494.Button498) is dynamically generated 
(the numbers are dynamically generated) so when I use that path that 
I got during the time I was monitoring the app, when I use my code to 
play the events that very same target does not correspond to the 
popup that the fist event caused. 

I tried using IDs but in Flex I have not found anything like 
document.getElementById() that is available in JavaScript. Any help 
on this will be greatly appreciated.

Thanks

p.s. I looked at the automation library that Flex has (and Mercury 
QTP uses) but that will not work for me.

 

Reply via email to