Quantcast
Channel: Adobe Community : Popular Discussions - Using Flash Builder
Viewing all articles
Browse latest Browse all 70427

httpServices not working Online but working with Flash Builder

$
0
0

I am using Flash Builder and worked on different modules. it works perfectly

when am testing with Flash Builder

but once i close it, the httpservices stop working. I search and now got

error message i.e.

 

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

Can't load data: (mx.messaging.messages::ErrorMessage)#0

  body = ""

  clientId = "DirectHTTPChannel0"

  correlationId = "A10EF203-C28B-A5C6-73D6-1C765EAA0714"

  destination = ""

  extendedData = (null)

  faultCode = "Server.Error.Request"

  faultDetail = "Error: [IOErrorEvent type="ioError" bubbles=false

cancelable=false eventPhase=2 text="Error #2032: Stream Error. URL:

http://localhost:37813/1/users/show.xml?screen_name=charagh?hostport=api.twitter.com&https =N&id=A10EF203-C28B-A5C6-73D6-1C765EAA0714"].

URL: http://api.twitter.com/1/users/show.xml?screen_name=charagh"

  faultString = "HTTP request error"

  headers = (Object)#1

    DSStatusCode = 0

  messageId = "542DB993-AA3F-7E05-636C-1C7662BB7FFF"

  rootCause = (flash.events::IOErrorEvent)#2

    bubbles = false

    cancelable = false

    currentTarget = (flash.net::URLLoader)#3

      bytesLoaded = 0

      bytesTotal = 0

      data = ""

      dataFormat = "text"

    errorID = 0

    eventPhase = 2

    target = (flash.net::URLLoader)#3

    text = "Error #2032: Stream Error. URL:

http://localhost:37813/1/users/show.xml?screen_name=charagh?hostport=api.twitter.com&https =N&id=A10EF203-C28B-A5C6-73D6-1C765EAA0714

"

    type = "ioError"

  timestamp = 0

  timeToLive = 0

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

 

my code i.e.

 

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

<?xml version="1.0" encoding="utf-8"?>

<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"

                       xmlns:s="library://ns.adobe.com/flex/spark"

                       xmlns:mx="library://ns.adobe.com/flex/mx"

                       width="550" height="58" backgroundAlpha="1.0"

backgroundColor="#000000"

                       borderVisible="false" creationComplete="init(event)"

layout="absolute">

 

          <fx:Script>

                    <![CDATA[

                              import mx.events.FlexEvent;

                              import mx.rpc.events.FaultEvent;

                              import mx.rpc.events.ResultEvent;

                              import mx.controls.Alert;

                              import mx.rpc.http.HTTPService;

 

                              private var twitterText:String;

 

                             

                              private var twitterCount:String;

 

                             

                              private var tweetdate:String;

 

                             

                              private var twitterImage:String;

 

                              protected function

image1_clickHandler(event:MouseEvent):void

                              {

                                        navigateToURL(new URLRequest("

https://twitter.com/charagh"),"_blank");

 

                              }

 

                              protected function init(event:FlexEvent):void

                              {

                                        twitterText = "charagh";

                                        tweetUser.url="

http://api.twitter.com/1/users/show.xml?screen_name="+twitterText;

                                        tweetUser.send();

 

                              }

 

                              protected function

tweetUser_resultHandler(event:ResultEvent):void

                              {

                                        tweetdate =

event.result.user.status.created_at;

                                        twitterCount =

event.result.user.status.text "  "tweetdate;

                                        twitterImage =

event.result.user.profile_image_url;

                              }

 

                              protected function

tweetUser_faultHandler(event:FaultEvent):void

                              {

                                        Alert.show("Can't load data: " +

event.message);

 

                              }

 

                    ]]>

          </fx:Script>

 

          <fx:Declarations>

                    <s:HTTPService id="tweetUser" method="GET"

result="tweetUser_resultHandler(event)"

fault="tweetUser_faultHandler(event)">

 

                    </s:HTTPService>

          </fx:Declarations>

          <s:Image  buttonMode="true" width="48" height="48" x="5" y="5"

click="image1_clickHandler(event)" source=""/>

 

          <s:Label id="twitterNumber" x="56" y="5" width="488" height="47"

color="#EDEDED"

                               fontFamily="Georgia" fontSize="12"

fontWeight="normal" text=""

                               textAlign="center" verticalAlign="middle"/>

</mx:Module>

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

 

Regards,

Asim Ahmed

 

~ http://www.charag.com ~

 


Viewing all articles
Browse latest Browse all 70427

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>