I have a few questions I am new to SWX and I am using Twitter
Services. (SWX 2 Beta 1)
VerifyError: Error #1033: Cpool entry 1 is wrong type.
ReferenceError: Error #1065: Variable swxResponse is not defined.
Using Flash Player 10 Debugger, Flex 3 Latest Version
ActionScript3 Format / AMF3
SWX server passes all tests and I can communicate to Twitter via
service explorer and everything works.
I have fiddler installed and haven't seen anything out of the
ordinary. It goes and fetches the data.swf
It seems to be having troubles loading it it gets to line 230 in
External Assest.as (when debugging with flex)
Pops the errors right after line 230 which is -> _loader.loadBytes
(_urlLoader.data);
I am throughly stumped I know this is wicked cool for AS2/Flash Lite
but I really need mine to work with as3. Any hacks, suggestions,
guidance would be awesome!!!
I have also noticed on occasion I will get ->
VerifyError: Error #1107 : The ABC data is corrupt, attempt to read
out of bounds -- Although that seems to no longer occur and now I just
get the other error.
private function onLoadComplete(e:Event):void
{
echo("ExternalAsset loaded");
timeoutTimer.stop();
_loaded = true;
_loading = false;
// Dispatch an event now in case someone needs it.
dispatchEvent(new SWXLoadedNotReadyEvent());
// try to parse result
try
{
_loader = new Loader();
_loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR,
onIOError);
_loader.contentLoaderInfo.addEventListener(Event.INIT,
onMovieReady);
--------------------------------_loader.loadBytes(_urlLoader.data);
------------------------------------ Seems to fail after this point
}
catch(e:Error)
{
// unable to parse
dispatchEvent(new SWXFaultEvent( { error:true, code: -1,
message:'Unable to parse content: ' + e.message } ));
}
}
Code In Question:
import com.SampleTitleWindow;
import mx.events.MenuEvent;
import mx.controls.Alert;
import mx.collections.*;
import mx.managers.PopUpManager;
import mx.controls.Alert;
import org.swxformat.*;
import nl.demonsters.debugger.MonsterDebugger;
import flash.events.IOErrorEvent;
import flash.events.EventDispatcher;
import flash.events.SecurityErrorEvent;
public var swx:SWX = new SWX();
//public var d:MonsterDebugger = new MonsterDebugger(this);
public var username:String = new String("seacloud9"); // your name
use to login Twitter
public var pass:String = new String("test") ; // your pass, this is
example
public var userID:String = new String("14421804");
public var msg:String= new String("Hi all! I Sent a message from
Flash SWX to Twitter");
public var nil:String = new String(null);
public var argumentArray:Array = new Array(null, null, username,
40, null );
public var callUserTimeLine:Object = new Object();
public function initSWX():void {
swx.gateway="
http://i-create.org/SWX/php/swx.php";
swx.encoding = "GET";
swx.timeout = 30;
swx.debug = true;
swx.resultHandler = resultUserTimeLineHandler;
swx.progressHandler = progressHandler;
swx.timeoutHandler = timeoutHandler;
swx.faultHandler = faultHandler;
initUserUpdates();
}
public function initUserUpdates():void
{
callUserTimeLine = {
serviceClass: "Twitter",
method: "userTimeline",
args: [nil,nil,username,40,nil],
timeout: 5,
resultHandler: resultUserTimeLineHandler,
progressHandler: progressHandler,
timeoutHandler: timeoutHandler,
debug:true
};
try
{
//var myFunction = function () : void { swx.call
(callUserTimeLine); };
//myFunction();
swx.call(callUserTimeLine);
//swx.call(callUserTimeLine);
trace(callUserTimeLine);
}
catch(e:Error)
{
trace("Error: " + e.message);
}
}
public function progressHandler(event:Object):void
{
trace("progressHandler: " + event.bytesLoaded + " of "
+ event.bytesTotal + "<br>");
}
public function timeoutHandler(event:Object):void
{
trace("Call timeout. Please try again.<br>");
}
public function faultHandler(event:Object):void
{
trace("Call fault. Please try again.<br>"+
event.fault.message);
}
public function resultPostHandler(event:Object):void {
// Display the text property of the first result.
trace("This is it:"+event.result[0]);
}
public function resultUserTimeLineHandler(event:Object):void {
trace("madeITHereTOOO");
trace("I was Called" + event);
//var loader:Loader = new Loader();
//loader.load(new URLRequest("data.swf"));
// Display the text property of the first result.
trace("This is it:" + event.result[0].text);
//funBus.text = event.result[0];
for (var i:Number = 0; i < event.result.length; i++ )
{
//userPosts.dataProvider = event.result[i].text;
trace(event.result[i].text);
//funBus.text = event.result[i].text;
}
}