Ask a Question related to Macromedia Flex General Discussion, Design and Development.
-
machmila #1
dynamic id for component?
I'm using a repeater to create several textInputs on the stage. I'd like to
assign each textInput a unique ID but I keep getting an error msg with my
formatting. Is this possible? The error I get is
'['autoCompleteMgr_'+catRepeater.currentItem.catID] is not a valid identifier'
<mx:TextInput id="{'autoCompleteMgr_'+catRepeater.currentItem.ca tID}"
width="300" themeColor="#F85F02"/>
Thanks!
Amanda
machmila Guest
-
dynamic component positioning in Panel
Ok, here is the problem description which I have been trying to solve out for couple of weeks. I have a static ViewStack component in Flex... -
Dynamic Component
Hi, I need to instance component (Ex: cpn = new ComponentFromInternet()) and use it, but i don't how can i do this, only but ActionScript, i... -
Dynamic XML Schema and DataSet Component
Hello, I am trying to use a DataSet Component to hold data loaded from a SQL table. The design of my application requires that all components be... -
Dynamic Sound with a Media Component
Hello I'm having a little problem here. I am using Flash MX 2004 - Proffesional. I have a dynamic sound ("GavSound")loading in at the beginning... -
dynamic url from a component
i've searched this newsgroup as well as the aspnet newsgroup without an answer to this question. i call a web service from a component. i specify... -
greenhippo #2
Re: dynamic id for component?
One way you can do this is if you just give it an id, each individual element
can be accessed by treating that id as an array. Not exactly giving it a
completely dynamic id, but should be able to do everything using the array
<mx:Script>
<![CDATA[
public var repeaterData:Array = [10,20,30,40];
public function changeLabelText():void{
for(var i:int;i<repeaterData.length;i++){
myLabel[i].text=Math.random();
}
}
]]>
</mx:Script>
<mx:VBox>
<mx:Repeater id="myRepeater" dataProvider="{repeaterData}">
<mx:Label id="myLabel" text="{myRepeater.currentItem}"/>
</mx:Repeater>
<mx:Button click="changeLabelText()"/>
</mx:VBox>
greenhippo Guest



Reply With Quote

