views:

84

answers:

1

I created separate own canvas component for Home page, Contact page, Rules page etc. In my main application it has link button like Home,Contact,Rules in application controller(child state) .

 <?xml version="1.0" encoding="utf-8"?><mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="903" height="508" backgroundImage="@Embed(source='image/mainbackground.png')">
<mx:label x="483" y="166" label="Welcome to our site"/>
<mx:DateChooser x="229" y="166"/>

If you click home button then show homepage canvas. How can i Implement? or refer me any url for study

+2  A: 

Between the script tags

   public static const HOME:Number = 0;
   public static const CONTACT:Number = 1;

You can use a viewstack to display different views and myStack.selectedIndex is just a number but I like it more to do this with a static value so you only have to change it on one place if something changes

<mx:LinkButton label="home" click="{myStack.selectedIndex = HOME}"/>

<mx:ViewStack id="myStack" creationPolicy="auto" width="100%" height="100%">
       <view:Home/>
       <view:Contact/>
</mx:ViewStack>
Arno
Woow it's working ,thanks Arno . But i have submenu also . if i used viewstack then Main menu only working . How can i set for submenu ?will i set viewstack for submenu . At that Two viewstack overwrite single page
R.Vijayakumar