Set variable to inside movieclip

[SIZE=1][COLOR=slategray]hi, [/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]I have a problem about set variable to inside movieclips.[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]i am attaching diffrent movieclips from libary. and i use movieclips as button.[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]every button must have diffrent variable values inside them. i will use these values when i click button. have many button and every button must have few diffrent variables and values…so how can i set variables to inside movieclips who i attached. I searches all forum bu i couln’t find :/.[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray][/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]thanx for your help.[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray][/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]here is my code for attach.[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]

 [/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]var urunArray:Array = new Array (urun0,urun1,urun2,urun3,urun4,urun5,urun6,urun7,urun8); //libary instance names[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray][/COLOR][/SIZE] 
[SIZE=1][COLOR=slategray]for (var i:Number=0; i<urunArray.length; i++) {[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray] urun=new urunArray*();[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray] urun.name="urun"+i;[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray] urun.x=i*60;[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray] urun.y=40;[/COLOR][/SIZE]
**[SIZE=1][COLOR=slategray]urun.testVar=i[/COLOR][/SIZE]**
[SIZE=1][COLOR=slategray] urunCont.addChildAt(urun,i);[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray] //urunCont its i create at root.[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]}[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]

[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray][/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]Edit: i think i was wrong about my problem, i could set variable to movieclip but i have problem to read it. [/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]trace(urunCont.getChildByName(“urun0”).testVar);[/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]when i want to trace it, i take this [/COLOR][/SIZE]
[SIZE=1][COLOR=slategray]1119: Access of possibly undefined property testVar through a reference with static type flash.display:DisplayObject.[/COLOR][/SIZE]

Last Edit : :slight_smile: i found problem, i should write: trace(MovieClip(this.urunCont.getChildByName(“urun1”)).[COLOR=#ff0000]testVar[/COLOR])