Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Video file name on listbutton label

Engaged ,
Mar 25, 2013 Mar 25, 2013

I'm playing FMS videos from XML. but no need visible filelist path on listbutton.label.

How can i show only video file name on listbutton.label ;

<?xml version="1.0" encoding="utf-8"?>

<XML>

  <FileList>files/store1/2013/1/2/15/video1</FileList>

  <FileList>files/store1/2013/1/2/15/video2</FileList>

  <FileList>files/store1/2013/1/2/15/video3</FileList>

</XML>

AS3

function playlistLoaded(e:Event):void

{

          xmlPlaylist = new XML(urlLoader.data);

for (var i:int=0; i<xmlPlaylist.FileList.length(); i++)

  {

     listbutton = new Button();

     listbutton.y = i * 19 + 1;

     listbutton.width = 200;

     listbutton.height = 20;

     listbutton.label = xmlPlaylist.FileList;

     }

}

TOPICS
ActionScript
702
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Mar 25, 2013 Mar 25, 2013

Finally got it.

String(xmlPlaylist.FileList).split('/').splice(6).join("/");


Translate
Guru ,
Mar 25, 2013 Mar 25, 2013

use the substr or lastIndexOf methods to cut down you path name to the filename:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 25, 2013 Mar 25, 2013

files/store1/2013/1/2/15  this paths are not fixed.

changing daily.  But folders are fixed so what can i do...? how to caluculate "/", and remove before filename

like..

files/store1/2013/3/6/23

files/store2/2013/12/30/15

files/store3/2013/8/10/20


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 25, 2013 Mar 25, 2013
LATEST

Finally got it.

String(xmlPlaylist.FileList).split('/').splice(6).join("/");


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines