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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:45:42+00:00 2026-05-23T15:45:42+00:00

How can add element to array in ActionScript3 If i have an array: var

  • 0

How can add element to array in ActionScript3

If i have an array:

var myArray:Array;

How can add element to this array “myArray”, something like this:

myArray[] = value;

My second question is: How can compare if variable value exist in array element value?

Something like in_array function in php

  • 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-23T15:45:43+00:00Added an answer on May 23, 2026 at 3:45 pm

    To answer both your questions here, you can add to an array by direct access or by the push() method, like so:

    myArray[7] = something;
    

    or

    myArray.push(something);
    

    Also as Nox noted, you can use the splice method as well to add in elements. This method is used to delete N amount of elements at a specific index, but you can also simultaneously inject one or more elements at the same index.

    For your second question about how to check values or compare them in an array, here is one method:

    var i:int = 0;
    
    for(i; i < myArray.length; ++i){
        if(myArray[i] == 10){
           trace('found');
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an element like this: var myDiv = new Element('div'); myDiv.update('Hello!'); I
I can add an element to a form like this: $form->addElement($element); However, that will
How can I add an element to the beginning of array without changing array
Using javascript, how can I add to an array an element which contains fields
I have an array like this: Array ( [0] => 1 [1] => 2
How can I add an element to the beginning of array without changing array
My question is somewhat weird, but can i add events for any DOM elements(div),
Can I add an object of Elements inside another DOM element using grab or
i have an element of type Radio in zend form . how can i
I would like to be able to add a hidden form field using array

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.