Hi,
I have the strangest problem , which has occurred before. This time I want to know if anyone else has encountered this and knows how to get around it.
I have a chunk of Code which Flash confirms is without errors, but when I either compile the program or click the AutoFormat Button, Flash puts a curly bracket at the end of it and then has the audacity to complain that there are “extra Characters found at the end of the programm.” Yeah, Duh! I would really appreciate some help. I have to have this running to go online on Sunday the very latest. Thank you guys and girls!
Here is the Code before and after. Sorry it’s so long. Look towards the end of the Second Code for the mystery Bracket:
infoTxt_XML=new XML(infoTxt_Loader.data);
// creating Info Buttons
trace("infoLoad succesful");
var maleKids:int=infoTxt_XML.Mann.children().length();
var femaleKids:int=infoTxt_XML.Frau.children().length();
//male InfoButtons
for (var i:int=0; i<maleKids; i++) {
var firstI:int=i;
var secondI:int=i;
for each (var item:String in infoTxt_XML.Mann.children()*.Eintrag) {
infoCount++;
trace(infoCount);
}//end of for each
if (infoCount>0) {
for (var n:int=0; n<infoCount; n++) {
var btnLabel:TextField=new TextField ;
btnLabel.defaultTextFormat=genF_m;
btnLabel.width=150;
btnLabel.wordWrap=true;
btnLabel.selectable=false;
btnLabel.text=infoTxt_XML.Mann.Intro.Eintrag[n].@Titel;
infoY=infoYBase+infoYPlus;
if (btnLabel.bottomScrollV==1) {
var infoBtn:CMFInfoBtn_1L=new CMFInfoBtn_1L(infoTxt_XML.Mann.Intro.Eintrag[n].@Titel,infoY,"Intro",n);
infoYPlus+=24;
switch (firstI) {
case 0 :
infoIntro_M.addChild(infoBtn);
break;
case 1 :
infoGehirn_M.addChild(infoBtn);
break;
case 2 :
infoHaut_M.addChild(infoBtn);
break;
case 3 :
infoRachen_M.addChild(infoBtn);
break;
case 4 :
infoHerz_M.addChild(infoBtn);
break;
case 5 :
infoLeber_M.addChild(infoBtn);
break;
case 6 :
infoPankreas_M.addChild(infoBtn);
break;
case 7 :
infoDarm_M.addChild(infoBtn);
break;
case 8 :
infoNerven_M.addChild(infoBtn);
break;
case 9 :
infoGenitalien_M.addChild(infoBtn);
break;
}//end of firstI switch
} else if (btnLabel.bottomScrollV>=2) {
var infoBtn2:CMFInfoBtn_2L=new CMFInfoBtn_2L(infoTxt_XML.Mann.Intro.Eintrag[n].@Titel,infoY,"Intro",n);
infoYPlus+=42;
switch (secondI) {
case 0 :
infoIntro_M.addChild(infoBtn2);
break;
case 1 :
infoGehirn_M.addChild(infoBtn2);
break;
case 2 :
infoHaut_M.addChild(infoBtn2);
break;
case 3 :
infoRachen_M.addChild(infoBtn2);
break;
case 4 :
infoHerz_M.addChild(infoBtn2);
break;
case 5 :
infoLeber_M.addChild(infoBtn2);
break;
case 6 :
infoPankreas_M.addChild(infoBtn2);
break;
case 7 :
infoDarm_M.addChild(infoBtn2);
break;
case 8 :
infoNerven_M.addChild(infoBtn2);
break;
case 9 :
infoGenitalien_M.addChild(infoBtn2);
break;
}//end of secondI switch
}//end of else if bottomScrollV
}//end of n-Loop)
}//end of if InfoCount
btnLabel=null;
infoYPlus=0;
infoY=0;
infoCount=0;
}//end of i-loop
and after AutoFormat, rspectively test run
infoTxt_XML=new XML(infoTxt_Loader.data);
// creating Info Buttons
trace("infoLoad succesful");
var maleKids:int=infoTxt_XML.Mann.children().length();
var femaleKids:int=infoTxt_XML.Frau.children().length();
//male InfoButtons
for (var i:int=0; i<maleKids; i++) {
var firstI:int=i;
var secondI:int=i;
for each (var item:String in infoTxt_XML.Mann.children()*.Eintrag) {
infoCount++;
trace(infoCount);
}//end of for each
if (infoCount>0) {
for (var n:int=0; n<infoCount; n++) {
var btnLabel:TextField=new TextField ;
btnLabel.defaultTextFormat=genF_m;
btnLabel.width=150;
btnLabel.wordWrap=true;
btnLabel.selectable=false;
btnLabel.text=infoTxt_XML.Mann.Intro.Eintrag[n].@Titel;
infoY=infoYBase+infoYPlus;
if (btnLabel.bottomScrollV==1) {
var infoBtn:CMFInfoBtn_1L=new CMFInfoBtn_1L(infoTxt_XML.Mann.Intro.Eintrag[n].@Titel,infoY,"Intro",n);
infoYPlus+=24;
switch (firstI) {
case 0 :
infoIntro_M.addChild(infoBtn);
break;
case 1 :
infoGehirn_M.addChild(infoBtn);
break;
case 2 :
infoHaut_M.addChild(infoBtn);
break;
case 3 :
infoRachen_M.addChild(infoBtn);
break;
case 4 :
infoHerz_M.addChild(infoBtn);
break;
case 5 :
infoLeber_M.addChild(infoBtn);
break;
case 6 :
infoPankreas_M.addChild(infoBtn);
break;
case 7 :
infoDarm_M.addChild(infoBtn);
break;
case 8 :
infoNerven_M.addChild(infoBtn);
break;
case 9 :
infoGenitalien_M.addChild(infoBtn);
break;
}//end of firstI switch
} else if (btnLabel.bottomScrollV>=2) {
var infoBtn2:CMFInfoBtn_2L=new CMFInfoBtn_2L(infoTxt_XML.Mann.Intro.Eintrag[n].@Titel,infoY,"Intro",n);
infoYPlus+=42;
switch (secondI) {
case 0 :
infoIntro_M.addChild(infoBtn2);
break;
case 1 :
infoGehirn_M.addChild(infoBtn2);
break;
case 2 :
infoHaut_M.addChild(infoBtn2);
break;
case 3 :
infoRachen_M.addChild(infoBtn2);
break;
case 4 :
infoHerz_M.addChild(infoBtn2);
break;
case 5 :
infoLeber_M.addChild(infoBtn2);
break;
case 6 :
infoPankreas_M.addChild(infoBtn2);
break;
case 7 :
infoDarm_M.addChild(infoBtn2);
break;
case 8 :
infoNerven_M.addChild(infoBtn2);
break;
case 9 :
infoGenitalien_M.addChild(infoBtn2);
break;
} // <----THIS IS THE BRACKET THAT WAS MISTERIOUSLY ADDED
}//end of secondI switch
};//end of else if bottomScrollV <-- THE SEMICOLON HERE WAS ALSO ADDED BY FLASH
}//end of n-Loop)
}//end of if InfoCount
btnLabel=null;
infoYPlus=0;
infoY=0;
infoCount=0;
}//end of i-loop