时间线

My Life My Style

How to change ViewStack from we custom components

ViewStack Code:
==================
……
<mx:ViewStack  id="viewstack1" width="100%" height="100%">
        <custom:No1View id="No1View"/>
        <custom:No2View id="No2View"/>
        <custom:No3View id="No3View"/>
</mx:ViewStack>
……

Custom Component Code:
==================
……
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:Button label="Show Next ViewStack" click="this.parentApplication.viewStack1.selectChild  =
this.parent.viewStack1.No1View;"/>
    <!–
        or try this code:
         parentApplication.viewStack1.selectedChild  =
parentApplication.No1View;
    –>

</mx:Canvas>
……

发表评论

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Connecting to %s

加关注

Get every new post delivered to your Inbox.