A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: csv path problem with server / and \

Threaded View

  1. #3
    Senior Member
    Join Date
    Dec 2002
    Location
    Netherlands
    Posts
    1,632
    Unfortunately flash doesn't have an easy replace function.
    In this case the easiest way may be to use a temporary array.
    Assuming the filename is in a variable named filename you can do it like this
    Code:
    tmpArray = filename.split(String.fromCharCode(0x5c));
    tmpArray[0] = 'http://www.domain.de';
    filename = tmpArray.join(String.fromCharCode(0x2f));
    The first line splits the string in an array using \ as a delimiter.
    The second line replaces the first item c: with your domain.
    The third line combines it to a string again but this time with / as a delimiter.

    If you don't want the domain name in it you can use
    tmpArray.shift();
    as the second line to remove the first array item.
    Last edited by w.brants; 04-15-2006 at 01:11 PM.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center