I am using the packet to do streaming using https get:
I got following error. But I do get streaming data. Does anyone know
why?
ypeError: Error #1034: Type Coercion failed: cannot convert
org.httpclient.events::HttpStatusEvent@dd39cb9 to
flash.events.HTTPStatusEvent.
at org.httpclient.events::HttpListener/onInternalStatus()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at org.httpclient::HttpSocket/onResponseHeader()
at org.httpclient.io::HttpResponseBuffer/writeBytes()
at org.httpclient::HttpSocket/onSocketData()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.hurlant.crypto.tls::TLSSocket/onTLSData()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.hurlant.crypto.tls::TLSEngine/parseApplicationData()
at com.hurlant.crypto.tls::TLSEngine/parseOneRecord()
at com.hurlant.crypto.tls::TLSEngine/parseRecord()
at com.hurlant.crypto.tls::TLSEngine/dataAvailable()
Code is attached:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute" xmlns:cmp="org.httpclient.*" borderStyle="none"
height="500" width="500" creationComplete="initInterface()">
<mx:Script>
<![CDATA[
import com.adobe.net.URI;
import org.httpclient.events.*;
import mx.controls.TextArea;
import mx.containers.Panel;
import mx.controls.Alert;
import asscript.*;
import mx.controls.Alert;
import org.httpclient.*;
var output:TextArea;
public function initInterface():void
{
output=new TextArea();
output.width=500;
this.addChild(output);
var client:HttpClient = new HttpClient();
client.listener.onStatus = function(event:HTTPStatusEvent):void
{
Alert.show("on status");
};
client.listener.onData = function(event:HttpDataEvent):void
{
// For string data
// Alert.show("on data");
var stringData:String = event.readUTFBytes();
output.text=stringData;
//Alert.show(stringData);
// For data
var data:ByteArray = event.bytes;
//Alert.show("length="+data.length);
};
client.listener.onComplete = function(event:HttpResponseEvent):void {
Alert.show("on Complete");
};
client.listener.onError = function(event:ErrorEvent):void {
var errorMessage:String = event.text;
Alert.show("on Complete"+errorMessage);
};
var uri:URI = new URI("
https://10.3.54.30/screens/spectrumdata");
client.get(uri);
}
]]>
</mx:Script>
</mx:Application>