+ Reply to Thread
Results 1 to 5 of 5

Thread: Pass var from flash to service class

  1. winterain Guest

    Pass var from flash to service class

    This is really basic, but I forgot how to do it and am on a tight deadline.
    Can some kind soul help me out please.

    I need to know how to pass a global variable in Flash to the service class in AMFPHP gateway.

    I have a list, and upon clicking the lists, i want to retrieve the content via my viewContent.php class based on the ID of the item clicked on.

    Thanks alot!

  2. Join Date
    Aug 2005
    Posts
    27
    Code:
    var pc1:PendingCall = _service.yourMethod(_global.variable);
    that is how you send a variable to your method to return the desired data, I hope that helps.

    -Caraldur

  3. Join Date
    Mar 2009
    Posts
    2
    I haven't understood

    I have a simple service


    PHP Code:
    <?php

    class className
    {    
        public function 
    __construct()
        {
            
    mysql_connect("xxx","xxx","xxx);
            mysql_select_db("
    myDB");
            
        }

        /**
         * Retrieves  data
         * @returns id description
         */
        function getData($rq)
        {
            return mysql_query("
    SELECT iddescription FROM myTable WHERE id=$rq");
        }
    }

    ?>



    On my Flash document




    Code:
    import flash.net.*;
    
    var gw:NetConnection = new NetConnection();
    gw.connect("http://xxx/amfphp/gateway.php");
    
    var res:Responder = new Responder(onResult, onFault);
    
    function onResult(responds:Object):void {
    	// parse the ArrayCollection
    	var t:Array = responds.serverInfo.initialData;
    	for (var i:uint=0; i<t.length; i++) {
    		trace(t[i][0]);
    	}
    }
    
    function onFault(responds:Object):void {
    	for (var i in responds) {
    		trace(responds[i]);
    	}
    }
    
    gw.call("className.getData", res);

    This doesn't work because an argument is missing (the $rq)

    ...some ideas?

  4. Join Date
    Mar 2009
    Posts
    2
    Some time I'd better read the help files before posting


    gw.call("Class.method", responder, params);

  5. Join Date
    Oct 2009
    Location
    United States
    Posts
    10

    Pass var from flash to service class

    Anyone have any troubleshooting ideas for Service capture on mac os x, intel? it isnt catching data from the Flash IDE when testing remoting.

    thanks.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts