Oh, yeah that might not work on a popup.
Can you just pass the component through to the first TitleWindow like the
example does and then when it pops the 2nd TitleWindow do the same
thing? Otherwise you probably have to walk down from the top to reach it,
Application.application.comp1.comp2…
Matt
From: stevenkeys2003
[mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 30, 2005
6:25 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re:
referencing id in parent titlewindow from another titlewindow?
Matt, tried out parentDocument with no luck.
syntax?
The scenario I'm trying to replicate, but in a
different way, comes
from livedocs. The major difference being I'm not
starting on the main
app level, but from a different TitleWindow.
code from livedocs:
-----------------------------------------------
Passing data to a pop-up TitleWindow container
To make the custom component that defines your
TitleWindow container
more flexible, you might want to pass data to it
or return data from
it. For example, the following application opens a
pop-up TitleWindow
container and passes to it a reference to a
component in the
Application container so that the custom component
can write its
results back to the container:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script>
<![CDATA[
import mx.containers.TitleWindow;
import mx.core.Application;
function showName()
{
var pop1:TitleWindow =
TitleWindow(popupWindow(MyLogin_passdata,
{title:'Enter Name', closeButton:true, parentComponent:
this.TA1}));
}
]]>
</mx:Script>
<mx:VBox width="300"
height="500">
<mx:Button click="showName()"
label="Enter name" />
<mx:TextArea
id="TA1" />
</mx:VBox>
</mx:Application>
The custom component in the following example
defines a variable to
hold the reference to the parent component, then
uses that reference
to update the parent component:
<?xml version="1.0"?>
<mx:TitleWindow xmlns:mx="http://www.macromedia.com/2003/mxml"
click="deletePopUp()">
<mx:Script>
<![CDATA[
var parentComponent;
function
submitData()
{
parentComponent.text="You entered: " + inputText.text;
}
]]>
</mx:Script>
<mx:VBox>
<mx:Label
text="Enter your name" />
<mx:TextInput
id="inputText" width="100"/>
<mx:Button
label="Send Data" click="submitData();
this.deletePopUp();" />
</mx:VBox>
</mx:TitleWindow>
---------------------------------------
Now, in my case this doesn't work of course,
because I'm starting from
a TitleWindow. If someone can provide some code
examples of one
TitleWindow changing props of a container in
another TitleWindow.. or
doing anything.. it'd be much appreciated. I need
two TitleWindows to
talk to one another, and have so far been
unsuccessful.
-Steve
--- In flexcoders@yahoogroups.com, Matt Chotin
<[EMAIL PROTECTED]> wrote:
> I think parentDocument is what you're looking
for.
>
>
>
> Matt
>
>
>
> _____
>
> From: stevenkeys2003 [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, March 29, 2005 11:42 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] referencing id in
parent titlewindow from another
> titlewindow?
>
>
>
>
> Guys,
> I'm launching a titleWindow from another
titleWindow. I need to
> reference id of container in parent
titleWindow. How?
>
> I've done this with components, but unable to
figure this one out when
> it comes to titleWindow referencing another
titleWindow..
>
> i've tried _parent, _root,
mx.core.Application.application ... how do
> I talk backwards to id in parent in this
situation?
>
> -Steve
>
>
>
>
>
>
>
>
>
> Yahoo! Groups Sponsor
>
>
>
> ADVERTISEMENT
>
>
<http://us.ard.yahoo.com/SIG=129f3en04/M=298184.6018725.7038619.3001176/D=gr
>
oups/S=1705007207:HM/EXP=1112211794/A=2593423/R=0/SIG=11el9gslf/*http:/www.n
> etflix.com/Default?mqso=60190075> click
here
>
>
>
>
<http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S=
> :HM/A=2593423/rand=725107526>
>
>
>
> _____
>
> Yahoo! Groups Links
>
> * To visit your
group on the web, go to:
> http://groups.yahoo.com/group/flexcoders/
> <http://groups.yahoo.com/group/flexcoders/>
>
> * To
unsubscribe from this group, send an email to:
> [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>
>
> * Your use of
Yahoo! Groups is subject to the Yahoo!
> <http://docs.yahoo.com/info/terms/>
Terms of Service.
Yahoo! Groups Sponsor |
ADVERTISEMENT
| |
|
Yahoo! Groups Links