# Strange behavior in AS3 lite remoting framework

**URL:** <https://forum.kirupa.com/t/strange-behavior-in-as3-lite-remoting-framework/249282>\
**Category:** Uncategorized\
**Created:** [January 17, 2008, 5:13am UTC](https://forum.kirupa.com/t/strange-behavior-in-as3-lite-remoting-framework/249282 "2008-01-17T05:13:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![joshchernoff](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/joshchernoff/32/1852_2.png) [@joshchernoff](https://forum.kirupa.com/u/joshchernoff)\
**Post date:** [January 17, 2008, 5:13am UTC](https://forum.kirupa.com/t/strange-behavior-in-as3-lite-remoting-framework/249282/1 "2008-01-17T05:13:25Z")

</div>

I have made a mod for the popular AS3 remoting framework that handles the results then make a dataprovider if it’s a recordset. Due to a strange dispatchEvent it has bugs.

To follow along download my mod version of the framework here.  
[http://gfxcomplex.com/blog/amfphp/as3-lightweight-remoting-framework-datatype-mod-beta-01/](http://gfxcomplex.com/blog/amfphp/as3-lightweight-remoting-framework-datatype-mod-beta-01/)  
Place the frame work in your core code directory. You can use my amfphp that I have up for this test to follow a long.

here the document code.  
[AS]  
import com.dannypatterson.remoting.\*;  
import fl.data.DataProvider;

var serviceProxy:ServiceProxy;

serviceProxy = new ServiceProxy(“[http://www.gfxcomplex.com/amfphp/gateway.php](http://www.gfxcomplex.com/amfphp/gateway.php)”, “test\_service”, true, “AMF0”);  
serviceProxy.addEventListener(ResultEvent.RESULT, onRec, false, 0, true);  
serviceProxy.getRecordset();

function onRec(e:ResultEvent):void {  
trace(e);  
}  
[/AS]

Place a break on line 56 of ResultEvent and debug.

**bug:**  
[INDENT]you will see how the event is triggered the first time with the result datatype of an object. but for some reason the class Operation make a “dispatchEvent(new ResultEvent” on line 66 re-dispatching the same event again for a second time. This time around the same results come back as an Array datatype which breaks the logic.  
[/INDENT]  
I don’t understand the role Operation and OperationPool. Any ideas why it’s redispatching the same event over with different datatypes for the same results?
