settextformat function in as3
i am trying to apply setTextFormat function for my dynamic text filed in as 3,

but its not taking. Please have a look at my code and suggest me where i am going wrong.

   

    var name1:TextField = new TextField();
    addChild(name1);

     var format:TextFormat = new TextFormat();
    
    format.color = 0x000000;
                format.size = 18;
                format.underline = true;
                format.italic = true;
    
    function imagerollover(e:MouseEvent):void
    {
    
    	name1.setTextFormat(format);
    	 name1.visible = true;
    name1.text = myXML.data[Number(e.currentTarget.name)].@description; 
    
    
    		
    	} 

Am taking images and description from an external xml file.
settextformat function in as3
===

i am trying to apply setTextFormat function for my dynamic text filed in as 3,

but its not taking. Please have a look at my code and suggest me where i am going wrong.

   

    var name1:TextField = new TextField();
    addChild(name1);

     var format:TextFormat = new TextFormat();
    
    format.color = 0x000000;
                format.size = 18;
                format.underline = true;
                format.italic = true;
    
    function imagerollover(e:MouseEvent):void
    {
    
    	name1.setTextFormat(format);
    	 name1.visible = true;
    name1.text = myXML.data[Number(e.currentTarget.name)].@description; 
    
    
    		
    	} 

Am taking images and description from an external xml file.