4 Replies Latest reply on Jun 8, 2008 10:12 PM by Muthu_cool

    Plz reply for it

    Muthu_cool
      Hi,
      I am new to flex can any one tell me how to go from one page to another page using LinkLabel Button. Waiting for your reply.


      Thankyou

      Regards
      Muthu
        • 1. Re: Plz reply for it
          John Hall Level 4
          Actually, Flex isn't based on pages like ToolBook or Hypercard or whatever. It's based more on states representing views of information. Why don't you tell us what you're trying to accomplish and maybe we can contribute. For instance, you can have something like pages with viewStacks and tabNavigators but it would be most helpful to get more details on what you want the user to see at your site.
          • 2. Re: Plz reply for it
            sakura102384 Level 1
            Here's a simple example of linking to another page using linkButton:

            <mx:script>
            public function GoTo(event:MouseEvent):void {
            var u:URLRequest = new URLRequest(" http://yourSite.com");
            navigateToURL(u,"_self");
            }
            </mx:script>

            <mx:LinkButton id="lb1" click="GoTo(event)/>

            Hope it can help.
            • 3. Re: Plz reply for it
              Gregory Lafrance Level 6
              I would use a ViewStack:

              ------------------------------ ViewStack.mxml -------------------------------
              <?xml version="1.0"?>
              <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns:comp="components.*">
              <mx:Script>
              <![CDATA[
              private function selectPortal(event:Event):void {
              if(cmbx.selectedItem.data == "home"){
              portals.selectedChild = home;
              }
              if(cmbx.selectedItem.data == "hr_portal"){
              portals.selectedChild = hr_portal;
              }
              if(cmbx.selectedItem.data == "is_portal"){
              portals.selectedChild = is_portal;
              }
              if(cmbx.selectedItem.data == "pay_portal"){
              portals.selectedChild = pay_portal;
              }
              }
              ]]>
              </mx:Script>

              <mx:ApplicationControlBar width="100%">
              <mx:Label text="Select an intranet portal: " fontSize="12"/>
              <mx:ComboBox id="cmbx" change="selectPortal(event)">
              <mx:Object label="XYZ Intranet Home Page" data="home"/>
              <mx:Object label="Human Resources Portal" data="hr_portal"/>
              <mx:Object label="Information Services Portal" data="is_portal"/>
              <mx:Object label="Payroll Portal" data="pay_portal"/>
              </mx:ComboBox>
              </mx:ApplicationControlBar>
              <mx:ViewStack id="portals" width="100%" height="100%">
              <mx:Panel width="100%" height="100%" horizontalAlign="center"
              backgroundColor="#ccffcc" id="home">
              <mx:Text text="Welcome to the XYZ Corporate Intanet" fontSize="20"
              color="blue"/>
              </mx:Panel>
              <comp:HumanResources id="hr_portal"/>
              <comp:InformationServices id="is_portal"/>
              <comp:Payroll id="pay_portal"/>
              </mx:ViewStack>
              </mx:Application>
              ------------------------------------------------------------------------------------
              ---------- components/HumanResources.mxml ------------------
              <?xml version="1.0" encoding="utf-8"?>
              <mx:Panel xmlns="*" xmlns:mx=" http://www.adobe.com/2006/mxml"
              width="100%" height="100%" horizontalAlign="center" backgroundColor="red">
              <mx:Text text="Human Resources Portal" fontSize="20"
              color="blue"/>
              </mx:Panel>
              ------------------------------------------------------------------------------------
              ---------- components/InformationServices.mxml ------------------
              <?xml version="1.0" encoding="utf-8"?>
              <mx:Panel xmlns="*" xmlns:mx=" http://www.adobe.com/2006/mxml"
              width="100%" height="100%" horizontalAlign="center" backgroundColor="purple">
              <mx:Text text="Information Services Portal" fontSize="20"
              color="blue"/>
              </mx:Panel>
              ------------------------------------------------------------------------------------
              ---------- components/Payroll.mxml ------------------
              <?xml version="1.0" encoding="utf-8"?>
              <mx:Panel xmlns="*" xmlns:mx=" http://www.adobe.com/2006/mxml"
              width="100%" height="100%" horizontalAlign="center" backgroundColor="gray">
              <mx:Text text="Payroll Portal" fontSize="20"
              color="blue"/>
              </mx:Panel>
              • 4. Re: Plz reply for it
                Muthu_cool Level 1
                Hi,
                Thankyou Greg.

                Regards
                Muthu