[flexcoders] Re: addItem Trouble with TileList
Cool, yea didn't know if you wanted to remind and add or just remind. Cheers, -TH --- In flexcoders@yahoogroups.com, "s_hernandez01" wrote: > > Thanks again TH it works great I just adjusted it to an if..else.. > conditional statement to avoid it still adding the duplicate to the tiles on > the right. Appreciate it! > > -Sal > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > If you need to check dups for other reasons that would work fine. but, > > if you just need it for this particular use-case, this is simpler: > > > > public function addButton():void > > > > { > > > > > > if ( dataRight.getItemIndex( rightTiles.selectedItem ) != -1 ) > > Alert.show( "Already exists" ); > > > > > > > > > > > > dataRight.addItem( rightTiles.selectedItem ); > > > > } > > > > > > > > > > -TH > > > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" > > wrote: > > > > > > What about if I wanted to check for duplicates so that it will remind > > the user that this button already exists on the right? I came up with > > something like this, but doesn't work: > > > > > > public function addButton():void{ > > > dataRight.addItem(rightTiles.selectedItem); > > > checkDuplicates(); > > >} > > > > > >public function checkDuplicates():void{ > > > for(var i:int=0; i < dataRight.length; i++){ > > > if(dataLeft[i].id==dataRight[i].id){ > > > Alert.show("Already exists"); > > > } > > > } > > >} > > > > > > -Sal > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ > > wrote: > > > > > > > > hey thanks TH, i knew it was something with one line of code. You > > rock! This was driving me nuts. > > > > > > > > Sal > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > > Because guys like Gordon are here, I'll also say that Instantiate > > is the correct word; instead of initialize. :) > > > > > > > > > > -TH > > > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > > > > Man, I always forget at least one thing. You also need to > > initialize > > > > > > the second ArrayCollection(). > > > > > > > > > > > > > > > > > > [Bindable] public var dataRight:ArrayCollection= new > > ArrayCollection(); > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Might want to give the itemRenderer a background, so that the > > double > > > > > > clicks will be triggered on the entire area. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > > > > > > > > > > > > > Hey Sal, > > > > > > > minor tweaks: > > > > > > > > > > > > > > public function addButton():void > > > > > > > > > > > > > > { > > > > > > > > > > > > > > dataRight.addItem( rightTiles.selectedItem ); > > > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > and: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > url="buttonData.xml" > > > > > > > > > > > > > > useProxy="false" > > > > > > > > > > > > > > result="handleQueryResult(event)" > > > > > > > > > > > > > > showBusyCursor="true" > > > > > > > > > > > > > > resultFormat="object"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" > > s_hernandez01@ > > > > > > > wrote: > > > > > > > > > > > > > > > > I am having trouble understanding the addItem method in AS3 > > with > > > > > > Flex. > > > > > > > I'm trying to simply add the item renderer with all it's data > > from > > > > > > > tilelist to tilelist. I'm using two arraycollections to do > > the > > > > > > transfer > > > > > > > and the data is being populated through an xml file. I know > > it's just > > > > > > > maybe 2 or 3 lines of code that I probably need, but can > > someone help > > > > > > > me, please? Thanks > > > > > > > > > > > > > > > > > > > > > > > > // SAMPLE XML FILE > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > btnSkins/action_btn.png > > > > > > > > 10 > > > > > > > > > > > > > > > > > > > > > > > > btnSkins/awards_btn.png > > > > > > > > 15 > > > > > > > > > > > > > > > > > > > > > > > > btnSkins/beer_btn.png > > > > > > > > 20 > > > > > > > > > > > > > > > > > > > > > > > > btnSkins/blog_btn.png > > > > > > > > 25 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > // MAIN FILE > > > > > > > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; > > > > > > > layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > us
[flexcoders] Re: addItem Trouble with TileList
Thanks again TH it works great I just adjusted it to an if..else.. conditional statement to avoid it still adding the duplicate to the tiles on the right. Appreciate it! -Sal --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > If you need to check dups for other reasons that would work fine. but, > if you just need it for this particular use-case, this is simpler: > > public function addButton():void > > { > > > if ( dataRight.getItemIndex( rightTiles.selectedItem ) != -1 ) > Alert.show( "Already exists" ); > > > > > > dataRight.addItem( rightTiles.selectedItem ); > > } > > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" > wrote: > > > > What about if I wanted to check for duplicates so that it will remind > the user that this button already exists on the right? I came up with > something like this, but doesn't work: > > > > public function addButton():void{ > > dataRight.addItem(rightTiles.selectedItem); > > checkDuplicates(); > >} > > > >public function checkDuplicates():void{ > > for(var i:int=0; i < dataRight.length; i++){ > > if(dataLeft[i].id==dataRight[i].id){ > > Alert.show("Already exists"); > > } > > } > >} > > > > -Sal > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ > wrote: > > > > > > hey thanks TH, i knew it was something with one line of code. You > rock! This was driving me nuts. > > > > > > Sal > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > Because guys like Gordon are here, I'll also say that Instantiate > is the correct word; instead of initialize. :) > > > > > > > > -TH > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > > Man, I always forget at least one thing. You also need to > initialize > > > > > the second ArrayCollection(). > > > > > > > > > > > > > > > [Bindable] public var dataRight:ArrayCollection= new > ArrayCollection(); > > > > > > > > > > > > > > > > > > > > > > > > > Might want to give the itemRenderer a background, so that the > double > > > > > clicks will be triggered on the entire area. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > > > > > > > > > > Hey Sal, > > > > > > minor tweaks: > > > > > > > > > > > > public function addButton():void > > > > > > > > > > > > { > > > > > > > > > > > > dataRight.addItem( rightTiles.selectedItem ); > > > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > and: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > url="buttonData.xml" > > > > > > > > > > > > useProxy="false" > > > > > > > > > > > > result="handleQueryResult(event)" > > > > > > > > > > > > showBusyCursor="true" > > > > > > > > > > > > resultFormat="object"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" > s_hernandez01@ > > > > > > wrote: > > > > > > > > > > > > > > I am having trouble understanding the addItem method in AS3 > with > > > > > Flex. > > > > > > I'm trying to simply add the item renderer with all it's data > from > > > > > > tilelist to tilelist. I'm using two arraycollections to do > the > > > > > transfer > > > > > > and the data is being populated through an xml file. I know > it's just > > > > > > maybe 2 or 3 lines of code that I probably need, but can > someone help > > > > > > me, please? Thanks > > > > > > > > > > > > > > > > > > > > > // SAMPLE XML FILE > > > > > > > > > > > > > > > > > > > > > > > > > > > > btnSkins/action_btn.png > > > > > > > 10 > > > > > > > > > > > > > > > > > > > > > btnSkins/awards_btn.png > > > > > > > 15 > > > > > > > > > > > > > > > > > > > > > btnSkins/beer_btn.png > > > > > > > 20 > > > > > > > > > > > > > > > > > > > > > btnSkins/blog_btn.png > > > > > > > 25 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > // MAIN FILE > > > > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; > > > > > > layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > useProxy="false" > > > > > > > result="handleQueryResult(event)" showBusyCursor="true"/> > > > > > > > > > > > > > > > > > > > dataProvider="{dataLeft}" itemRenderer="ipodThumb" > columnWidth="94" > > > > > > rowHeight="80" > > > > > > > doubleClickEnabled="true" doubleClick="addButton()"/> > > > > > > > > > > > > > > > > > > > dataProvider="{dataRight}" itemRenderer="ipodThumb" > columnWidth="94" > > > > > > rowHeight="80"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > // ITEM RENDERER > > > > > > > > > >
[flexcoders] Re: addItem Trouble with TileList
If you need to check dups for other reasons that would work fine. but, if you just need it for this particular use-case, this is simpler: public function addButton():void { if ( dataRight.getItemIndex( rightTiles.selectedItem ) != -1 ) Alert.show( "Already exists" ); dataRight.addItem( rightTiles.selectedItem ); } -TH --- In flexcoders@yahoogroups.com, "s_hernandez01" wrote: > > What about if I wanted to check for duplicates so that it will remind the user that this button already exists on the right? I came up with something like this, but doesn't work: > > public function addButton():void{ > dataRight.addItem(rightTiles.selectedItem); > checkDuplicates(); >} > >public function checkDuplicates():void{ > for(var i:int=0; i < dataRight.length; i++){ > if(dataLeft[i].id==dataRight[i].id){ > Alert.show("Already exists"); > } > } >} > > -Sal > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ wrote: > > > > hey thanks TH, i knew it was something with one line of code. You rock! This was driving me nuts. > > > > Sal > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > Because guys like Gordon are here, I'll also say that Instantiate is the correct word; instead of initialize. :) > > > > > > -TH > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > Man, I always forget at least one thing. You also need to initialize > > > > the second ArrayCollection(). > > > > > > > > > > > > [Bindable] public var dataRight:ArrayCollection= new ArrayCollection(); > > > > > > > > > > > > > > > > > > > > Might want to give the itemRenderer a background, so that the double > > > > clicks will be triggered on the entire area. > > > > > > > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > > > > > > > Hey Sal, > > > > > minor tweaks: > > > > > > > > > > public function addButton():void > > > > > > > > > > { > > > > > > > > > > dataRight.addItem( rightTiles.selectedItem ); > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > > > > > > and: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > url="buttonData.xml" > > > > > > > > > > useProxy="false" > > > > > > > > > > result="handleQueryResult(event)" > > > > > > > > > > showBusyCursor="true" > > > > > > > > > > resultFormat="object"/> > > > > > > > > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ > > > > > wrote: > > > > > > > > > > > > I am having trouble understanding the addItem method in AS3 with > > > > Flex. > > > > > I'm trying to simply add the item renderer with all it's data from > > > > > tilelist to tilelist. I'm using two arraycollections to do the > > > > transfer > > > > > and the data is being populated through an xml file. I know it's just > > > > > maybe 2 or 3 lines of code that I probably need, but can someone help > > > > > me, please? Thanks > > > > > > > > > > > > > > > > > > // SAMPLE XML FILE > > > > > > > > > > > > > > > > > > > > > > > > btnSkins/action_btn.png > > > > > > 10 > > > > > > > > > > > > > > > > > > btnSkins/awards_btn.png > > > > > > 15 > > > > > > > > > > > > > > > > > > btnSkins/beer_btn.png > > > > > > 20 > > > > > > > > > > > > > > > > > > btnSkins/blog_btn.png > > > > > > 25 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > // MAIN FILE > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; > > > > > layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > result="handleQueryResult(event)" showBusyCursor="true"/> > > > > > > > > > > > > > > > > dataProvider="{dataLeft}" itemRenderer="ipodThumb" columnWidth="94" > > > > > rowHeight="80" > > > > > > doubleClickEnabled="true" doubleClick="addButton()"/> > > > > > > > > > > > > > > > > dataProvider="{dataRight}" itemRenderer="ipodThumb" columnWidth="94" > > > > > rowHeight="80"/> > > > > > > > > > > > > > > > > > > > > > > > > // ITEM RENDERER > > > > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="108" > > > > > height="83"> > > > > > > > > > > > > > > > > horizontalAlign="center" right="5" bottom="0" left="5" top="0"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
[flexcoders] Re: addItem Trouble with TileList
What about if I wanted to check for duplicates so that it will remind the user that this button already exists on the right? I came up with something like this, but doesn't work: public function addButton():void{ dataRight.addItem(rightTiles.selectedItem); checkDuplicates(); } public function checkDuplicates():void{ for(var i:int=0; i < dataRight.length; i++){ if(dataLeft[i].id==dataRight[i].id){ Alert.show("Already exists"); } } } -Sal --- In flexcoders@yahoogroups.com, "s_hernandez01" wrote: > > hey thanks TH, i knew it was something with one line of code. You rock! This > was driving me nuts. > > Sal > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > Because guys like Gordon are here, I'll also say that Instantiate is the > > correct word; instead of initialize. :) > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > Man, I always forget at least one thing. You also need to initialize > > > the second ArrayCollection(). > > > > > > > > > [Bindable] public var dataRight:ArrayCollection= new ArrayCollection(); > > > > > > > > > > > > > > > Might want to give the itemRenderer a background, so that the double > > > clicks will be triggered on the entire area. > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > > > > Hey Sal, > > > > minor tweaks: > > > > > > > > public function addButton():void > > > > > > > > { > > > > > > > > dataRight.addItem( rightTiles.selectedItem ); > > > > > > > > } > > > > > > > > > > > > > > > > > > > > and: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > url="buttonData.xml" > > > > > > > > useProxy="false" > > > > > > > > result="handleQueryResult(event)" > > > > > > > > showBusyCursor="true" > > > > > > > > resultFormat="object"/> > > > > > > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ > > > > wrote: > > > > > > > > > > I am having trouble understanding the addItem method in AS3 with > > > Flex. > > > > I'm trying to simply add the item renderer with all it's data from > > > > tilelist to tilelist. I'm using two arraycollections to do the > > > transfer > > > > and the data is being populated through an xml file. I know it's just > > > > maybe 2 or 3 lines of code that I probably need, but can someone help > > > > me, please? Thanks > > > > > > > > > > > > > > > // SAMPLE XML FILE > > > > > > > > > > > > > > > > > > > > btnSkins/action_btn.png > > > > > 10 > > > > > > > > > > > > > > > btnSkins/awards_btn.png > > > > > 15 > > > > > > > > > > > > > > > btnSkins/beer_btn.png > > > > > 20 > > > > > > > > > > > > > > > btnSkins/blog_btn.png > > > > > 25 > > > > > > > > > > > > > > > > > > > > > > > > > // MAIN FILE > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; > > > > layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > result="handleQueryResult(event)" showBusyCursor="true"/> > > > > > > > > > > > > > dataProvider="{dataLeft}" itemRenderer="ipodThumb" columnWidth="94" > > > > rowHeight="80" > > > > > doubleClickEnabled="true" doubleClick="addButton()"/> > > > > > > > > > > > > > dataProvider="{dataRight}" itemRenderer="ipodThumb" columnWidth="94" > > > > rowHeight="80"/> > > > > > > > > > > > > > > > > > > > > // ITEM RENDERER > > > > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="108" > > > > height="83"> > > > > > > > > > > > > > horizontalAlign="center" right="5" bottom="0" left="5" top="0"/> > > > > > > > > > > > > > > > > > > > > > > > > >
[flexcoders] Re: addItem Trouble with TileList
hey thanks TH, i knew it was something with one line of code. You rock! This was driving me nuts. Sal --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > Because guys like Gordon are here, I'll also say that Instantiate is the > correct word; instead of initialize. :) > > -TH > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > Man, I always forget at least one thing. You also need to initialize > > the second ArrayCollection(). > > > > > > [Bindable] public var dataRight:ArrayCollection= new ArrayCollection(); > > > > > > > > > > Might want to give the itemRenderer a background, so that the double > > clicks will be triggered on the entire area. > > > > > > > > > > > > -TH > > > > > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > > > > Hey Sal, > > > minor tweaks: > > > > > > public function addButton():void > > > > > > { > > > > > > dataRight.addItem( rightTiles.selectedItem ); > > > > > > } > > > > > > > > > > > > > > > and: > > > > > > > > > > > > > > > > > > > > > > > > > > url="buttonData.xml" > > > > > > useProxy="false" > > > > > > result="handleQueryResult(event)" > > > > > > showBusyCursor="true" > > > > > > resultFormat="object"/> > > > > > > > > > > > > > > > -TH > > > > > > > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ > > > wrote: > > > > > > > > I am having trouble understanding the addItem method in AS3 with > > Flex. > > > I'm trying to simply add the item renderer with all it's data from > > > tilelist to tilelist. I'm using two arraycollections to do the > > transfer > > > and the data is being populated through an xml file. I know it's just > > > maybe 2 or 3 lines of code that I probably need, but can someone help > > > me, please? Thanks > > > > > > > > > > > > // SAMPLE XML FILE > > > > > > > > > > > > > > > > btnSkins/action_btn.png > > > > 10 > > > > > > > > > > > > btnSkins/awards_btn.png > > > > 15 > > > > > > > > > > > > btnSkins/beer_btn.png > > > > 20 > > > > > > > > > > > > btnSkins/blog_btn.png > > > > 25 > > > > > > > > > > > > > > > > > > > > // MAIN FILE > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; > > > layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > > > > > > > > > > > > > > > > > > > > > > result="handleQueryResult(event)" showBusyCursor="true"/> > > > > > > > > > > dataProvider="{dataLeft}" itemRenderer="ipodThumb" columnWidth="94" > > > rowHeight="80" > > > > doubleClickEnabled="true" doubleClick="addButton()"/> > > > > > > > > > > dataProvider="{dataRight}" itemRenderer="ipodThumb" columnWidth="94" > > > rowHeight="80"/> > > > > > > > > > > > > > > > > // ITEM RENDERER > > > > > > > > > > > > http://www.adobe.com/2006/mxml"; width="108" > > > height="83"> > > > > > > > > > > horizontalAlign="center" right="5" bottom="0" left="5" top="0"/> > > > > > > > > > > > > > > > > > >
[flexcoders] Re: addItem Trouble with TileList
Because guys like Gordon are here, I'll also say that Instantiate is the correct word; instead of initialize. :) -TH --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > Man, I always forget at least one thing. You also need to initialize > the second ArrayCollection(). > > > [Bindable] public var dataRight:ArrayCollection= new ArrayCollection(); > > > > > Might want to give the itemRenderer a background, so that the double > clicks will be triggered on the entire area. > > > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > > > > Hey Sal, > > minor tweaks: > > > > public function addButton():void > > > > { > > > > dataRight.addItem( rightTiles.selectedItem ); > > > > } > > > > > > > > > > and: > > > > > > > > > > > > > > > > > url="buttonData.xml" > > > > useProxy="false" > > > > result="handleQueryResult(event)" > > > > showBusyCursor="true" > > > > resultFormat="object"/> > > > > > > > > > > -TH > > > > > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ > > wrote: > > > > > > I am having trouble understanding the addItem method in AS3 with > Flex. > > I'm trying to simply add the item renderer with all it's data from > > tilelist to tilelist. I'm using two arraycollections to do the > transfer > > and the data is being populated through an xml file. I know it's just > > maybe 2 or 3 lines of code that I probably need, but can someone help > > me, please? Thanks > > > > > > > > > // SAMPLE XML FILE > > > > > > > > > > > > btnSkins/action_btn.png > > > 10 > > > > > > > > > btnSkins/awards_btn.png > > > 15 > > > > > > > > > btnSkins/beer_btn.png > > > 20 > > > > > > > > > btnSkins/blog_btn.png > > > 25 > > > > > > > > > > > > > > > // MAIN FILE > > > > > > > > > http://www.adobe.com/2006/mxml"; > > layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > > > > > > > > > > > > > > > result="handleQueryResult(event)" showBusyCursor="true"/> > > > > > > > dataProvider="{dataLeft}" itemRenderer="ipodThumb" columnWidth="94" > > rowHeight="80" > > > doubleClickEnabled="true" doubleClick="addButton()"/> > > > > > > > dataProvider="{dataRight}" itemRenderer="ipodThumb" columnWidth="94" > > rowHeight="80"/> > > > > > > > > > > > > // ITEM RENDERER > > > > > > > > > http://www.adobe.com/2006/mxml"; width="108" > > height="83"> > > > > > > > horizontalAlign="center" right="5" bottom="0" left="5" top="0"/> > > > > > > > > > > > >
[flexcoders] Re: addItem Trouble with TileList
Man, I always forget at least one thing. You also need to initialize the second ArrayCollection(). [Bindable] public var dataRight:ArrayCollection= new ArrayCollection(); Might want to give the itemRenderer a background, so that the double clicks will be triggered on the entire area. -TH --- In flexcoders@yahoogroups.com, "turbo_vb" wrote: > > > Hey Sal, > minor tweaks: > > public function addButton():void > > { > > dataRight.addItem( rightTiles.selectedItem ); > > } > > > > > and: > > > > > > > > url="buttonData.xml" > > useProxy="false" > > result="handleQueryResult(event)" > > showBusyCursor="true" > > resultFormat="object"/> > > > > > -TH > > > > --- In flexcoders@yahoogroups.com, "s_hernandez01" s_hernandez01@ > wrote: > > > > I am having trouble understanding the addItem method in AS3 with Flex. > I'm trying to simply add the item renderer with all it's data from > tilelist to tilelist. I'm using two arraycollections to do the transfer > and the data is being populated through an xml file. I know it's just > maybe 2 or 3 lines of code that I probably need, but can someone help > me, please? Thanks > > > > > > // SAMPLE XML FILE > > > > > > > > btnSkins/action_btn.png > > 10 > > > > > > btnSkins/awards_btn.png > > 15 > > > > > > btnSkins/beer_btn.png > > 20 > > > > > > btnSkins/blog_btn.png > > 25 > > > > > > > > > > // MAIN FILE > > > > > > http://www.adobe.com/2006/mxml"; > layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > > > > > > > > result="handleQueryResult(event)" showBusyCursor="true"/> > > > > dataProvider="{dataLeft}" itemRenderer="ipodThumb" columnWidth="94" > rowHeight="80" > > doubleClickEnabled="true" doubleClick="addButton()"/> > > > > dataProvider="{dataRight}" itemRenderer="ipodThumb" columnWidth="94" > rowHeight="80"/> > > > > > > > > // ITEM RENDERER > > > > > > http://www.adobe.com/2006/mxml"; width="108" > height="83"> > > > > horizontalAlign="center" right="5" bottom="0" left="5" top="0"/> > > > > > > >
[flexcoders] Re: addItem Trouble with TileList
Hey Sal, minor tweaks: public function addButton():void { dataRight.addItem( rightTiles.selectedItem ); } and: -TH --- In flexcoders@yahoogroups.com, "s_hernandez01" wrote: > > I am having trouble understanding the addItem method in AS3 with Flex. I'm trying to simply add the item renderer with all it's data from tilelist to tilelist. I'm using two arraycollections to do the transfer and the data is being populated through an xml file. I know it's just maybe 2 or 3 lines of code that I probably need, but can someone help me, please? Thanks > > > // SAMPLE XML FILE > > > > btnSkins/action_btn.png > 10 > > > btnSkins/awards_btn.png > 15 > > > btnSkins/beer_btn.png > 20 > > > btnSkins/blog_btn.png > 25 > > > > > // MAIN FILE > > > http://www.adobe.com/2006/mxml"; layout="horizontal" creationComplete="btnSrv.send()"> > > > > > > result="handleQueryResult(event)" showBusyCursor="true"/> > > doubleClickEnabled="true" doubleClick="addButton()"/> > > > > > > // ITEM RENDERER > > > http://www.adobe.com/2006/mxml"; width="108" height="83"> > > > > >