XML video Playlist

I've created an XML video playlist like the one shown in this
tutorial:
http://www.adobe.com/devnet/flash/articles/prog_download.html
I was wondering how I could edit it to autoplay the first
item in the list upon loading, but still have the list be
completely functional. I've tried everything I can think of, but
can't get it to autoplay and still work.
Thanks!

this just uses a xml playlist and listbox component.i seen a
tutorial on one with thumbnails...if i run across it again ill post
the link.maybe this will get you started.
http://www.video-animation.com/flash8_016.shtml

Similar Messages

  • Please help. Trying to create external xml vidoe playlist. Desperate!

    I was given an assignment to  create and external video playlist using an xml file.  I have never used  flash before, know nothing about encoding and all that was given to the  class in terms of instuctions was a short tutorial that has no  resources for troubleshooting.  We were given everything; the external  playlist file equipped with the video skin, the video list, actionscript  that loads the xml and the xml file.  We were told that all we need to  do is change the names of the videos in the xml file to match the names  of our videos.  I did that.  We were also told we needed to "name  target", but we were not informed on how to do this.  I have tried  everything, visited every tutorial and I cannot figure out how to get  this damn thing to work.  I cannot even get flash to load the xml file.  PLEASE HELP.
    Here is the xml file:
    <?xml version = "1.0" encoding = "i-8859-1"?>
    <playlist>
    <ADogWithoutABone
    flvurl="ADogWithoutABone.flv"
    desc="Hyper Wall First Video" />
    <Highway
    flvurl="Highway.flv"
    desc="Hyper Wall Second Video" />
    <PsychoBabble
    flvurl="PsychoBabble.flv"
    desc="Hyper Wall Third Video" />
    <SomethingElse
    flvurl="SomethingElse.flv"
    desc="Hyper Wall Fourth Video" />
    </playlist>
    I tried putting in the entire address of the file location, but it did nothing.
    Here is the actionscript in the flash file:
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    xmlLoader.load(new URLRequest("playlistXML.xml"));
    function xmlLoaded(event:Event):void {
    var playlistXML:XML = new XML(event.target.data);
    var item:XML;
    for each(item in playlistXML.videoname) {
    trace("item: "+item.attribute("flvurl").toXMLString());
    myPlayList.addItem({label:item.attribute("desc").toXMLString(), data:item.attribute("flvurl").toXMLString()});
    //Select the first video
    myPlayList.selectedIndex = 0;
    //And automatically play it
    myPlayScreen.play(myPlayList.selectedItem.data);
    //Add a listener to detect when new video is selected and play it
    function listListener(event:Event) {
    myPlayScreen.play(event.target.selectedItem.data);
    myPlayList.addEventListener(Event.CHANGE, listListener);
    I  tried placing the full address of the xml file in, along with the file  address of the videos, but again it did nothing.  Everything is located  in the same file, and the videos in a sub file in that file. I tried  taking out the sub file and putting all the videos in the same file, but  it did nothing.  I am sure it's something very simple, but like I said I  have NO experience with this whatsoever. I am SO lost and DESPERATELY  need help. PLEASE someone SAVE MEEEE!
    Thanks

    to parse your xml correctly use:
    function xmlLoaded(event:Event):void {
        var playlistXML:XML=new XML(event.target.data);
        var item:XML;
        for each (item in playlistXML.children()) {
            trace("node: "+item.attribute("flvurl").toXMLString());
            myPlayList.addItem({label:item.attribute("desc").toXMLString(), data:item.attribute("flvurl").toXMLString()});
        //Select the first video
        myPlayList.selectedIndex=0;
        //And automatically play it
        myPlayScreen.play(myPlayList.selectedItem.data);
    you more problems after that, though.  is myPlayList a list component?

  • URGENT help needed in creating external xml video plalist. Please help!

    I was given an assignment to  create and external video playlist using an xml file.  I have never used  flash before, know nothing about encoding and all that was given to the  class in terms of instuctions was a short tutorial that has no  resources for troubleshooting.  We were given everything; the external  playlist file equipped with the video skin, the video list, actionscript  that loads the xml and the xml file.  We were told that all we need to  do is change the names of the videos in the xml file to match the names  of our videos.  I did that.  We were also told we needed to "name  target", but we were not informed on how to do this.  I have tried  everything, visited every tutorial and I cannot figure out how to get  this damn thing to work.  I cannot even get flash to load the xml file.  PLEASE HELP.
    Here is the xml file:
    <?xml version = "1.0" encoding = "i-8859-1"?>
    <playlist>
    <ADogWithoutABone
    flvurl="ADogWithoutABone.flv"
    desc="Hyper Wall First Video" />
    <Highway
    flvurl="Highway.flv"
    desc="Hyper Wall Second Video" />
    <PsychoBabble
    flvurl="PsychoBabble.flv"
    desc="Hyper Wall Third Video" />
    <SomethingElse
    flvurl="SomethingElse.flv"
    desc="Hyper Wall Fourth Video" />
    </playlist>
    I tried putting in the entire address of the file location, but it did nothing.
    Here is the actionscript in the flash file:
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    xmlLoader.load(new URLRequest("playlistXML.xml"));
    function xmlLoaded(event:Event):void {
    var playlistXML:XML = new XML(event.target.data);
    var item:XML;
    for each(item in playlistXML.videoname) {
    trace("item: "+item.attribute("flvurl").toXMLString());
    myPlayList.addItem({label:item.attribute("desc").toXMLString(), data:item.attribute("flvurl").toXMLString()});
    //Select the first video
    myPlayList.selectedIndex = 0;
    //And automatically play it
    myPlayScreen.play(myPlayList.selectedItem.data);
    //Add a listener to detect when new video is selected and play it
    function listListener(event:Event) {
    myPlayScreen.play(event.target.selectedItem.data);
    myPlayList.addEventListener(Event.CHANGE, listListener);
    I  tried placing the full address of the xml file in, along with the file  address of the videos, but again it did nothing.  Everything is located  in the same file, and the videos in a sub file in that file. I tried  taking out the sub file and putting all the videos in the same file, but  it did nothing.  I am sure it's something very simple, but like I said I  have NO experience with this whatsoever. I am SO lost and DESPERATELY  need help. PLEASE someone SAVE MEEEE!
    Thanks

    It might be a crossdomain.xml problem.
    Please make sure that the server hosting the xml allows the domain where the swf is hosted.
    You can start with:
    <?xml version="1.0" encoding="utf-8" ?>
    <cross-domain-policy>
        <allow-access-from domain="*"/>
        <site-control permitted-cross-domain-policies="master-only"/>
    </cross-domain-policy>

  • Need help with xml video gallery

    Hello everyone
    I recently bought a xml video gallery. I'm loading the movie externally into another movie. When the xml gallery loads, it cancels all sounds.
    I need to figure out where in the actionscription can i reverse the cancellation of sounds. Can anyone help? if possible, I can email, whomever is willing to help, the xml gallery to see if theres another reason the sound is being canceled.
    Also, the sound of the gallery doesn't work til you click the volume scroller.
    Here are two parts of actionscript included in the gallery:
    part one:
    // Import filter classes
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    // Set flash variables
    var xmlFileUrl:String = "playlist.xml";
    var auto_play:String = "true";
    // Set xml file URL
    if (_root.xmlfile) {
        xmlFileUrl = _root.xmlfile;
    var V_SRC;
    var thuArray:Array = new Array();
    var currentVideo:Number = 0;
    var totalItems;
    var numOfItems:Number;
    var itemDistance:Number = 120+5;
    var itemHeight:Number = 80+2;
    var Value:Number = 1;
    var boundry:Number = 1;
    var ratio:Number = 1;
    var diff:Number = 1;
    var collectionWidth:Number = 1;
    var buffer:Number = 135*2;
    this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
    video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
    video_txt.theText.selectable = false;
    video_txt.theText.autoSize = "left";
    //The Format
    myFormat = new TextFormat();
    myFormat.font = _root.font_format;
    myFormat.size = _root.font_size;
    myFormat.color = _root.font_color;
    myFormat.align = "center";
    video_txt.theText.setNewTextFormat(myFormat);
    // Create a new movieclip to load the thumbs
    var thumbLoader:MovieClipLoader = new MovieClipLoader();
    var thumbListener:Object = new Object();
    thumbLoader.addListener(thumbListener);
    thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
        new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
        target_mc._parent.preloader_mc._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = xmlLoaded;
    xml.load(xmlFileUrl);
    // Load the xml file into the player
    function xmlLoaded(b:Boolean) {
        if (b) {
            auto_play = this.firstChild.firstChild.attributes.auto_play;
            scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
            totalItems = this.firstChild.firstChild.childNodes;
            numOfItems = totalItems.length;
            for (j=0; j<numOfItems; j++) {
                var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
                i._x = itemDistance*j;
                thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
                i.id = j;
                i.videoTitle = totalItems[j].attributes.title;
                i.videoUrl = totalItems[j].attributes.src;
                // Create an event for thumb rollover
                i.onRollOver = iRoll;
                i.onRollOut = i.onReleaseOutside=iOut;
                i.onRelease = iRelease;
                thuArray[j] = i;
            // default first video
            collectionWidth = player_mc.main_mc.collection_mc._width;
            currentVideo = 0;
            V_SRC = thuArray[0].videoUrl;
            changeVideo();
            //scope._alpha = 100;
            new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
        else
            trace("Error! xml file not loaded");
    // onRollOver Events
    function iRoll() {
        player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
        this.light_mc.play();
    function iRelease() {
        currentVideo = this.id;
        changeVideo();
    function changeVideo() {
        V_SRC = thuArray[currentVideo].videoUrl;
        player_mc.loadVideo();
        currentThumb();
        player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
        video_txt.theText.text = totalItems[currentVideo].attributes.title;
        player_mc.so.getVolume();
        player_mc.playStatus = 1;
        player_mc.checkStatus();
    function nextVideo() {
        if (currentVideo<(numOfItems-1)) {
            currentVideo++;
        } else {
            currentVideo = 0;
        changeVideo();
    function currentThumb() {
        for (i=0; i<thuArray.length; i++) {
            if (i == currentVideo) {
                thuArray[i].enabled = true;
    // Mouse movement on rollover
    this.onMouseMove = function() {
        collectionWidth = player_mc.main_mc.collection_mc._width;
        boundry = player_mc.main_mc.area_mc._width;
        if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
            if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
                ratio = player_mc.main_mc._xmouse/boundry;
                diff = (collectionWidth-boundry)+buffer;
                Value = Math.floor((-ratio)*diff)+(buffer/2);
        updateAfterEvent();
    this.onEnterFrame = function() {
        // Define movement area and speed
        if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
            player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.collection_mc._ x)/scrollSpeed));
            if (player_mc.main_mc.collection_mc._x>0) {
                player_mc.main_mc.collection_mc._x = 0;
            } else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_mc.main_mc. collection_mc._width))) {
                player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._width));
        } else {
            player_mc.main_mc.collection_mc._x = 0;
        updateAfterEvent();
    part two:
    // Define flash variables
    var video_url:String = "";
    var tempx:Number = this._parent._x;
    var tempy:Number = this._parent._y;
    var timeCounter:Number = 0;
    var timeInSeconds:Number = _root.time_counter;
    // Object to listen to onStage Event
    videoObj = vid.videoObj;
    // Setting up the connection
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    // Buffer time
    ns.setBufferTime (10);
    videoObj.attachVideo (ns);
    function loadVideo () {
        video_url = _parent.V_SRC;
        trace(video_url);
        ns.play (video_url);
    function checkStatus()
        if (playStatus == 1)
            controls_mc.playPause.gotoAndStop("pause");
            mc_playAgain._visible = false;
            thumbs_out = false;
            title_out = false;
        else
            controls_mc.playPause.gotoAndStop("play");
            mc_playAgain._visible = true;
        } // end else if
        if (so.getVolume() == 0)
            controls_mc.mute_mc.gotoAndStop("mute");
        else
            controls_mc.mute_mc.gotoAndStop("on");
    }; // End of the function
    mc_playAgain._visible = false;
    // Check Status of video
    ns.onStatus = function (info)
        if (info.code == "NetStream.Buffer.Empty")
            mc_buffer._visible = true;
        else if (info.code == "NetStream.Buffer.Full")
            mc_buffer._visible = false;
        else if (info.code == "NetStream.Play.Stop")
            ns.seek(0);
            if (playStatus == 1)
                ns.pause();
                playStatus = 0;
            else
                trace;
            } // end else if
            mc_playAgain._visible = true;
            mc_buffer._visible = false;
            thumbs_out = true;
            title_out = true;
            checkStatus();
        } // end else if
    // Get info about video
    ns.onMetaData = function(infoObject:Object)
        FLVduration = infoObject["duration"];
        relationshipW = infoObject.height / infoObject.width;
        relationshipH = infoObject.width / infoObject.height;
        if (Stage["displayState"] == "fullScreen")
            largeSize ();
        else
            regularSize ();
        if (_parent.auto_play == "false")
            ns.seek(0);
            if (playStatus == 1)
                ns.pause();
                playStatus = 0;
            mc_buffer._visible = false;
            controls_mc.playPause.gotoAndStop("play");
            mc_playAgain._visible = true;
            thumbs_out = true;
            title_out = true;
            _parent.auto_play = "true";
        }// end else if
    var videoInterval = setInterval(videoStatus, 100);
    var amountLoaded;
    var duration;
    // videoStatus on load Event
    function videoStatus()
        amountLoaded = ns.bytesLoaded / ns.bytesTotal;
        controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
        controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
        controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
    }; // End of the function
    function scrubIt()
        ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
    }; // End of the function
    // video time
    var time_interval:Number = setInterval(checkTime, 500, ns);
    function checkTime(ns:NetStream) {
        //current time
        var ns_seconds:Number = ns.time;
        var minutes:Number = Math.floor(ns_seconds/60);
        var seconds = Math.floor(ns_seconds%60);
        sec = seconds;
        min = minutes;
        if (sec<10) {
            sec = "0"+sec;
        if (min<10) {
            min = "0"+min;
        controls_mc.time_txt.time_1.text = min+":"+sec;
        //total time
        var minutes2:Number = Math.floor(FLVduration/60);
        var seconds2 = Math.floor(FLVduration%60);
        sec2 = seconds2;
        min2 = minutes2;
        if (sec2<10) {
            sec2 = "0"+sec2;
        if (min2<10) {
            min2 = "0"+min2;
        controls_mc.time_txt.time_2.text = min2+":"+sec2;
        if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
            controls_mc.time_txt.time_2.text = "00:00";
    setStage ();
    // Object to listen onStage Event
    var stageL:Object = new Object ();
    // function respnsible for content alignment
    function setStage ()
        if (Stage["displayState"] == "fullScreen") {
            tempx = this._parent._x;
            tempy = this._parent._y;
            this._parent._x = 0;
            this._parent._y = 0;
            vidBg_mc._x = 0;
            vidBg_mc._y = 0;
            mc_title._x = 0;
            mc_title._y = -30;
            slide_me._x = 0;
            slide_me._y = 0;
            vidBg_mc._width = Stage.width;
            vidBg_mc._height = Stage.height;
            mc_title._width = Stage.width;
            mc_title._height = Stage.height / 20;
            slide_me._width = Stage.width;
            slide_me._height = Stage.height / 20;
            vid._x = vid._y = 0;
            largeSize ();
            controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
            controls_mc._y = Math.round (Stage.height - 36);
            mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
            mc_playAgain._y = Math.round (Stage.height - 572);
            thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
            thumbs_mc._y = Math.round (Stage.height - 115);
            main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
            hide_mc.onEnterFrame = function () {
                timeCounter = timeCounter + 1;
                if (timeCounter >= timeInSeconds * 30) {
                    timeCounter = 0;
                    controls_mc._alpha = 0;
            this.onMouseMove = function () {
                timeCounter = 0;
                controls_mc._alpha = 100;
        else
            delete hide_mc.onEnterFrame;
            delete this.onMouseMove;
            controls_mc._alpha = 100;
            this._parent._x = tempx;
            this._parent._y = tempy;
            vidBg_mc._width = 600;
            vidBg_mc._height = 360;
            mc_title._width = 600;
            mc_title._height = 30;
            slide_me._width = 600;
            slide_me._height = 30;
            vidBg_mc._x = vid._x = 0;
            vidBg_mc._y = vid._y = 35;
            mc_title._x = vid._x = 0;
            mc_title._y = vid._x = -30;
            slide_me._x = vid._x = 0;
            slide_me._y = vid._y = 35;
            regularSize ();
            controls_mc._x = 0;
            controls_mc._y = 395;
            mc_playAgain._x = 243;
            mc_playAgain._y = 158;
            thumbs_mc._x = 0;
            thumbs_mc._y = 316;
            main_mc._x = 0;
            main_mc._y = 406;
        mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
        mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
    // to apply when stage (browser window) is resized or modified
    stageL.onResize = function () {
        setStage ();
    // attaching object to the stage
    Stage.addListener (stageL);
    MovieClip.prototype.slide = function(yPos) {
        this._y -= (this._y-yPos)/5;
    // tilte actions
    mc_title.onEnterFrame = function()
        if (Stage["displayState"] == "normal" && title_out == false)
            this.slide(5);
        else if (Stage["displayState"] == "normal" && title_out == true)
            this.slide(35);
        if (Stage["displayState"] == "fullScreen" && title_out == false)
            this._y -= (this._y+106)/5;
        else if (Stage["displayState"] == "fullScreen" && title_out == true)
            this.slide(0);
    // thumbs actions
    main_mc.onEnterFrame = function()
        if (Stage["displayState"] == "normal" && thumbs_out == false)
            this.slide(406);
        else if (Stage["displayState"] == "normal" && thumbs_out == true)
            this.slide(299);
        if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
            this._y = Math.round (Stage.height - 0);
        else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
            this._y = Math.round (Stage.height - 133);
    // Playlist button
    controls_mc.playlist_mc.onRollOver = function ()
        this.gotoAndStop("playlistOver");
    controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
        this.gotoAndStop("playlist");
    // Toggle playlist button
    controls_mc.playlist_mc.onRelease = function ()
        if (thumbs_out == false)
            thumbs_out = true;
            title_out = true;
        else if (thumbs_out == true)
            thumbs_out = false;
            title_out = false;
        } // end if else
    // Define hit area for playPause button
    vid.onPress = controls_mc.playPause.onRelease = function ()
        ns.pause();
        if (playStatus == 1)
            controls_mc.playPause.gotoAndStop("play")
            playStatus = 0;
            checkStatus();
        else if (playStatus == 0)
            controls_mc.playPause.gotoAndStop("pause");
            playStatus = 1;
            checkStatus();
    // playPause button
    controls_mc.playPause.onRollOver = function ()
        if (playStatus == 1)
            this.gotoAndStop("pauseOver");
        else
            this.gotoAndStop("playOver");
        } // end else if
    controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
        if (playStatus == 1)
            this.gotoAndStop("pause");
        else
            this.gotoAndStop("play");
        } // end else if
    // Toggle playPause button
    controls_mc.playPause.onRelease = function ()
        ns.pause();
        if (playStatus == 1)
            this.gotoAndStop("play");
            playStatus = 0;
            checkStatus();
        else if (playStatus == 0)
            this.gotoAndStop("pause");
            playStatus = 1;
            checkStatus();
    controls_mc.skip_mc.onRollOver = function ()
        this.gotoAndStop("skipOver");
    controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
        this.gotoAndStop("skip");
    controls_mc.skip_mc.onRelease = function ()
        _parent.nextVideo()
    // Play Again button
    mc_playAgain.onRollOver = function ()
        this.gotoAndStop("playAgainOver");
    mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
        this.gotoAndStop("playAgain");
    // Toggle Play Again button
    mc_playAgain.onRelease = function ()
        this._visible = false;
        ns.pause();
        playStatus = 1;
        checkStatus();
    // make the seek bar clickable
    controls_mc.mc_progress.mc_buff.onPress = function()
        xpos = controls_mc.mc_progress._xmouse;
        percent = Math.round(xpos/controls_mc.mc_progress._width*100);
        seekTime = percent/100*FLVduration;
        seekTime = Math.round(seekTime*100)/100;
        ns.seek(seekTime);
    // Set volume level
    var s:Sound = new Sound();
    s.setVolume(_root.volume_value);
    controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
    // Volume control
    controls_mc.mc_soundLevel.onPress = function()
        volumeTo = (this._xmouse / this._width)*100;
        this.mc_volume._xscale = volumeTo;
        s.setVolume(volumeTo);
    // Volume
    _parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
    vSound.attachAudio(ns);
    var so = new Sound(vSound);
    so.setVolume(_root.volume_value);
    // Mute button
    controls_mc.mute_mc.onRollOver = function ()
        if (so.getVolume() >= 1)
            this.gotoAndStop("onOver");
        else
            this.gotoAndStop("muteOver");
        } // end else if
    controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
        if (so.getVolume() >= 1)
            this.gotoAndStop("on");
        else
            this.gotoAndStop("mute");
        } // end else if
    // Toggle mute button
    controls_mc.mute_mc.onRelease = function ()
        if (so.getVolume() >= 1)
            controls_mc.mc_soundLevel.mc_volume._xscale = 0;
            so.setVolume(0);
            this.gotoAndStop("muteOver");
        else
            controls_mc.mc_soundLevel.mc_volume._xscale = 70;
            so.setVolume(_root.volume_value);
            this.gotoAndStop("onOver");
        } // end else if
    // Resize video proportionaly
    function regularSize ()
        videoObj._width = 600;
        videoObj._height = videoObj._width * relationshipW;
        if (videoObj._height > 360)
            videoObj._height = 360;
            videoObj._width = videoObj._height * relationshipH;
        videoObj.smoothing = true;
        //var scale:Number;
        videoObj._x = (600 - videoObj._width) / 2;
        videoObj._y = (360 - videoObj._height) / 2;
    function largeSize ()
        videoObj._width = Stage.width;
        videoObj._height = videoObj._width * relationshipW;
        if (videoObj._height > Stage.height)
            videoObj._height = Stage.height;
            videoObj._width = videoObj._height * relationshipH;
        videoObj.smoothing = true;
        //var scale:Number;
        videoObj._x = (Stage.width - videoObj._width) / 2;
        videoObj._y = (Stage.height - videoObj._height) / 2;
    // Fullscreen button
    controls_mc.fullscreen_mc.onRollOver = function ()
        if (Stage["displayState"] == "normal")
            this.gotoAndStop("fullOver");
        else
            this.gotoAndStop("fullCloseOver");
        } // end else if
    controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
        if (Stage["displayState"] == "normal")
            this.gotoAndStop("full");
        else
            this.gotoAndStop("fullClose");
        } // end else if
    // Toggle fullscreen button
    controls_mc.fullscreen_mc.onRelease = function ()
        if (Stage["displayState"] == "normal")
            Stage["displayState"] = "fullscreen";
            _parent.video_txt.theText._visible = false;
        else
            Stage["displayState"] = "normal";
            _parent.video_txt.theText._visible = true;

    if you mean sound works well when the gallery is tested without being loaded into another swf but fails when loaded, change the highlighted line:
    // Import filter classes
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    // Set flash variables
    var xmlFileUrl:String = "playlist.xml";
    var auto_play:String = "true";
    // Set xml file URL
    if (_root.xmlfile) {
        xmlFileUrl = _root.xmlfile;
    var V_SRC;
    var thuArray:Array = new Array();
    var currentVideo:Number = 0;
    var totalItems;
    var numOfItems:Number;
    var itemDistance:Number = 120+5;
    var itemHeight:Number = 80+2;
    var Value:Number = 1;
    var boundry:Number = 1;
    var ratio:Number = 1;
    var diff:Number = 1;
    var collectionWidth:Number = 1;
    var buffer:Number = 135*2;
    this.createEmptyMovieClip("video_txt",this.getNextHighestDepth());
    video_txt.createTextField("theText",video_txt.getNextHighestDepth(),0,0,584,36);
    video_txt.theText.selectable = false;
    video_txt.theText.autoSize = "left";
    //The Format
    myFormat = new TextFormat();
    myFormat.font = _root.font_format;
    myFormat.size = _root.font_size;
    myFormat.color = _root.font_color;
    myFormat.align = "center";
    video_txt.theText.setNewTextFormat(myFormat);
    // Create a new movieclip to load the thumbs
    var thumbLoader:MovieClipLoader = new MovieClipLoader();
    var thumbListener:Object = new Object();
    thumbLoader.addListener(thumbListener);
    thumbListener.onLoadInit = function(target_mc:MovieClip, httpStatus:Number)
        new Tween(target_mc, "_alpha", Regular.easeOut, 0, 100, 1, true);
        target_mc._parent.preloader_mc._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = xmlLoaded;
    xml.load(xmlFileUrl);
    // Load the xml file into the player
    function xmlLoaded(b:Boolean) {
        if (b) {
            auto_play = this.firstChild.firstChild.attributes.auto_play;
            scrollSpeed = parseInt(this.firstChild.firstChild.attributes.scrollSpeed);
            totalItems = this.firstChild.firstChild.childNodes;
            numOfItems = totalItems.length;
            for (j=0; j<numOfItems; j++) {
                var i = player_mc.main_mc.collection_mc.attachMovie("mc_Thumb", "thumb_"+j, j);
                i._x = itemDistance*j;
                thumbLoader.loadClip(totalItems[j].attributes.thumb,i.loader_mc);
                i.id = j;
                i.videoTitle = totalItems[j].attributes.title;
                i.videoUrl = totalItems[j].attributes.src;
                // Create an event for thumb rollover
                i.onRollOver = iRoll;
                i.onRollOut = i.onReleaseOutside=iOut;
                i.onRelease = iRelease;
                thuArray[j] = i;
            // default first video
            collectionWidth = player_mc.main_mc.collection_mc._width;
            currentVideo = 0;
            V_SRC = thuArray[0].videoUrl;
            changeVideo();
            //scope._alpha = 100;
            new Tween(scope, "_alpha", Regular.easeOut, 0, 100, 0.5, true);
        else
            trace("Error! xml file not loaded");
    // onRollOver Events
    function iRoll() {
        player_mc.mc_title.title_txt.htmlText = totalItems[this.id].attributes.title;
        this.light_mc.play();
    function iRelease() {
        currentVideo = this.id;
        changeVideo();
    function changeVideo() {
        V_SRC = thuArray[currentVideo].videoUrl;
        player_mc.loadVideo();
        currentThumb();
        player_mc.mc_title.title_txt.htmlText = thuArray[currentVideo].videoTitle;
        video_txt.theText.text = totalItems[currentVideo].attributes.title;
        player_mc.so.getVolume();
        player_mc.playStatus = 1;
        player_mc.checkStatus();
    function nextVideo() {
        if (currentVideo<(numOfItems-1)) {
            currentVideo++;
        } else {
            currentVideo = 0;
        changeVideo();
    function currentThumb() {
        for (i=0; i<thuArray.length; i++) {
            if (i == currentVideo) {
                thuArray[i].enabled = true;
    // Mouse movement on rollover
    this.onMouseMove = function() {
        collectionWidth = player_mc.main_mc.collection_mc._width;
        boundry = player_mc.main_mc.area_mc._width;
        if ((player_mc.main_mc._ymouse>0) && (player_mc.main_mc._ymouse<itemHeight)) {
            if ((player_mc.main_mc._xmouse>0) && (player_mc.main_mc._xmouse<boundry)) {
                ratio = player_mc.main_mc._xmouse/boundry;
                diff = (collectionWidth-boundry)+buffer;
                Value = Math.floor((-ratio)*diff)+(buffer/2);
        updateAfterEvent();
    this.onEnterFrame = function() {
        // Define movement area and speed
        if (player_mc.main_mc.collection_mc._width>player_mc.main_mc.area_mc._width) {
            player_mc.main_mc.collection_mc._x = Math.round((player_mc.main_mc.collection_mc._x)+((Value-player_mc.main_mc.colle ction_mc._x)/scrollSpeed));
            if (player_mc.main_mc.collection_mc._x>0) {
                player_mc.main_mc.collection_mc._x = 0;
            } else if (player_mc.main_mc.collection_mc._x<(player_mc.main_mc.area_mc._width-(player_m c.main_mc.collection_mc._width))) {
                player_mc.main_mc.collection_mc._x = Math.round(player_mc.main_mc.area_mc._width-(player_mc.main_mc.collection_mc._w idth));
        } else {
            player_mc.main_mc.collection_mc._x = 0;
        updateAfterEvent();
    part two:
    // Define flash variables
    var video_url:String = "";
    var tempx:Number = this._parent._x;
    var tempy:Number = this._parent._y;
    var timeCounter:Number = 0;
    var timeInSeconds:Number = _root.time_counter;
    // Object to listen to onStage Event
    videoObj = vid.videoObj;
    // Setting up the connection
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    // Buffer time
    ns.setBufferTime (10);
    videoObj.attachVideo (ns);
    function loadVideo () {
        video_url = _parent.V_SRC;
        trace(video_url);
        ns.play (video_url);
    function checkStatus()
        if (playStatus == 1)
            controls_mc.playPause.gotoAndStop("pause");
            mc_playAgain._visible = false;
            thumbs_out = false;
            title_out = false;
        else
            controls_mc.playPause.gotoAndStop("play");
            mc_playAgain._visible = true;
        } // end else if
        if (so.getVolume() == 0)
            controls_mc.mute_mc.gotoAndStop("mute");
        else
            controls_mc.mute_mc.gotoAndStop("on");
    }; // End of the function
    mc_playAgain._visible = false;
    // Check Status of video
    ns.onStatus = function (info)
        if (info.code == "NetStream.Buffer.Empty")
            mc_buffer._visible = true;
        else if (info.code == "NetStream.Buffer.Full")
            mc_buffer._visible = false;
        else if (info.code == "NetStream.Play.Stop")
            ns.seek(0);
            if (playStatus == 1)
                ns.pause();
                playStatus = 0;
            else
                trace;
            } // end else if
            mc_playAgain._visible = true;
            mc_buffer._visible = false;
            thumbs_out = true;
            title_out = true;
            checkStatus();
        } // end else if
    // Get info about video
    ns.onMetaData = function(infoObject:Object)
        FLVduration = infoObject["duration"];
        relationshipW = infoObject.height / infoObject.width;
        relationshipH = infoObject.width / infoObject.height;
        if (Stage["displayState"] == "fullScreen")
            largeSize ();
        else
            regularSize ();
        if (_parent.auto_play == "false")
            ns.seek(0);
            if (playStatus == 1)
                ns.pause();
                playStatus = 0;
            mc_buffer._visible = false;
            controls_mc.playPause.gotoAndStop("play");
            mc_playAgain._visible = true;
            thumbs_out = true;
            title_out = true;
            _parent.auto_play = "true";
        }// end else if
    var videoInterval = setInterval(videoStatus, 100);
    var amountLoaded;
    var duration;
    // videoStatus on load Event
    function videoStatus()
        amountLoaded = ns.bytesLoaded / ns.bytesTotal;
        controls_mc.mc_progress.mc_buff._width = amountLoaded * 250;
        controls_mc.mc_progress.mc_played._x = ns.time / duration * 250;
        controls_mc.mc_progress.mc_played._xscale = Math.round(ns.time*100/FLVduration);
    }; // End of the function
    function scrubIt()
        ns.seek(Math.floor(controls_mc.mc_progress.mc_played._x / 250 * duration));
    }; // End of the function
    // video time
    var time_interval:Number = setInterval(checkTime, 500, ns);
    function checkTime(ns:NetStream) {
        //current time
        var ns_seconds:Number = ns.time;
        var minutes:Number = Math.floor(ns_seconds/60);
        var seconds = Math.floor(ns_seconds%60);
        sec = seconds;
        min = minutes;
        if (sec<10) {
            sec = "0"+sec;
        if (min<10) {
            min = "0"+min;
        controls_mc.time_txt.time_1.text = min+":"+sec;
        //total time
        var minutes2:Number = Math.floor(FLVduration/60);
        var seconds2 = Math.floor(FLVduration%60);
        sec2 = seconds2;
        min2 = minutes2;
        if (sec2<10) {
            sec2 = "0"+sec2;
        if (min2<10) {
            min2 = "0"+min2;
        controls_mc.time_txt.time_2.text = min2+":"+sec2;
        if (controls_mc.time_txt.time_2.text == "NaN:NaN") {
            controls_mc.time_txt.time_2.text = "00:00";
    setStage ();
    // Object to listen onStage Event
    var stageL:Object = new Object ();
    // function respnsible for content alignment
    function setStage ()
        if (Stage["displayState"] == "fullScreen") {
            tempx = this._parent._x;
            tempy = this._parent._y;
            this._parent._x = 0;
            this._parent._y = 0;
            vidBg_mc._x = 0;
            vidBg_mc._y = 0;
            mc_title._x = 0;
            mc_title._y = -30;
            slide_me._x = 0;
            slide_me._y = 0;
            vidBg_mc._width = Stage.width;
            vidBg_mc._height = Stage.height;
            mc_title._width = Stage.width;
            mc_title._height = Stage.height / 20;
            slide_me._width = Stage.width;
            slide_me._height = Stage.height / 20;
            vid._x = vid._y = 0;
            largeSize ();
            controls_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));
            controls_mc._y = Math.round (Stage.height - 36);
            mc_playAgain._x = Math.round ((Stage.width / 2) - (mc_playAgain._width / 2));
            mc_playAgain._y = Math.round (Stage.height - 572);
            thumbs_mc._x = Math.round ((Stage.width / 2) - (thumbs_mc._width / 2));
            thumbs_mc._y = Math.round (Stage.height - 115);
            main_mc._x = Math.round ((Stage.width / 2) - (controls_mc._width / 2));;
            hide_mc.onEnterFrame = function () {
                timeCounter = timeCounter + 1;
                if (timeCounter >= timeInSeconds * 30) {
                    timeCounter = 0;
                    controls_mc._alpha = 0;
            this.onMouseMove = function () {
                timeCounter = 0;
                controls_mc._alpha = 100;
        else
            delete hide_mc.onEnterFrame;
            delete this.onMouseMove;
            controls_mc._alpha = 100;
            this._parent._x = tempx;
            this._parent._y = tempy;
            vidBg_mc._width = 600;
            vidBg_mc._height = 360;
            mc_title._width = 600;
            mc_title._height = 30;
            slide_me._width = 600;
            slide_me._height = 30;
            vidBg_mc._x = vid._x = 0;
            vidBg_mc._y = vid._y = 35;
            mc_title._x = vid._x = 0;
            mc_title._y = vid._x = -30;
            slide_me._x = vid._x = 0;
            slide_me._y = vid._y = 35;
            regularSize ();
            controls_mc._x = 0;
            controls_mc._y = 395;
            mc_playAgain._x = 243;
            mc_playAgain._y = 158;
            thumbs_mc._x = 0;
            thumbs_mc._y = 316;
            main_mc._x = 0;
            main_mc._y = 406;
        mc_buffer._x = Math.round (vidBg_mc._x + (vidBg_mc._width / 2));
        mc_buffer._y = Math.round (vidBg_mc._y + (vidBg_mc._height / 2));
    // to apply when stage (browser window) is resized or modified
    stageL.onResize = function () {
        setStage ();
    // attaching object to the stage
    Stage.addListener (stageL);
    MovieClip.prototype.slide = function(yPos) {
        this._y -= (this._y-yPos)/5;
    // tilte actions
    mc_title.onEnterFrame = function()
        if (Stage["displayState"] == "normal" && title_out == false)
            this.slide(5);
        else if (Stage["displayState"] == "normal" && title_out == true)
            this.slide(35);
        if (Stage["displayState"] == "fullScreen" && title_out == false)
            this._y -= (this._y+106)/5;
        else if (Stage["displayState"] == "fullScreen" && title_out == true)
            this.slide(0);
    // thumbs actions
    main_mc.onEnterFrame = function()
        if (Stage["displayState"] == "normal" && thumbs_out == false)
            this.slide(406);
        else if (Stage["displayState"] == "normal" && thumbs_out == true)
            this.slide(299);
        if (Stage["displayState"] == "fullScreen" && thumbs_out == false)
            this._y = Math.round (Stage.height - 0);
        else if (Stage["displayState"] == "fullScreen" && thumbs_out == true)
            this._y = Math.round (Stage.height - 133);
    // Playlist button
    controls_mc.playlist_mc.onRollOver = function ()
        this.gotoAndStop("playlistOver");
    controls_mc.playlist_mc.onRollOut = controls_mc.playlist_mc.onReleaseOutside = function ()
        this.gotoAndStop("playlist");
    // Toggle playlist button
    controls_mc.playlist_mc.onRelease = function ()
        if (thumbs_out == false)
            thumbs_out = true;
            title_out = true;
        else if (thumbs_out == true)
            thumbs_out = false;
            title_out = false;
        } // end if else
    // Define hit area for playPause button
    vid.onPress = controls_mc.playPause.onRelease = function ()
        ns.pause();
        if (playStatus == 1)
            controls_mc.playPause.gotoAndStop("play")
            playStatus = 0;
            checkStatus();
        else if (playStatus == 0)
            controls_mc.playPause.gotoAndStop("pause");
            playStatus = 1;
            checkStatus();
    // playPause button
    controls_mc.playPause.onRollOver = function ()
        if (playStatus == 1)
            this.gotoAndStop("pauseOver");
        else
            this.gotoAndStop("playOver");
        } // end else if
    controls_mc.playPause.onRollOut = controls_mc.playPause.onReleaseOutside = function ()
        if (playStatus == 1)
            this.gotoAndStop("pause");
        else
            this.gotoAndStop("play");
        } // end else if
    // Toggle playPause button
    controls_mc.playPause.onRelease = function ()
        ns.pause();
        if (playStatus == 1)
            this.gotoAndStop("play");
            playStatus = 0;
            checkStatus();
        else if (playStatus == 0)
            this.gotoAndStop("pause");
            playStatus = 1;
            checkStatus();
    controls_mc.skip_mc.onRollOver = function ()
        this.gotoAndStop("skipOver");
    controls_mc.skip_mc.onRollOut = controls_mc.skip_mc.onReleaseOutside = function ()
        this.gotoAndStop("skip");
    controls_mc.skip_mc.onRelease = function ()
        _parent.nextVideo()
    // Play Again button
    mc_playAgain.onRollOver = function ()
        this.gotoAndStop("playAgainOver");
    mc_playAgain.onRollOut = mc_playAgain.onReleaseOutside = function ()
        this.gotoAndStop("playAgain");
    // Toggle Play Again button
    mc_playAgain.onRelease = function ()
        this._visible = false;
        ns.pause();
        playStatus = 1;
        checkStatus();
    // make the seek bar clickable
    controls_mc.mc_progress.mc_buff.onPress = function()
        xpos = controls_mc.mc_progress._xmouse;
        percent = Math.round(xpos/controls_mc.mc_progress._width*100);
        seekTime = percent/100*FLVduration;
        seekTime = Math.round(seekTime*100)/100;
        ns.seek(seekTime);
    // Set volume level
    var s:Sound = new Sound(this);
    s.setVolume(_root.volume_value);
    controls_mc.mc_soundLevel.mc_volume._xscale = _root.volume_value;
    // Volume control
    controls_mc.mc_soundLevel.onPress = function()
        volumeTo = (this._xmouse / this._width)*100;
        this.mc_volume._xscale = volumeTo;
        s.setVolume(volumeTo);
    // Volume
    _parent.createEmptyMovieClip("vSound", _parent.getNextHighestDepth());
    vSound.attachAudio(ns);
    var so = new Sound(vSound);
    so.setVolume(_root.volume_value);
    // Mute button
    controls_mc.mute_mc.onRollOver = function ()
        if (so.getVolume() >= 1)
            this.gotoAndStop("onOver");
        else
            this.gotoAndStop("muteOver");
        } // end else if
    controls_mc.mute_mc.onRollOut = controls_mc.mute_mc.onReleaseOutside = function ()
        if (so.getVolume() >= 1)
            this.gotoAndStop("on");
        else
            this.gotoAndStop("mute");
        } // end else if
    // Toggle mute button
    controls_mc.mute_mc.onRelease = function ()
        if (so.getVolume() >= 1)
            controls_mc.mc_soundLevel.mc_volume._xscale = 0;
            so.setVolume(0);
            this.gotoAndStop("muteOver");
        else
            controls_mc.mc_soundLevel.mc_volume._xscale = 70;
            so.setVolume(_root.volume_value);
            this.gotoAndStop("onOver");
        } // end else if
    // Resize video proportionaly
    function regularSize ()
        videoObj._width = 600;
        videoObj._height = videoObj._width * relationshipW;
        if (videoObj._height > 360)
            videoObj._height = 360;
            videoObj._width = videoObj._height * relationshipH;
        videoObj.smoothing = true;
        //var scale:Number;
        videoObj._x = (600 - videoObj._width) / 2;
        videoObj._y = (360 - videoObj._height) / 2;
    function largeSize ()
        videoObj._width = Stage.width;
        videoObj._height = videoObj._width * relationshipW;
        if (videoObj._height > Stage.height)
            videoObj._height = Stage.height;
            videoObj._width = videoObj._height * relationshipH;
        videoObj.smoothing = true;
        //var scale:Number;
        videoObj._x = (Stage.width - videoObj._width) / 2;
        videoObj._y = (Stage.height - videoObj._height) / 2;
    // Fullscreen button
    controls_mc.fullscreen_mc.onRollOver = function ()
        if (Stage["displayState"] == "normal")
            this.gotoAndStop("fullOver");
        else
            this.gotoAndStop("fullCloseOver");
        } // end else if
    controls_mc.fullscreen_mc.onRollOut = controls_mc.fullscreen_mc.onReleaseOutside = function ()
        if (Stage["displayState"] == "normal")
            this.gotoAndStop("full");
        else
            this.gotoAndStop("fullClose");
        } // end else if
    // Toggle fullscreen button
    controls_mc.fullscreen_mc.onRelease = function ()
        if (Stage["displayState"] == "normal")
            Stage["displayState"] = "fullscreen";
            _parent.video_txt.theText._visible = false;
        else
            Stage["displayState"] = "normal";
            _parent.video_txt.theText._visible = true;

  • How to create/org a Video Playlist?

    Hello everyone, I must say I really really like my new (video) iPod 60!! I have "rip" 3 videos into it so far, a recorded off-TV MTV of Madonna's "Hung Up", a recorded "Lost" episode and a DVD of Star Trek Enterprise, they all look good and sounds good on the iPod!!
    On the Main Menu > Video > Video Playlist, Movies, Music Videos, Video Podcast & Video Settings; How do you create new Video Playlist? I noticed all my "rip" video are inside the 'Movies' category... I guess only videos like music videos bought from the iTMS would go into the 'Music Video'??
    Thanks all and cheers!!

    this is the code snippet that would answer u r question
    import org.apache.xml.serialize.XMLSerializer;
    import org.w3c.dom.Attr;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Text;
    import org.w3c.dom.ProcessingInstruction;
    import org.xml.sax.InputSource;
    import com.exel.businessobjects.*;
    StringReader srxml = new StringReader(xmlcontent);
    Reader rxml     = (Reader)srxml;
    InputSource isxml = new InputSource(rxml);
    DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
    DocumentBuilder db = dbf.newDocumentBuilder();
    Document doc = db.parse(isxml);

  • Dynamic Video Playlist

    Hi, I am new to Actionscript 3 and I have followed the
    tutorial regarding creating a dynamic video playlist with
    thumbnails. I created as the tutorial said and it worked fine.
    Instead of their just being a title for a video, I have also tried
    to add a description to each tileitem, but instead the title
    repeats twice. Can anyone see where i'm going wrong? You can view
    my playlist here - www.coolmustard.co.uk/VideoPlaylist.html
    Thumb actionscript file:
    package {
    import fl.controls.listClasses.ICellRenderer;
    import fl.controls.listClasses.ImageCell;
    import fl.controls.TileList;
    import flash.text.*;
    public class Thumb extends ImageCell implements
    ICellRenderer {
    private var desc:TextField;
    private var info:TextField;
    private var textStyle:TextFormat;
    public function Thumb() {
    super();
    loader.scaleContent = false;
    useHandCursor = true;
    // set skins
    setStyle("upSkin", ThumbCellBg);
    setStyle("downSkin", ThumbCellBg);
    setStyle("overSkin", ThumbCellBgOver);
    setStyle("selectedUpSkin", ThumbCellBgOver);
    setStyle("selectedDownSkin", ThumbCellBgOver);
    setStyle("selectedOverSkin", ThumbCellBgOver);
    // Create and format desc
    desc = new TextField();
    desc.autoSize = TextFieldAutoSize.LEFT;
    desc.x = 80;
    desc.y = 4;
    desc.width = 500;
    desc.multiline = true;
    desc.wordWrap = true;
    addChild(desc);
    textStyle = new TextFormat();
    textStyle.font = "Arial";
    textStyle.color = 0xffffff;
    textStyle.size = 11;
    textStyle.bold = true;
    info = new TextField();
    info.autoSize = TextFieldAutoSize.LEFT;
    info.x = 80;
    info.y = 15;
    info.width = 500;
    info.multiline = true;
    info.wordWrap = true;
    addChild(info);
    override protected function drawLayout():void {
    // Position cell elements; tweak these for your thumbs if
    needed
    var imagePadding:Number = getStyleValue("imagePadding") as
    Number;
    loader.move(11, 8);
    var w:Number = width-(imagePadding*2);
    var h:Number = height-(imagePadding*2);
    if (loader.width != w && loader.height != h) {
    loader.setSize(w,h);
    loader.drawNow();
    desc.text = data.label;
    desc.setTextFormat(textStyle);
    info.text = data.label;
    info.setTextFormat(textStyle);
    background.width = width+5;
    background.height = height+2;
    textField.visible = false;
    Videoplaylist actionscript code:
    package {
    import flash.display.MovieClip;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import fl.controls.listClasses.CellRenderer;
    import fl.controls.ScrollBarDirection;
    public class VideoPlaylist extends MovieClip {
    private var xmlLoader:URLLoader;
    public function VideoPlaylist():void {
    // Load the playlist file, then initialize the media player.
    xmlLoader = new URLLoader();
    xmlLoader.addEventListener(Event.COMPLETE, initMediaPlayer);
    xmlLoader.load(new URLRequest("playlist.xml"));
    // Format the tileList, specify its cellRenderer class.
    tileList.setSize(600, 240);
    tileList.columnWidth = 580;
    tileList.rowHeight = 60;
    tileList.direction = ScrollBarDirection.VERTICAL;
    tileList.setStyle("cellRenderer", Thumb);
    public function initMediaPlayer(event:Event):void {
    var myXML:XML = new XML(xmlLoader.data);
    var item:XML;
    for each(item in myXML.vid) { // populate playlist.
    // Get thumbnail value and assign to cellrenderer.
    var thumb:String;
    if(item.hasOwnProperty("@thumb")>0) thumb = item.@thumb;
    // Send data to tileList.
    tileList.addItem({label:item.attribute("desc").toXMLString(),
    label:item.attribute("info").toXMLString(),
    data:item.attribute("src").toXMLString(),
    source:thumb});;
    // Select the first video.
    tileList.selectedIndex = 0;
    // Listen for item selection.
    tileList.addEventListener(Event.CHANGE, listListener);
    // And automatically load it into myVid.
    myVid.source = tileList.selectedItem.data;
    // Pause video until selected or played.
    myVid.play();
    // Detect when new video is selected, and play it
    function listListener(event:Event):void {
    myVid.play(event.target.selectedItem.data);
    XML Playlist:
    <?xml version="1.0" encoding="UTF-8"?>
    <playlist id="Adobe Developer Center - Dynamic Video
    Playlist in AS3" >
    <vid desc="Champneys Spa's and Resorts"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysIntro.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysIntro.jpg"
    />
    <vid desc="Accommodation at Champneys"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysAccom.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysAccom.jpg"
    />
    <vid desc="The Henlow Spa and Resort"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysHenlow.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysHenlow.jpg"
    />
    <vid desc="The Forest Mere Spa and Resort"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysMere.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysMere.jpg"
    />
    <vid desc="The Springs Spa and Resort"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysSpings.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysSprings.jpg"
    />
    <vid desc="The Tring Spa and Resort"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysTring.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysTring.jpg"
    />
    <vid desc="Spa Treatments at Champneys"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysSpaTreat.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysSpaTreat.jpg"
    />
    <vid desc="Fitness and Well-Being at Champneys"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysFitness.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysFitness.jpg"
    />
    <vid desc="Aqua Therapy at Champneys"
    info="Enter a short description here"
    src="
    http://www.coolmustard.co.uk/videos/ChampneysAquaTherapy.flv"
    thumb="
    http://www.coolmustard.co.uk/thumbs/ChampneysAquaTherapy.jpg"
    />
    </playlist>
    If anyone can help that would be brilliant.

    I can't pinpoint where data.label derives from, but at first
    glance I'd say the problem might be between the following sets of
    lines...
    desc.text = data.label;
    desc.setTextFormat(textStyle);
    info.text = data.label;
    info.setTextFormat(textStyle);

  • Videos don't show up on iPod video playlist

    Maybe I'm not understanding something, but I subscribe to a coupld of video podcasts. They update fine off iTunes and they synch over to my iPod. The problem is, they don't show up in any of the video playlists. They show up under the 'recently added' list of both music and video files.
    How can I get these things to list in the Video Podcast playlist?? Thanks for your help and thoughts!

    Julia,
    Do you have a Fifth Generation iPod, or not?
    Only Fifth Generation iPods are compatible with any videos, which include video podcasts that you try to download onto it.
    So, if you have a Nano, for example, it isn't won't be capable of playing any video files, sorry.
    If you're unsure what model of iPod you have, check out this article which has info about different iPods here: Identifying different iPod models
    -Kylene

  • Hopefully someone can help.... I have an Iphone 5 and want to create a music video playlist on my phone so then i can play through my apple tv... but when i make a playlist in itunes and try to add it over to my iphone it wont let me sync the playlist...?

    Hopefully someone can help.... I have an Iphone 5 and want to create a music video playlist on my phone so then i can play through my apple tv... but when i make a playlist in itunes and try to add it over to my iphone it wont let me sync the playlist...? I have already added the music videos to my iphone so that is not the problem.... i cant seem to figure out how to make a playlist for them... IE: to make the videos play consecutively in the order i want without stopping after each video and gong back to the list.... this is what i have had to resort to make it work....what i want to do....is be able to make a playlist of videos on my iphone 5....take my apple tv to friends houses and with wifi....set up apple tv and play videos at the party and not have to stand by with the remote and find a new video to play stopping the music between the songs/videos....very annoying....and have spent over 4 hours one day and an hour and a half today on the phone today with a sr. advisor with apple and they have no clue.... this seems sooooo simple.... please somebody that really knows how to do this....i will be indebted forever...............
    Mike

    Thank you for replying.    Yes I deleted the old email address..   

  • Hi. Downloaded iphone 6.0 and my video playlists in "Music" are now gone, but their names are still there. The videos are still in "Videos" and play from there 1 at a time manually.

    Hi. Downloaded iphone 6.0 and my video playlists in "Music" are now gone, but their names are still there. The videos are still in "Videos" and play from there 1 at a time manually.  It gets weirder:
    When looking at the empty screen with the name of my former playlist on top,  if I tap the edit button on the phone, tap the + button to add a 'song' to the playlist, and then tap 'Done' without adding anything, I can see all my videos in the playlist with the red minus symbol next to each of them. But as soon as I tap 'Done' again they all disappear!
    I saw on another forum that someone has had the same problem but fixed it by, and I quote
    "If you go to Get Info and change the Media Kind from Movie to Music Video under the Options tab, they all now appear in the playlists!"
    I'm happy this worked for him, but when I tap "File" in itunes, the "Get info" field is greyed out, so I can't test the solution proposed.
    Any ideas?
    Thanks

    Same problem on my ipad 2...but it works well on my iphone 4s.
    Can somebody help me?
    Thank you

  • On my iPad3, in the Music app, I can find my video playlists in my iTunes library, but they are all empty.  This works fine on my iPhone4.  Does anybody know what the problem is?

    BACKGROUND:  When I'm home, using my iPhone4 and MacPro/iTunes library, I've been watching video on my iPhone via the Home Sharing feature of the said devices.  I have lots of videos in my iTunes library, so I've set up lots of video playlists to help organize stuff, and also to more quickly zone in on the video I want to watch from my iPhone and AppleTV.   So here's the process I go through when I want to watch a video on my iPhone:  go into the Music app, then hit the "More..." selection (along the bottom right of screen), then hit the "Shared" selection, then hit the "Bob's iTunes Library" selection, then hit the "Playlists" selection (along the bottom left of screen), then find/select the video playlist of choice, then find/select the video of choice, then start watching.  Aside from the occasional spontaneous disconnect issue I've been having lately, it all works like a charm.
    (NOTE:  I tried the same procedure using the Videos app on my iPhone, but there doesn't seem to be a way to see the video playlists in this app.)
    TO THE PRESENT:  So when I got my shiny new iPad3 this Monday, the very first thing I did was try to replicate this process on the iPad3. Because both the Videos app and the Music app look very different on the iPad vs their iPhone counterparts, I tried this using the Videos app first, but ran into the same problem as on the iPhone - there's no way (as far as I can tell) to view/access the video playlists in this app – all I see are icons, one for each video.   I then tried the Music app, and steps are identical to the iPhone version.    I got as far as getting to see my playlists, and then selecting the video playlist of interest, but once there, no videos are in the playlist, only a single song(??).   In fact, none of the video playlists have any video files in them (some have song tracks??).

    Same problem on my ipad 2...but it works well on my iphone 4s.
    Can somebody help me?
    Thank you

  • How do I prevent the video file name from showing up on apple tv looping video playlist?

    Ok so here is my dilemma.  I use my apple tv as a way to loop a video playlist on my tv for guests.  I usually only have 2 videos that play and they loop continuously all day just fine.  However, when one video ends and the other begins, the file name appears (I'm assuming it's the file name) at the bottom left corner as the video is starting.  Is there a way to get rid of that?  I want a streamlined experience and it takes away from the video.  So, all in all I have an apple tv.  I use it to loop a video playlist on a tv for people to watch in the background.  When a video begins, the file name appears and I want to know if I can get rid of that through the apple tv.  Also note both videos were edited in iMovie.  Thank you.

    Welcome to the Apple Community.
    Is there a way to get rid of that?
    Unfortunately not.

  • How can I create a Music Video playlist (for Universal Dock)?

    Ok, I created a smart playlist of all my Music Videos but this is a music playlist.
    I want a *Music Video* playlist so that all my music videos will play one after the other without user interaction (when playing in the Universal Dock with it's useless remote control).
    Is this even possible?

    MVP video playlist app is the one you want download

  • Can no longer sync movie video playlist after update?

    I recently performed the 3.0 update to my iPhone 3g with no apparent issues. However, I went to play a movie video last night and discovered that only my music videos had synced (all were previously on the iPhone with no problems). Checking the iPhone settings under video I noticed that the tab lists a section for movie rentals and TV shows but does not specifically call out movies that you own. Under tv shows is where I normally expect to select which video playlist to sync for which none were available (even though I have one with 3 movie videos in it). It looks like it handles tv show video playlists only which I have not tested.
    This is different from before the update where I could sync any video playlist I wanted. The videos were all downloaded from iTunes so there should be no issues or questions about format and source. Am I missing something? Thanks.

    after you connect your iPhone and go to the 'video' tab, if you scroll down, you should see your 'movies' section which should list the 'movie' files you have in the 'movies' section of iTunes. if you select the videos you want to sync, hit save/apply and sync, you should get the videos on your iPhone.
    video playlists will only sync files in the 'tv shows' category, not files in the 'movies' category of iTunes. i'm not sure why they did it like this, but they did, and it highly annoys me. my work around is to make all of my 'movies' go into the 'tv shows' category, which i can then add to a playlist and have it synced. more work, but it works...

  • Video playlists no longer auto-playing (4.3)

    I've noticed that my music video playlists no longer auto-play from one song to the the next with the latest OS update (iPhone 4.3, Apple TV 4.2). Basically, a music video stops and the next one doesn't start until I press play again.
    Any solutions?

    I have the same problem.
    I am using an iPhone 4 (iOS 4.3) and various Apple TVs (4.2).
    When i start a playlist with music videos from the iTunes store, the first video will be played on the Apple TV and then Apple TV plays this Video again but "repeat" is not selected. Actually the next clip in the list shut be played. Seems to be a bug :-(

  • Trying to create HTML5 Video Playlist in Edge Animate - I can't get it to work. Please help!?!?

    Hi All,
    I am creating an interactive site through Edge Animate and am in the process of trying to create a HTML 5 Video Playlist to function within Edge Animate.
    Current Process - Example:
    I have 3 videos that need to be played on a certain page.
    I created a symbol and dragged the videos to the stage and hidden them within that symbol's timeline.
    I then use thumbnail images in a side playlist to either .remove(); .hide(); a video and .show(); the next.
    However when I do a hide / show option, the video continue to plays in the background if I don't also create an if/else statement to pause it.
    My concern with pausing it is that it will continue to load and dramatically slow down the load time of the site.
    References:
    I found this which looks very helpful but don't know how to add this to edge composition.
    http://demosthenes.info/blog/909/Create-An-Automatic-HTML5-Video-Playlist
    Please help or put me in the right direction to create a playlist would be hugely... AMAZINGLY.. helpful.
    Thanks,
    Jason

    Hi Joe,
    Thank you so much for your help on this one. It is hugely appreciated!!
    I have been working frantically to implement your solution to get this working. I used the 'change src' method.
    I have added all my code below in case anyone wants the solution in the future.
    Could you please help below as I am now totally stuck with the <track> and 'event listener issues' !!
    Issue #1:
    I am having major problems with loading the 'closed captions' track element.
    Everything I click for the video to change source / to the next video, the closed caption track adds to the video and doesn't 'unload' the previous one. You then end up with multiple different subtitle tracks on the video screen
    - The closed captions / subtitles are not showing up in Google Chrome either?
    Issue #2:
    I can't get the event listener in edge animate to work for 'playing' and 'ended'. Can you please help and point me in the correct direction??
    Screenshot (showing what happens after the 3rd video is loaded)
    This is the Code I am currently using in the "Creation Complete" of this Symbol.
    SET UP OF VIDEO PLAYER AND FIRST VIDEO
    var vid = sym.$("video_Chapter5");
    vid.html('<video id="ch5video" width="100%" height="auto" margin= "0 auto"  \
    position ="relative"  poster="video/video1_poster.jpg"  controls="controls" </video> \
    <source id ="videomp4src" src="video/Video_mp4_1.mp4" type="video/mp4" </source> \
    <source id ="videoogvsrc" src="video/Video_ogv_1.ogg" type="video/ogv" </source> \
    <source id ="videowebmsrc" src="video/Video_webm_1.ogg" type="video/webm" </source> \
    <track id ="trackvtt" kind="subtitles" src="video/Video_1_Script.vtt" srclang="en" label="English" hidden </track>');
    VARIABLE IDS
    $(document).ready(function() {
      var videoID = 'ch5video';
      var sourceID1 = 'videomp4src';
      var sourceID2 = 'videoogvsrc';
      var sourceID3 = 'videowebmsrc';
      var trackID = 'trackvtt';
      var vid1mp4 = 'video/Video_mp4_1.mp4';
      var vid2mp4 = 'video/Video_mp4_2.mp4';
      var vid3mp4 = 'video/Video_mp4_3.mp4';
      var vid4mp4 = 'video/Video_mp4_4.mp4';
      var vid1ogv = 'video/Video_ogv_1.ogv';
      var vid2ogv = 'video/Video_ogv_2.ogv';
      var vid3ogv = 'video/Video_ogv_3.ogv';
      var vid4ogv = 'video/Video_ogv_4.ogv';
      var vid1webm = 'video/Video_webm_1.webm';
      var vid2webm = 'video/Video_webm_2.webm';
      var vid3webm = 'video/Video_webm_3.webm';
      var vid4webm = 'video/Video_webm_4.webm';
      var script1vtt = 'video/Video_1_Script.vtt';
      var script2vtt = 'video/Video_2_Script.vtt'; 
      var script3srt = 'video/Video_3_Script.vtt'; 
      var script4vtt = 'video/Video_4_Script.vtt';   
      var newposter1 = 'video/video1_poster.jpg';
      var newposter2 = 'video/video2_poster.jpg';
      var newposter3 = 'video/video3_poster.jpg';
      var newposter4 = 'video/video4_poster.jpg';
    VIDEO PLAYLIST THUMBNAIL BUTTONS - TO CHANGE VIDEO IN PLAYER
      sym.$('btn1').click(function(event) {
      sym.$('#'+videoID).get(0).pause();
      sym.$('#'+sourceID1).attr('src', vid1mp4);
      sym.$('#'+sourceID2).attr('src', vid1ogv);
      sym.$('#'+sourceID3).attr('src', vid1webm);
      sym.$('#'+trackID).attr('src', script1vtt);
      sym.$('#'+videoID).get(0).load();
      sym.$('#'+videoID).attr('poster', newposter1);
      sym.$('#'+videoID).get(0).play();  
      sym.$('btn2').click(function(event) {
      sym.$('#'+videoID).get(0).pause();
      sym.$('#'+sourceID1).attr('src', vid2mp4);
      sym.$('#'+sourceID2).attr('src', vid2ogv);
      sym.$('#'+sourceID3).attr('src', vid2webm);
      sym.$('#'+trackID).attr('src', script2vtt);
      sym.$('#'+videoID).get(0).load();
      sym.$('#'+trackID).load();
      sym.$('#'+videoID).attr('poster', newposter2);
      sym.$('#'+videoID).get(0).play();  
      sym.$('btn3').click(function(event) {
      sym.$('#'+videoID).get(0).pause();
      sym.$('#'+sourceID1).attr('src', vid3mp4); 
      sym.$('#'+sourceID2).attr('src', vid3ogv); 
      sym.$('#'+sourceID3).attr('src', vid3webm);
      sym.$('#'+trackID).attr('src', script3srt);
      sym.$('#'+videoID).get(0).load();
      sym.$('#'+videoID).attr('poster', newposter3);
      sym.$('#'+videoID).get(0).play();
      sym.$('btn4').click(function(event) {
      sym.$('#'+videoID).get(0).pause();
      sym.$('#'+sourceID1).attr('src', vid4mp4);
      sym.$('#'+sourceID2).attr('src', vid4ogv);
      sym.$('#'+sourceID3).attr('src', vid4webm);
      sym.$('#'+trackID).attr('src', script4vtt);  
      sym.$('#'+videoID).get(0).load();
      sym.$('#'+videoID).attr('poster', newposter4);
      sym.$('#'+videoID).get(0).play(); 
    EVENT LISTENER FOR PLAYING - TO CREAT BACKGROUND /LIGHT BOX SCREEN
    sym.$('#'+videoID).get(0).addEventListener('playing', function () {
    sym.getSymbol("backscreen_Ch5").$("backscreen").show();
    sym.getSymbol("backscreen_Ch5").play("play");
    EVENT LISTENER FOR ENDED - TO PLAY NEXT VIDEO IN SERIES
    sym.$('#'+videoID).get(0).addEventListener('ended', function () {
    //code to play next video

Maybe you are looking for