About arrays. NEED HELP!

i need that to have an array with 166 numbers. ("_parent._parent.totalFrames = 167" and “q != _parent._parent.currentframe” ) is the following code correct?

myArray = [];
for (var q = 1; q != _parent._parent._currentframe && q<168; q++) {
myArray.push(q);

maybe
myArray = ;
for (var q = 1; q<168; q++) {
myArray.push(q);
}
myvar = this._parent._parent._currentframe;
myArray.splice(myvar, 1);

not sure how functional this is

i figured it out, and it works :slight_smile:

var my = [];
var i = 1;
while (i&lt;168) {
	my.push(i++);
}
var current = _root._currentframe
my.splice(current-1,1)
trace(my.join());
trace(_root._currentframe);

thnx to stringy!

now… this wery confusing problem has come while expanding that script…
while the first part works (when _root._currentframe<168, it removes _root._currentframe from the array), but the second part does not work (when _root._currentframe>167, it does not remove _roor._currentframe)
whats wrong with it???

this.onEnterFrame = function() {
var current = _root._currentframe-1;
if (_root._currentframe<168) {
var my = [];
var i = 1;
while (i<168) {
my.push(i++);
}
my.splice(current, 1);
trace(my.join());
trace(_root._currentframe);
} [COLOR=DarkRed]else if (_root._currentframe>167) {
var my = [];
var i = 168;
while (i<248) {
my.push(i++);
}
my.splice(current, 1);
trace(my.join());
trace(_root._currentframe);
}[/COLOR]
};

you need to use my.splice(current-167, 1);
took me a while to work out, deleting variables etc to start with

oh, right… doh
because the array has only 80 numbers in it ( in the second case )

THNX :smiley: