Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

passing array from coldfuison to as3

New Here ,
Dec 19, 2009 Dec 19, 2009

hay all

im new at CF and i'm traying to pass an array (list of languages form mySql) aealy simple one, my function looks like that:

<cfcomponent>

<cffunction name="get_languages_pagingUtils" access="remote" returntype="Array" >

<cfset var arrResult = arrayNew( 1 ) >

<cfquery name="languages">

SELECT language_name,native_name

FROM languages

</cfquery>

<cfreturn arrResult>

</cffunction>

</cfcomponent>

on the as3 side i have this:

the function that call the old fusion function-

public static function getData():void

{

var nc:NetConnection;

nc = new NetConnection();

nc.connect("http://localhost:8500/flashservices/gateway/");

nc.call("paging-debug.cfc.pagingService.get_languages_pagingUtils", new Responder(onResult, onError));

}

and the result function:

public static  function onResult(result:Array):void

{

trace("result = ", result as Array)

}

i have tray to find all kind of tutorials but no success there..

i'll be happy for sum halp

thanks..

TOPICS
Builder
420
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2009 Dec 21, 2009

This is not the best place to post this, but I hope this helps.

You can use a simple remote object for this.

index.mxml

    <mx:RemoteObject
        destination="ColdFusion"
        source="paging-debug.cfc.pagingService.get_languages_pagingUtils"
        endpoint="http://localhost:8500/flashservices/gateway/" (try this insead http://localhost:8500/flex2gateway/)
        id="roLanguages"
        showBusyCursor="true">
        <mx:method name="get_languages_pagingUtils" result="onResult(event)" />   
    </mx:RemoteObject>

your actionscript

import mx.rpc.events.ResultEvent;

import mx.utils.ObjectUtil;

public function getData():void{

     roLanguages.get_languages_pagingUtils()

}

private function onResult(event:ResultEvent):void{

     trace(ObjectUtil.toString(event.result);

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 21, 2009 Dec 21, 2009
LATEST

thanks for your answer..

i thought that it's not the place for it..

but any way this is steel not helping me cose im trying to pass the array to

a class and not to flex - (when i'm dooing it in flex its all good just like you say)

thanks again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources