views:

56

answers:

1

The code below when it 1st load, i assign a pageName for selectedIDtext for it. And when the second time it loads I wanted to remove the data init and update with a new pageName. But no matter what I did i can't change and assign the 1st value that was loaded in the textfield.

selectedIDmc=new MovieClip();
selectedIDtext=new TextField();

selectedIDtext.defaultTextFormat=selectedIDformat;
selectedIDtext.wordWrap=true;

selectedIDtext.name="selectedName";
selectedIDtext.opaqueBackground=0x445566;
selectedIDtext.width=stage.stageWidth/3;
selectedIDtext.height=15;

function listClick(event:MouseEvent):void {
if (event.target.parent!=listArray[listArray.length-1]) {
for (var i:Number=clickedIndex+1; i<listArray.length; i++) {
    **selectedIDtext.text=""**
}
          pageName=event.target.getChildByName("listText").text;
          selectedIDtext.text=pageName;
}
A: 

instead of:

pageName=event.target.getChildByName("listText").text;
selectedIDtext.text=pageName;

try this

selectedIDtext.text=TextField(event.target).text;
Treby