Professional Web Applications Themes

Getting only the filename ?? - Macromedia Director Basics

I'm creating a player that allows you to have multiple files stacked and play anyone of them. The problem now is i need to get only the filename out of the string...like C:\music\samples\test.mp3".. need to only have test.mp3... how do u get that alone ?...not very cofident in loops and logic like this... Vj...

  1. #1

    Default Getting only the filename ??

    I'm creating a player that allows you to have multiple files stacked and play anyone of them. The problem now is i need to get only the filename out of the string...like C:\music\samples\test.mp3".. need to only have test.mp3... how do u get that alone ?...not very cofident in loops and logic like this...


    Vj
    vij010 Guest

  2. #2

    Default Re:Getting only the filename ??

    basically you use the backslash (\) as an item separator and pull the last item, which will be your filename.

    i.e.

    DefaultDelimiter = the itemDelimiter
    the itemDelimiter = "\"
    ActualFile = the last item of member("SourceFile").text
    the itemDelimiter = DefaultDelimiter
    member("Output").text = ActualFile


    this example uses 2 fields and a button as a demo (attached)



    [url]http://webforums.macromedia.com/attachments/filestripdemo.zip[/url]


    ============================
    Glen Palmer
    SafariTECH
    Cold Fusion Specialist
    [url]www.safaritech.com[/url]
    ============================
    SafariTECH Guest

Similar Threads

  1. Get pdf filename during initialize:
    By cstham@adobeforums.com in forum Adobe Acrobat SDK
    Replies: 9
    Last Post: July 21st, 06:50 AM
  2. Opening the same filename
    By J. E. Goodman in forum FileMaker
    Replies: 3
    Last Post: September 18th, 03:10 PM
  3. Get .PHP Filename?
    By Ralph Freshour in forum PHP Development
    Replies: 4
    Last Post: September 11th, 04:46 PM
  4. PC to Mac jpg Filename Problem
    By webbolts in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 4
    Last Post: September 5th, 10:13 PM
  5. Invalid filename
    By jinglao webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 5
    Last Post: July 17th, 10:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139