guidance on array creating

could someone provide insight to arrays please =}

Page 1 of 1

0 Replies - 533 Views - Last Post: 02 November 2008 - 07:34 AM Rate Topic: -----

#1 ~charli~   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 30-October 08

guidance on array creating

Posted 02 November 2008 - 07:34 AM

Quote

Originally Posted by neilmmm
put their linkage identifiers in an array

var library_array:Array = new Array("square", "triangle", "circle");
onmousedown = function () {
 var num:Number = Math.floor(Math.random()*library_array.length);
 var mc:MovieClip = this.attachMovie(library_array[num], "mc"+this.getNextHighestDepth(), this.getNextHighestDepth());
 mc._x = this._xmouse;
 mc._y = this._ymouse;
};

is the part of the code that i can rename "library_array"? which would be the name of my array such as
allDrops=new Array();
where i've called the array "allDrops" ?
or is "library_array" part of the coding?

i've created a range of droplets - the objects to be arrayed - in a folder in my library, linkage named:
drop1
drop2
drop3 etc

would i then customise the code you've given me to be
var library_array:Array = new Array("drop1", "drop2", "drop3");
onmousedown = function () {
 var num:Number = Math.floor(Math.random()*library_array.length);
 var mc:MovieClip = this.attachMovie(library_array[num], "mc"+this.getNextHighestDepth(), this.getNextHighestDepth());
 mc._x = this._xmouse;
 mc._y = this._ymouse;
};

i'm not sure i understand what, if anything, i should put in the place of "[num]" in line 4, or if that is simply referring to line three.

thank you for your help =D ... and patience =s

Is This A Good Question/Topic? 0
  • +

Page 1 of 1