Hi Jan,

You can define a variable in TestPage.mxml and then assign it a value
as a property of TestPage in your main application. Example below
passes a String object.

- Doug


TestPage.mxml:

<mx:Form ...>
        <mx:Script>
            public var myVar: String;
        </mx:Script>
        ...
        <mx:Label text="{myVar}"/>
        ...
</mx:Form>

Main.mxml:

<mx:Application ...>
        ...
        <mx:XML id="my_xml" .../>
        <mx:ViewStack id="pages">
                <TestPage id="test_page" myVar="{my_xml.someString}"/>
        </mx:ViewStack>
</mx:Application>


--- In [email protected], "Jan L. Nauta" <[EMAIL PROTECTED]> wrote:
>
> Hi,
> 
> I have a mx:XML component in the 'application' mxml file that I want to
> access from another mxml file, how do I do that? The other mxml is a
form
> that's part of a viewstack in the 'application' mxml file:
> 
> Main.mxml:
> 
> <mx:Application ...>
>       ...
>       <mx:XML id="my_xml" .../>
>       <mx:ViewStack id="pages">
>               <TestPage id="test_page" label="Test"/>
>       </mx:ViewStack>
> </mx:Application>
> 
> TestPage.mxml:
> 
> <mx:Form ...>
>       ...
>       <mx:Label text="{my_xml....}"/>
>       ...
> </mx:Form>
> 
> Regards,
> 
> Jan L. Nauta
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to