2 Replies Latest reply on Apr 26, 2010 5:53 AM by flexu

    HttpService only works on local!?

    GRY086

      Hello, I need help.  I've built  a simple datagrid, it is populated by an httpservice who is called on creation complete.

       

      when I click the the run Main option, in Flex Builder, it runs no problem. When I upload the bin release, it does not populate.  Is there some setting I don't know about?

       

       

       

       

       

       

      ============

      CODE

      ============

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600"
                     backgroundColor="#0B0101" width="1080" height="612"
                     creationComplete="send_data()">
         
         
          <fx:Style source="Main.css"/>
         
         
          <fx:Declarations>
              <!-- Place non-visual elements (e.g., services, value objects) here -->
             
              <s:HTTPService id="userRequest" url="http://theServer.com/scripts/xml_output.php" useProxy="false" method="POST">

       

              </s:HTTPService>
             
          </fx:Declarations>
         
          <fx:Script>
              <![CDATA


                  import mx.controls.Alert;
                 
                  private function send_data():void
                  {
                      userRequest.send();
                  }
                 
                  private function onClick() :void
                  {
                     
                         
                          if( grid.selectedIndex==-1 )
                          {
                         
                          }   
                             
                          else
                          {       
                             
                              body.visible=true;
                              varPass.text=grid.selectedItem.ID;
                              title.text=grid.selectedItem.name;
                              desc.text=grid.selectedItem.description;
                              cred.text=grid.selectedItem.price;
                              grid.selectedIndex=-1;
                          }
                  }

       

                  protected function button1_clickHandler(event:MouseEvent):void
                  {
                     
                  }
                 
              ]]>
          </fx:Script>
         
         
          <mx:DataGrid id="grid" click="onClick()"  x="37.2" y="63.3" width="895" height="450" dropShadowVisible="false" dataProvider="{userRequest.lastResult.courses.course}" chromeColor="#2240C0" fontSize="20" color="#070202" fontWeight="bold" verticalAlign="top" textAlign="center" enabled="true" paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10">
              <mx:columns>
                  <mx:DataGridColumn sortable="false" dataField="ID" width="0" visible="false"/>
                  <mx:DataGridColumn sortable="true" headerText="Course" dataField="name"   width="90"/>
                  <mx:DataGridColumn headerText="Subject" dataField="subject" resizable="false" width="90"/>
                  <mx:DataGridColumn visible="false" wordWrap="true" sortable="true" width="250" headerText="description" dataField="description" />
                  <mx:DataGridColumn sortable="true" headerText="price" dataField="price" width="90"/>
              </mx:columns>
          </mx:DataGrid>
         
          <s:BorderContainer id="body" visible="false" x="107" y="92" width="853"   height="505" backgroundColor="#4D50CA"  dropShadowVisible="true" cornerRadius="20" borderWeight="8" borderAlpha="0.43" borderVisible="true">
              <s:Label x="41" y="21" text="Title" width="645" height="70" fontSize="28" fontWeight="bold" fontFamily="Times New Roman" color="#F8F2F2" textDecoration="underline" id="title"/>
              <s:Label x="268" y="111" text="Label" width="464" height="274" fontSize="16" color="#FEFDFD" backgroundColor="#9C99D4" id="desc" paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10" fontWeight="bold"/>
              <s:Button click="body.visible=false;" x="642" y="421" label=" X" width="54" height="45" id="Close" chromeColor="#F21212" focusColor="#F81828" color="#FEF8F8" fontSize="21" fontWeight="bold"/>
              <s:Button x="557" y="422" label="YES" width="58" height="44" fontWeight="bold"   click="button1_clickHandler(event)"/>
              <s:Label x="321" y="421" width="173" height="48" backgroundColor="#778CD2" color="#FCF8F8" fontWeight="bold" id="cred" paddingLeft="20" paddingRight="10" paddingBottom="10" paddingTop="20" fontSize="21"/>
              <s:Label x="321" y="421" visible="false" id="varPass" />
             
              <mx:LineChart x="10" y="136" id="linechart1" width="235" height="155">
                  <mx:series>
                      <mx:LineSeries displayName="Series 1" yField=""/>
                  </mx:series>
              </mx:LineChart>
              <mx:Legend dataProvider="{linechart1}" x="29" y="71"/>
         
         
          </s:BorderContainer>

       

         
         
      </s:Application>