Groups | Blog | Home
all groups > flash actionscript > march 2006 >

flash actionscript : for loop syntax



TheScarecrow
3/1/2006 11:50:49 PM
I want to change the following if statement.
if (gTotal == 10) {
_root.questionnumber1.htmlText = (questionsRecordResult.items.ID);
_root.questionnumber2.htmlText = (questionsRecordResult.items.ID);
_root.questionnumber3.htmlText = (questionsRecordResult.items.ID);
_root.questionnumber4.htmlText = (questionsRecordResult.items.ID);
_root.questionnumber5.htmlText = (questionsRecordResult.items.ID);
}

to something a little more like this. I need the items to be the variable
_root.buttonNumber

if (gTotal == 0) {
for (i=0; i<6; i++) {
//_root.gotoAndPlay(2);
_root.htmlText=(questionsRecordResult.items].ID)
}
}

Do I just have the syntax wrong on this?
.:}x-=V!P=-x{:.
3/2/2006 12:06:31 AM
is this what you are trying to do?

if (gTotal == 0) {
for (i=0; i<6; i++) {
_root["questionnumber"+i].htmlText = (questionsRecordResult.items[i].ID);
}
TheScarecrow
3/2/2006 12:18:25 AM
AddThis Social Bookmark Button