Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9257077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:06:58+00:00 2026-06-18T12:06:58+00:00

I use NetConnection class to establish my connections with amfPHP. This class has a

  • 0

I use NetConnection class to establish my connections with amfPHP. This class has a call() method which receives ...rest as last parameter which will be the values sent to PHP.
What I want is to write a Proxy class that will receives the calls that will be made to PHP and this Proxy class will make the calls instead of my DAO’s. Now, my problem is that in order to have a Proxy for NetConnection.call(), I need to receive a ...rest parameter and pass it to NetConnection as it is. But what happens is that my function casts ...rest to array and in the end PHP receives only 1 Array parameter instead of tons of parameters as it should be. Assuming that I can’t have a Proxy on PHP to handle this, how can I make sure that my ...rest parameter will be kept as ...rest for another function? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T12:06:59+00:00Added an answer on June 18, 2026 at 12:06 pm

    So ...rest ends up taking all the parameters remaining, and creating an array from them named rest. If you want to call a function with an array of arguments, rather then one by one, then the apply method on Function is what your looking for. I’m not familiar with NetConnection but here’s an example

    public function proxy(command:String, responder:Responder, ... args):void{
        var netConnection:NetConnection = new NetConnection();
        var argsToApply:Array = [command,responder];
        argsToApply = argsToApply.concat(args); //Forms an array of all the arguments in order
        netConnection.call.apply(null,argsToApply);
    }
    

    A single array of all the arguments is formed, such that apply can be used with the call method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This code below is the base servlet we use for our project: public class
I am starting to use MySQL with JDBC. Class.forName(com.mysql.jdbc.Driver); conn = DriverManager.getConnection(jdbc:mysql:///x, x, x);
I have create a getDBConnection method in my Java application. This returns a connection
I have a class MyClass that has a static variable. Class implements smth like
My problem is this: I want to use mxml for visual element... i want
On Class A I have this: protected function createTempTable() { $qry = ' CREATE
I have this error while executing a java class to update a mysql db
I wrote a Singleton class for getting connections. However, I cannot get connections using
In C# I am able to create a class like this: static class clsDBUtils
This code has caused me lots of trouble so far but it's really first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.