flash xml playlist

  • fmike13
  • Born
  • Born
  • fmike13
  • Posts: 1

Post 3+ Months Ago

I am new to flash and I have a questions that I think should be pretty simple but I can't seem to figure it out. I'm creating a flash page with an xml video player, and my actionscript works fine, but I would like to add thumbnails to the playlist. Can anyone help me with that. Below is the actionscript that I am using.


Code: [ Select ]
import fl.video.FLVPlayback;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);

myList.addEventListener(Event.CHANGE, itemChange);

function itemChange(e:Event):void {
    //myPlayer.load(myList.selectedItem.data);
    myPlayer.play(""+myList.selectedItem.data);
}

var xml:XML;

function onLoaded(e:Event):void {

    xml = new XML(e.target.data);
    var il:XMLList = xml.channel.item;
    for (var i:uint=0; i<il.length(); i++) {
        myList.addItem({label:il.description.text()[i],
        data:il.title.text()[i]});
    }
}

loader.load(new URLRequest("VideoPlayerData.xml"));
myPlayer.addEventListener(Event.COMPLETE, nextFLV);
function nextFLV(e:Event):void {

    var ds = myList.selectedIndex;
    var dsl = myList.length;
    if (myList.selectedIndex == 0) {
        trace("if = yes: "+dsl);
        myList.selectedIndex = (+1);
        myPlayer.play(""+myList.selectedItem.data);
    } else {
        if ((ds+1) == dsl) {
            myList.selectedIndex = 0;
            myPlayer.play(""+myList.selectedItem.data);
        } else {
            trace("if = else");
            myList.selectedIndex = (ds+1);
            myPlayer.play(""+myList.selectedItem.data);
        }
    }
}
  1. import fl.video.FLVPlayback;
  2. var loader:URLLoader = new URLLoader();
  3. loader.addEventListener(Event.COMPLETE, onLoaded);
  4. myList.addEventListener(Event.CHANGE, itemChange);
  5. function itemChange(e:Event):void {
  6.     //myPlayer.load(myList.selectedItem.data);
  7.     myPlayer.play(""+myList.selectedItem.data);
  8. }
  9. var xml:XML;
  10. function onLoaded(e:Event):void {
  11.     xml = new XML(e.target.data);
  12.     var il:XMLList = xml.channel.item;
  13.     for (var i:uint=0; i<il.length(); i++) {
  14.         myList.addItem({label:il.description.text()[i],
  15.         data:il.title.text()[i]});
  16.     }
  17. }
  18. loader.load(new URLRequest("VideoPlayerData.xml"));
  19. myPlayer.addEventListener(Event.COMPLETE, nextFLV);
  20. function nextFLV(e:Event):void {
  21.     var ds = myList.selectedIndex;
  22.     var dsl = myList.length;
  23.     if (myList.selectedIndex == 0) {
  24.         trace("if = yes: "+dsl);
  25.         myList.selectedIndex = (+1);
  26.         myPlayer.play(""+myList.selectedItem.data);
  27.     } else {
  28.         if ((ds+1) == dsl) {
  29.             myList.selectedIndex = 0;
  30.             myPlayer.play(""+myList.selectedItem.data);
  31.         } else {
  32.             trace("if = else");
  33.             myList.selectedIndex = (ds+1);
  34.             myPlayer.play(""+myList.selectedItem.data);
  35.         }
  36.     }
  37. }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I believe this is what you need

http://www.adobe.com/devnet/flash/artic ... ad_05.html

Thought it was rather funny. Your same question at Adobe forums is already indexed by Google as the first result. I found that Adobe link as a secondary link under your result. Check out what I mean
http://www.google.com/search?source=ig& ... gle+Search

It was almost as if Google was answering your question for you. Really kinda spooky. *lol

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 7 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.