Just a small eg as below.

#############################

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">

<mx:Script>

<![CDATA[

 

 function changeID(event){

            mx.controls.Alert.show("Original Id --- " + event.target.id);

            getChildAt(0).id = "testID";

 }

 

  function changeAlert(event){

            mx.controls.Alert.show("Changed Id --- " + getChildAt(0).id );

 }

]]>

</mx:Script>

<mx:Button id="abc" label="Button ABC" click="changeID(event);"></mx:Button>

<mx:Button id="testChangeID" label="Get New ID" click="changeAlert(event);"></mx:Button>

</mx:Application>

 

 

Thanks,

 

Shahn


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Ghislain Simard
Sent: Wednesday, September 14, 2005 7:16 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] change component name programatically

 

How to change the name of a compoent programatically and still keeping
the same attribute?

Script: Change Comp1 for ComponentA in the following line

<EEfrm:Comp1 id="comp1" var="{myVar}"/>

Thanks





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Software design and development Macromedia flex
Software development best practice


YAHOO! GROUPS LINKS




Reply via email to