Thank you in advance,
this is probably a dumb question...
I currently have XML loaded into a Tile List component. I have thumbnails and descriptions for each tile. The only problem is the show up right on top of each other, which is ok but I really want them to be aligned to the left and next to each other ...
This is my first time using the TIle List component, and I just don't understand how to format it!
I attached a screen shot so you can know what I"m talking about...
here's some code i'm using...
CODE TO LOAD XML:var xmlLoader2:URLLoader = new URLLoader();
xmlLoader2.addEventListener(Event.COMPLETE, xmlLoaded2);
xmlLoader2.load(new URLRequest("playlistXML_behind.xml"));
function xmlLoaded2(event:Event):void {
var playlistXML2:XML = new XML(event.target.data);
var item2:XML;
for each (item2 in playlistXML2.videoname) {
trace("item: "+item2.attribute("flvurl").toXMLString());
var thumbnail:String;
if (item2.hasOwnProperty("@thumbnail")>0) {
thumbnail = item2.@thumbnail;
}
myList2.addItem({label:item2.attribute("desc").toX MLString(),
data: item2.attribute("flvurl").toXMLString(),
source:thumbnail});
}
}
var myRootclose:MovieClip = root as MovieClip;
//Add a listener to detect when new video is selected and play it
function listListener2(event:Event) {
this.flv.my_player.play(event.target.selectedItem. data);
this.flv.my_player.visible=true;
myRootclose.closemenu_mc.visible=false;
myRootclose.titletext.visible=false;
}
myList2.addEventListener(Event.CHANGE, listListener2);
this.flv.my_player.addEventListener(VideoEvent.COM PLETE, vidComplete2);
import fl.video.VideoEvent;
// listen for complete event; play next video
function vidComplete2(eventObject:VideoEvent):void {
if (myList2.selectedIndex < myList2.length-1) {
myList2.selectedIndex = myList2.selectedIndex+1;
myList2.scrollToIndex(myList2.selectedIndex);
this.flv.my_player.play(myList2.selectedItem.data) ;
}
}
XML
<?xml version="1.0" encoding="iso-8859-1"?>
<playlist>
<videoname
flvurl="videos/Popeye_forPresiden256K_flash_popeye.mp4"
desc="VIdeo one"
thumbnail="thumbs/Popeye_forPresiden768K_001.jpg"
/>
<videoname
flvurl="videos/Popeye_forPresiden768K_001.flv"
desc="VIdeo one and a half"
thumbnail="thumbs/Popeye_forPresiden768K_001.jpg"
/>
<videoname
flvurl="videos/Popeye_forPresiden768K_002.flv"
desc="VIdeo two"
thumbnail="thumbs/Popeye_forPresiden768K_002.jpg"
/>
<videoname
flvurl="videos/Popeye_forPresiden768K_003.flv"
desc="VIdeo three"
thumbnail="thumbs/Popeye_forPresiden768K_003.jpg"
/>
<videoname
flvurl="videos/Popeye_forPresiden256kb_flash_004_sm.mp4"
desc="VIdeo four"
thumbnail="thumbs/Popeye_forPresiden768K_004.jpg"
/>
<videoname
flvurl="videos/Popeye_forPresiden768K_005.flv"
desc="VIdeo five"
thumbnail="thumbs/Popeye_forPresiden768K_005.jpg"
/>
<videoname
flvurl="videos/Popeye_forPresiden768K_005.flv"
desc="video six and bla bla bla"
thumbnail="thumbs/Popeye_forPresiden768K.jpg" />
</playlist>