Not sure why second message was also truncated. Let's
try this again...
----------
Thanks for your interest and notice, Scott. To recap:
I have a TileList that shows images and their names,
read from an XML file and rendered by a CellRenderer.
When the [Add Photo] button is clicked, a createPopUp
is called. This PopUp also has a TileList that reads
another XML file with the same structure (but
different data.) Images can be selected, and when the
[Add] button is clicked selected images should be
added to the main TileList's model. However, something
is added to the TileList, but it only shows blank
tiles/undefined...

Here is the code again...

---------- XML file, both look similar ----------
<?xml version="1.0" encoding="utf-8"?>
  <photos>
   <photo><filename>image01.jpg</filename></photo>
   <photo><filename>image02.jpg</filename></photo>
   <photo><filename>image03.jpg</filename></photo>
  </photos>

---------- TileList that I want to add images in
----------
<mx:Script>
<![CDATA[
    function showImage() {
        var
popup=mx.managers.PopUpManager.createPopUp(_root,
imageBrowser, true);
    }
]]>
</mx:Script>
...
    <mx:Model id="modelImage2" source="photos2.xml"/>
     <mx:TileList id="tilelistImage"
dataProvider="{modelImage2.photo}"
cellRenderer="thumbnail2"
change="{showSelected(tilelistImage.selectedItem)}"
multipleSelection="true"/>
    <mx:Button label="Add Photo" click="showImage()"/>

---------- TileList that I want to bring images from
----------
<mx:Script>
<![CDATA[
    function addLibrary():Void {
        for (var i=0;
i<tilelistAllImage.selectedIndices.length; i++) {
           
_root.modelImage2.photo.addItemAt(0,"",tilelistAllImage.selectedItems[i]);
        }
         _root.tilelistImage.sortItems();
        this.deletePopUp();
    }
]]>
</mx:Script>

    <mx:Model id="modelImage" source="photos.xml"/>
    <mx:TileList id="tilelistAllImage"
dataProvider="{modelImage.photo}"
cellRenderer="thumbnail2"
change="{anySelected(tilelistAllImage.selectedItem)}"
multipleSelection="true"/>
    <mx:Button label="Add" id="btAdd"
click="addLibrary()"/>

---------- CellRenderer ----------
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox
xmlns:mx="http://www.macromedia.com/2003/mxml";
width="72" height="86" horizontalAlign="center"
verticalAlign="middle" horizontalGap="0"
verticalGap="0" borderStyle="none" hScrollPolicy="off"
vScrollPolicy="off">
    <mx:Script>
        var photoObj:Object;
        function setValue(str:String,item:Object) {
            if (item==undefined) {
                visible=false;
                return;
            } else {
                photoObj=item;
                visible=true;
            }
        }
    </mx:Script>
    <mx:Image source="{photoObj.filename}" width="64"
height="64" verticalAlign="middle"
horizontalAlign="center"/>
    <mx:Label text="{photoObj.filename}" width="72"
textAlign="center" fontSize="10"/>
</mx:VBox>

--------------------
Any idea why it adds blank, undefined tile here?

TIA,
- ptrisnadi


                
____________________________________________________
Sell on Yahoo! Auctions – no fees. Bid on great items.  
http://auctions.yahoo.com/


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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to