The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 4 of 4

Thread: rewriting array data?

  1. #1

    rewriting array data?

    okay so i have this code:

    myArray = new Array();
    for (i=0; i<items; i++) {
       //bunch of XML stuff
    //sometime later...
    button.onRelease = function() {
       myArray[buttonID] = 1;
       trace(myArray);	//outputs :: 0,0,0,0,0...for however many items i have
    okay, so obviously there is stuff missing from my code b.c i dont feel like copying it all over. its basically an XML controlled style blog, and i'm trying to keep track of whether an entry is open (0), or closed (1), and those values are being stored in 'myArray'.

    my question is, why isnt that call to myArray overwriting the existing data? i know i have doen this before (maybe not in this fashion, but i know its possible). anyone know what im doing wrong?



  2. #2
    what is buttonID?

  3. #3
    its just a number that is being used to identify a button with that particular spot in the array. example:

    for (i=0; i<5; i++) {
       var myButton = this.mcContent["btn"+i];
       myButton.buttonID = i;
       myButton.onRelease = function() {
          myArray[this.buttonID] = 1;

  4. #4
    ahh nevermind...i figured it out...

    the buttonID variable was being stored on a different clip...just had to change the addressing to accomodate it


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012