2 Replies Latest reply on Oct 26, 2007 8:36 AM by brycebarrand

    Any way to use "_url" from AS2 in Flex?

      I just want to read the vars that get passed in through the url to my Flex app. If it was AS2, I would have just used the "_url" property, but thats been removed in AS3.

      Does anyone know how to do this?
        • 1. Re: Any way to use "_url" from AS2 in Flex?
          ntsiii Level 3
          Those values come in on the "parameters" object property of the Application:

          So from the Main app, if the url is ...mySwf.swf?myUrlProperty=whatever
          var sMyUrlProperty:String = this.parameters.myUrlProperty;
          trace(sMyUrlProperty); //shows "whatever"

          Note that those parameters have to be on the swf, not the html wrapper. To handle url vars on the wrapper needs a bit of javascript to send them on the the swf.
          • 2. Re: Any way to use "_url" from AS2 in Flex?
            brycebarrand Level 1
            Thanks Tracy.
            I ended up using the loaderInfo object. Here is the init() method that gets called on applicationComplete

            private function init():void

            the tricky part for me was that I was using creationComplete, and the loader object was null, so creationComplete must get called before applicationComplete. Because when I just changed it to applicationComplete, I was able to use the loaderInfo. Hopefully this will help somebody else.