Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / July 2008



Tip: Looking for answers? Try searching our database.

Possible to pass a structure to CF8 from Flash AS3?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RabidGadfly - 20 May 2008 13:54 GMT
I'm trying to pass a structure to a ColdFusion component from Flash but it
keeps failing with this error:

"Unknown object type tag (17)"

Here's my AS. I've tried using Array, Object, and Dictionary as types:
-------------------------------------------------------------------------------
loadData_btn.addEventListener(MouseEvent.MOUSE_DOWN, loadData)

var myService = new NetConnection()
myService.connect("http://localhost/flashservices/gateway/")

function loadData(evt:MouseEvent){
    var responder = new Responder(getTest_Result, onFault);
    var mystruct:Array = new Array();
    mystruct["mystring"] = "hello";
    myService.call("com.mycomponent.test", responder, mystruct);
}

function getTest_Result(result){
    trace("success: "+ result);
}

function onFault( f){
    trace("There was a problem: " + f.description);
}
-------------------------------------------------------------------------------

...and here's my component function (I've tried with an argument type of
'struct' as well as 'any':
-------------------------------------------------------------------------------
<cffunction name="test" output="no" access="remote" returntype="string" >
    <cfargument name="argstruct" type="any" required="yes" />
    <cfset mystr =arguments.argstruct["mystring"]>
    <cfreturn  mystr />
</cffunction>
-------------------------------------------------------------------------------

I was successful in sending and returning a string as a test to ensure that
the apps were set up correctly. It's only when I try to pass a struct that I
get an error.

I've seen the docs on using the Flash scope in CF but I get the same error
when I try it.

Thanks in advance for any help,
Glenn
RabidGadfly - 20 May 2008 20:09 GMT
Found my own solution.

After many hours of Googling, and much trial and error, I figured out how to
make this work?and it?s a one line solution. Simply add
myService.objectEncoding=0 before the myService.connect line at the top of the
AS code. It controls the way objects are serialized using AMF.
SamNUK - 14 Jul 2008 15:36 GMT
Dude...

How would I go about fixing the same error with an <mx:RemoteObject>
tag?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.