PDA

Volledige versie bekijken : Simpel loop > how assign cumulative functions to buttons?


tdskate
%Europe/Berlin %406 %2005, 10:44
for (var nIndex:Number = 1; i>17; nIndex++) {
b[nIndex].onRelease = function():Void {
_root.contactlist.gotoAndStop(nIndex+1);
};
}



Hallo,
Wat doe ik hier juist fout?

Thanks,

Thomas

SaphuA
%Europe/Berlin %428 %2005, 11:17
Dit soort dingen zijn al zooo vaak besproken!
Wat je nu doet is getvolgende:
b.1.onRelease = function ---

Maar het moet zeker worden:
b1.onRlease = function ---

Dus dan moet je code worden:
this["b"+nIndex].onRelease = function ---