actionscript 3 - Why is this method causing Flash to crash without even being called? -
i have class called oesdatepicker, name suggests it's date picker.
there's method in class returns sprite containing week day names:
private function drawweekdays():sprite { var temp:sprite = new sprite(); var wds:array = new array(); var format:textformat = new textformat(); format.font = "tahoma"; format.align = textformatalign.center; format.size = 11; format.color = 0xffffff; trace("here"); /*for( var i:int = 0; < 7; i++ ) { trace(i); wds[i] = new tlftextfield(); /*wds[i].width = cell_size; wds[i].defaulttextformat = format; if( "en" == lang ) { wds[i].text = day_names_en[i]; } else { wds[i].text = day_names_fa[i]; } //wds[i].y = 0;*/ //wds[i].x = margin + * cell_size; //wds[i].text = "kkk"; //temp.addchild(wds[i]); //} return temp; }
as can see have commented out loop. if don't flash crash upon running movie. thing not event trace("here") directive gets executed. , weird thing have never called method. if remove loop comments, flash crash without printing in output. ideas????
edit: following code has same problem too:
private function drawweekdays():sprite { var temp:sprite = new sprite(); var wds:array = new array(); var format:textformat = new textformat(); format.font = "tahoma"; format.align = textformatalign.center; format.size = 11; format.color = 0xffffff; trace("here"); //for( var i:int = 0; < 7; i++ ) //{ //trace(i); wds[0] = new tlftextfield(); wds[0].width = cell_size; wds[0].defaulttextformat = format; if( "en" == lang ) { wds[0].text = day_names_en[0]; } else { wds[0].text = day_names_fa[0]; } wds[0].y = 0; wds[0].x = margin + 0 * cell_size; temp.addchild(wds[0]); //} return temp; }
what heck man!!! using class property in project properties use class. moved class place import it, , problems faded away!
thanks sunil
Comments
Post a Comment