6 Replies Latest reply on May 14, 2007 6:38 PM by splitzer

    how to get url parameters?

    splitzer
      Hi,
      I tried to implement the sample provided in help section of flex, but for some reason it wont work. Isnt there a easier way to get url variables in flex? Also, the problem is that i already have funtion which is being called by creationComplete, how can i implement another function which is this initVars()?

      <?xml version="1.0"?>
      <!-- wrapper/ApplicationParameters.mxml -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" creationComplete="initVars()">
      <mx:Script><![CDATA[
      // Declare bindable properties in Application scope.
      [Bindable]
      public var myName:String;
      [Bindable]
      public var myHometown:String;

      // Assign values to new properties.
      private function initVars():void {
      myName = Application.application.parameters.myName;
      myHometown = Application.application.parameters.myHometown;
      }
      ]]></mx:Script>

      <mx:VBox>
      <mx:HBox>
      <mx:Label text="Name: "/>
      <mx:Label text="{myName}" fontWeight="bold"/>
      </mx:HBox>
      <mx:HBox>
      <mx:Label text="Hometown: "/>
      <mx:Label text="{myHometown}" fontWeight="bold"/>
      </mx:HBox>
      </mx:VBox>
      </mx:Application>

      Thank you,
      Syed