Hi Alex - thanks for your replies, I think my last message was slightly
confusing, when I said application.localToGlobal I actually meant the
child application. Here is a quick run down of the code I'm currently
using:
public function show(popupParent:UIComponent):void
{
if (!m_shown)
{
m_popupParent = popupParent;
var
blur:Blur = new Blur(m_popupParent);
blur.blurXFrom = blur.blurYFrom = 0;
blur.blurXTo
= blur.blurYTo = 3;
blur.duration = 100;
blur.play();
PopUpManager.addPopUp(this, m_popupParent);
m_shown =
true;
}
}
public function hide():void
{
if (m_shown)
{
PopUpManager.removePopUp(this);
var
blur:Blur = new Blur(m_popupParent);
blur.blurXFrom = blur.blurYFrom = 3;
blur.blurXTo
= blur.blurYTo = 0;
blur.duration = 100;
blur.play();
for each
(var changeWatcher:ChangeWatcher in m_changeWatchers)
{
changeWatcher.unwatch();
}
m_popupParent = null;
m_shown =
false;
}
}
private function addedToStageHandler(event:Event):void
{
// We can't check the
m_shown property here because it hasn't been set yet!
if (m_popupParent !=
null)
{
var
xOffset:Number = this.parent.mouseX - m_popupParent.parent.mouseX;
var
yOffset:Number = this.parent.mouseY - m_popupParent.parent.mouseY;
this.x =
xOffset;
this.y =
yOffset;
//m_changeWatchers.push(BindingUtils.bindProperty(this, "x",
m_popupParent, "x"));
//m_changeWatchers.push(BindingUtils.bindProperty(this, "y",
m_popupParent, "y"));
m_changeWatchers.push(BindingUtils.bindProperty(this, "width",
m_popupParent, "width"));
m_changeWatchers.push(BindingUtils.bindProperty(this, "height",
m_popupParent, "height"));
}
}
To display the modal screen I do waitScreen.show(this) from within the
child application (therefore the child application is the popupParent
parameter).
this.parent = the main application's SystemManager
m_popupParent = the child application's SystemManager
I hope the code explains my situation a little better.
Much appreciated,
Mark
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: 20 September 2007 17:07
To: [email protected]
Subject: RE: [flexcoders] How to get screen coordinate from child
application
It wouldn't be app.localToGlobal it would be child.localToGlobal
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mark Ingram
Sent: Thursday, September 20, 2007 1:41 AM
To: [email protected]
Subject: RE: [flexcoders] How to get screen coordinate from child
application
Hi Alex, that's the first thing I tried, but unfortunately doing
application.localToGlobal(new Point(0, 0)) returns {0, 0}!
It's worth noting that the child application is loaded via SWFLoader.
Thanks,
Mark
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Harui
Sent: 19 September 2007 19:48
To: [email protected]
Subject: RE: [flexcoders] How to get screen coordinate from child
application
localToGlobal()
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mark Ingram
Sent: Wednesday, September 19, 2007 8:16 AM
To: [email protected]
Subject: [flexcoders] How to get screen coordinate from child
application
Hi, if I have an application within an application, how can I convert
coordinates from the child app to the parent app? I need to display a
popup window and if I use the x, y values from the child application,
they are set to zero, but when loaded into a parent app, they are
actually around 200, 200.
|-------------------------|
| Parent |
| |
| |----------| |
| | Child | |
| |----------| |
| |
| |
|-------------------------|
Both parent and child are flex apps. But the x,y values for child are
{0,0}. I want to popup a dialog which completely covers the child
application, from within the child app.
Any ideas?
Thanks,
Mark