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 114897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:56:01+00:00 2026-05-11T02:56:01+00:00

I have a vararg method that I’d like to act as a proxy for

  • 0

I have a vararg method that I’d like to act as a proxy for another vararg method, but I’m not sure how to do it. Here’s the basic code:

class MyClass {     public function a(...args:*):* {       // other code       b(args);       // other code    }     public function b(...args:*):* {       // do stuff with args    }  } 

I’m porting the code from Java, where the type system knows that the arguments are actually supposed to be Strings, not arrays, so it can figure out to invoke b() by directly passing the arguments, and everything works how you’d expect.

But in ActionScript, the argument array gets wrapped into another array when invoked through the proxy method.

So, when b() is called directly, the array is only one level deep. But when b() is invoked through a(), the array is two levels deep.

Does anyone know of a trick for getting around this?

(NOTE: in my real code, a() and b() are actually in separate classes, and I really don’t want to touch the implementation of b() at all. I can rewrite a() to my heart’s content, but b() shouldn’t change.)

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T02:56:02+00:00Added an answer on May 11, 2026 at 2:56 am

    Well I can’t claim to be any good at ActionScript (haven’t used it in years..)

    But if nothing else you can do something like..

    class Test {     function a(...args:*):* { b.apply(this, args); }     function b(...args:*):* { trace(args[1]); } } 

    In previous versions you could use ‘arguments’ to pass all passed arguments through the apply method, but that seems to have been removed in AS3.

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

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer The book An Introduction to Computational Learning Theory contains an… May 11, 2026 at 12:34 pm
  • added an answer You need to make two VirtualHost's with on pointing to… May 11, 2026 at 12:34 pm
  • added an answer For new applications, I try to avoid them and just… May 11, 2026 at 12:34 pm

Related Questions

I have a vararg method that I'd like to act as a proxy for
I have a web-service that I will be deploying to dev, staging and production.
I have a .Net desktop application with a TreeView as one of the UI
I have a Queue<T> object that I have initialised to a capacity of 2,
I have a complete XML document in a string and would like a Document
I have a class that I wish to expose as a remote service using
A friend and I have been toying around with various Python C++ wrappers lately,
Normally, in Delphi one would declare a function with a variable number of arguments
private void activateRecords(long[] stuff) { ... api.activateRecords(Arrays.asList(specIdsToActivate)); } Shouldn't this call to Arrays.asList return

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.