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

  • SEARCH
  • Home
  • 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 6863143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:44:47+00:00 2026-05-27T02:44:47+00:00

I find it unfamiliar to work with ActionScript’s array assignment by reference methodology. I

  • 0

I find it unfamiliar to work with ActionScript’s array assignment by reference methodology. I understand what it’s doing, but I somehow find it confusing to manage many arrays with this methodology. Is there a simple way to work with ActionScript arrays where the array assignment is by VALUE rather than REFERENCE? For example, if I want to assign oneArray to twoArray without linking the two arrays to each other forever in the future, how to do it? Would this work?

var oneArray:Array = new Array("a", "b", "c");
var twoArray:Array(3);
for (ii=0; ii<3; ii++) { twoArray[ii] = oneArray[ii]; }

The intent is to be able to change twoArray without seeing a change in oneArray.

Any advice how to assign arrays by VALUE instead of REFERENCE?

—- for reference —-

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Array.html

Array assignment is by reference rather than by value. When you assign one array variable to another array variable, both refer to the same array:

var oneArray:Array = new Array("a", "b", "c");
var twoArray:Array = oneArray; // Both array variables refer to the same array.
twoArray[0] = "z";             
trace(oneArray);               // Output: z,b,c.
  • 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-05-27T02:44:48+00:00Added an answer on May 27, 2026 at 2:44 am

    You can clone the array to guarantee two seperate copies with the same values in each Array element:

    var oneArray:Array = new Array("a", "b", "c");
    var twoArray:Array = oneArray.concat();
    twoArray[0] = "z";
    trace(oneArray); // Output: a,b,c
    

    Hope this is what you’re looking for.

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

Sidebar

Related Questions

I find it much more difficult to manage your session in a desktop application,
I'm unfamiliar with Javascript and have been struggling to understand how I'd go about
I am very unfamiliar with nginx, as a forewarning, and also can't find any
I have completed an assignment. However, I am unfamiliar with javac compiler error messages,
I searched SO for a pertinent question existing already but couldn't find one. I
Find control doesn't seem to work with my dynamic check boxes; what i am
Find the first covering prefix of a given array. A non-empty zero-indexed array A
There's documentation to build the android source code base. But it's hard to find
find whether there is a loop in a linked list. Do you have other
find . -type f -print prints out ./file1 ./file2 ./file3 Any way to make

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.