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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:59:08+00:00 2026-06-17T05:59:08+00:00

Here is a simple code : var a:Array = new Array( ins0, ins1, ins2,

  • 0

Here is a simple code :

var a:Array = new Array( ins0, ins1, ins2, ins3,...., ins10000) ;
findIns( ins1500) ;

function findIns( ins:SomeInstance ) {  
    for ( var i = 0 ; i< a.length ; i++)  {
        if ( a[i] == ins ) {
            trace ( "FOUND IT");
            break; 
        }
    }
}

In the above code there is NO “int” or “string”. They are instances of some complex class. So is it sensible to use Vectors in place of arrays in this case.

In my opinion it should be sensible, because instances are “numerical-memory-locations” afterall ?

  • 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-17T05:59:09+00:00Added an answer on June 17, 2026 at 5:59 am

    If the content of the array are all instances of the same class, then yes Vector will definitely performs better than Array.

    See the documentation for more information:

    • Performance: array element access and iteration are much faster when using a Vector instance than they are when using an Array.

    • Type safety: in strict mode the compiler can identify data type errors. Examples of data type errors include assigning a value of the incorrect data type to a Vector or expecting the wrong data type when reading a value from a Vector. Note, however, that when using the push() method or unshift() method to add values to a Vector, the arguments’ data types are not checked at compile time. Instead, they are checked at run time.

    • Reliability: runtime range checking (or fixed-length checking) increases reliability significantly over Arrays.

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

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

Sidebar

Related Questions

Here is the super simple code i have: HtmlDocument htmlDoc = new HtmlDocument(); htmlDoc.OptionWriteEmptyNodes
my sample code is here include 'simple_html_dom.php'; function get_all_links($url){ global $host; $html = new
I have the following array: function theMiddle(){ var arrayTheMiddle = new Array (showName.theMiddle +<br
I have a very simple code: var allTypes = restaurant|dentist; var typeSplitter = new
Here is a simple scenario in C#: var intList = new List<int>(); intList.Add(4); intList.Add(7);
here is jsfiddle sample - http://jsfiddle.net/6bKHc/120/ and code - var move, inter; inter =
here my simple code to add filename and their associated icon to virtualtreeview PFileInfoRec
Here is some simple code: DIR* pd = opendir(xxxx); struct dirent *cur; while (cur
Here is a simple code that shows what I think is a bug when
I've got a quite strange problem here. I'm calling some simple code via Ajax.Updater:

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.