Title: Help: slowing-down a for loop???
¡Hola!
My script:
[quote]
//Createstatictextfield:
this.createTextField('static_txt',3,50,0,50,20);
this.static_txt.text='ism';
//
//Createarray:
varisms=['Natural','Postmodern','Surreal','Dada','Formal',' Real','Symbol','Expression','Futur','Ambigu'];
//
//Createtextfieldtodisplayabovearrayelements:
this.createTextField('ism_txt',2,0,0,50,20);
ism_txt.selectable=false;
ism_txt.type='dynamic';
ism_txt.text='------';
//
//Createmovieclipbutton:
this.createEmptyMovieClip('ism_btn',1);
//Addtextfield:
this.ism_btn.createTextField('submit_txt',1,100,50 ,50,20);
this.ism_btn.submit_txt.text='Submit';
//
//Buttonhandler:
this.ism_btn.onRelease=function(){
//Createforlooptocyclethrougharrayanddisplaycontents/elementssequentially:
for(vari=0;i<isms.length;i++){
trace('Nowexaminingelement:'+isms[i]);
ism_txt.text=isms[i];
}//Endforloop.
};//Endismbuttonfunction.
</CODE>
How do I decrease the speed of the above 'for loop' each time it iterates?
I would like the array elements to display in the (ism_txt) text box, starting really fast, slow down, and finally stopping/displaying last element of array in text box.
Is that possible?
Should I us setInterval?
Obviously, I am a novice actionscripter... If I am going about this the wrong way, please let me know... maybe I should not be trying to do this all via AS?
Anyway, any help would be appreciated.
Cheers!
Micky
¡Hola!
My script:
[quote]
//Createstatictextfield:
this.createTextField('static_txt',3,50,0,50,20);
this.static_txt.text='ism';
//
//Createarray:
varisms=['Natural','Postmodern','Surreal','Dada','Formal',' Real','Symbol','Expression','Futur','Ambigu'];
//
//Createtextfieldtodisplayabovearrayelements:
this.createTextField('ism_txt',2,0,0,50,20);
ism_txt.selectable=false;
ism_txt.type='dynamic';
ism_txt.text='------';
//
//Createmovieclipbutton:
this.createEmptyMovieClip('ism_btn',1);
//Addtextfield:
this.ism_btn.createTextField('submit_txt',1,100,50 ,50,20);
this.ism_btn.submit_txt.text='Submit';
//
//Buttonhandler:
this.ism_btn.onRelease=function(){
//Createforlooptocyclethrougharrayanddisplaycontents/elementssequentially:
for(vari=0;i<isms.length;i++){
trace('Nowexaminingelement:'+isms[i]);
ism_txt.text=isms[i];
}//Endforloop.
};//Endismbuttonfunction.
</CODE>
How do I decrease the speed of the above 'for loop' each time it iterates?
I would like the array elements to display in the (ism_txt) text box, starting really fast, slow down, and finally stopping/displaying last element of array in text box.
Is that possible?
Should I us setInterval?
Obviously, I am a novice actionscripter... If I am going about this the wrong way, please let me know... maybe I should not be trying to do this all via AS?
Anyway, any help would be appreciated.

Cheers!
Micky

Comment