4 Replies Latest reply on Oct 5, 2006 3:00 PM by GeorgeWS

    using application parameters object

    leotemp Level 1
      Sigh.. ok so another help doc that doesnt work even when its copied and pasted. I am trying to use the Application.application.parameters object and after a few erros i discovered that i have to import "mx.core.Application" which wasnt in the help file, but even after that i can not get any data out of the strings that are supposed to by containing my parameters. Im not sure if im just daft or what but here is the simple app source, im just trying to write one of the strings to a label:

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Label x="10" y="10" text="Domain"/>
      <mx:Label x="23" y="23" text="{sysDomain}"/>
      <mx:Script>
      <![CDATA[
      import mx.core.Application;
      import flash.net.URLRequest;

      [Bindable]
      public var sysDomain:String;
      [Bindable]
      public var sysData:String;

      function initApp() {
      var sysDomain:String = Application.application.parameters.sysDomain;
      var sysData:String = Application.application.parameters.sysData;
      }
      ]]>
      </mx:Script>
      </mx:Application>


      --HTML-PARAMS-IN-FLEX-RENDERED-HTML-FILE---
      <param name="flashvars" value="sysDomain=test.com&sysData=test.mdf">

      thanks in advance!
        • 1. Re: using application parameters object
          inlineblue Level 1
          Mmm, ya... The docs are outdated again. The part at the bottom of the generated html wrapper is for when javascript is disabled. You'll notice that there's a mess of javascript above it. You should put your flashvars there as well. Look for these two lines:

          "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"" ,

          "flashvars",'historyUrl=history.htm%3F&lconid=' + lc_id + '',

          Both of these lines have a +"" at the end. Stick your variables in between the blank quotes. Make sure to start with a &.

          At least that's how I've been doing it, anyway...
          • 2. Re: using application parameters object
            GeorgeWS Level 1
            How does the flashVars get to a CFC so the Remote Object can return data that refers to the variable. As in test.cfm?SupplierID=3
            I want that to go to the wrapper and into my Flex app that calls a CFC I cant get the variable over to the CFC. If i put a 3 in the CFC for the supplierID it works. What could be happening. I have the SupplierID=#SupplierID# in the AC_FL_RunContent part and in the object tag also the embed tag. I know the variable gets to the flex app just not back out to the CFC.

            Thanks
            • 3. Re: using application parameters object
              leotemp Level 1
              im not familiar with cold fusion but cant you use an HTTPservice to send the parameters to a script?
              • 4. Re: using application parameters object
                GeorgeWS Level 1
                Thanks,
                But I want to use the RO because of the supposed faster through put. I need it due to the amount of data Im retrieving. Besides I really only know about ColdFusion. Flex and Cold Fusion are supposed to work great together, I just cant find any real world working eamples that are not cluttered with stuff that does not apply to communication. This should be sooooo easy.

                test.cfm?SupplierID=3

                goes to my MXML the RO picks it up in an argument using Application.application.parameters.SupplierID

                Sends the variable to the CFC and returns the data that is related to SupplierID of 3

                Thanks though