Sorry I did not see the other letters. I hate this kind of problems. Nothing works because of a letter(S)
Thanks you very much It works now Pedro 2007/7/8, Pedro Kostelec <[EMAIL PROTECTED]>:
Thanks, but there is still the other error 1120: Access of undefined property letters. var randomIndex:uint= Math.floor(Math.random()*letters.length); Pedro 2007/7/8, Paul Andrews < [EMAIL PROTECTED]>: > > > ----- Original Message ----- > From: "Pedro Kostelec" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Sunday, July 08, 2007 8:43 PM > Subject: [Flashcoders] writing as for components > > > > hello: > > > > I've found a tutorial > > here:http://www.adobe.com/designcenter/video_workshop/ > > named writing ActionScript for Components. I have done all it wants me > to > > do > > it but i got the following errors: > > 1120: Access of undefined property letters. var > randomIndex:uint= > > Math.floor(Math.random()*letters.length); > > 1120: Access of undefined property letters return > > letters[randomIndex]; > > > > Can anyone tell me what is wrong? > > var letter:Array > > The array is letter, not letters .. > > Paul > > > > > The code: > > > > var letter:Array= ["A","B","C","D","E","F", > > "G","H","I","J","K","L", > > "M","N","O","P","Q","R", > > "S","T","U","V","W", > > "X","Y","Z",]; > > function getRandomLetter():String { > > var randomIndex:uint=Math.floor(Math.random()*letters.length); > > return letters[randomIndex]; > > } > > import fl.controls.Button; > > > > var i:uint=o; > > var j:uint=0; > > var posX:uint=o; > > var posY:uint=0; > > var buttonSize:uint=25; > > > > while(posY<stage.stageHeight){ > > posX=0; > > j=0; > > posY=i * buttonSize; > > > > while(posX<stage.stageWidth){ > > posX= j * buttonSize; > > var b:Button= new Button > > b.setSize(buttonSize,buttonSize); > > b.move(posX, posY); > > b.label=getRandomLetter(); > > addChild(b); > > j++; > > } > > i++; > > } > > _______________________________________________ > > [email protected] > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com > > http://training.figleaf.com > > > > _______________________________________________ > [email protected] > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com > http://training.figleaf.com >
_______________________________________________ [email protected] To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com

