dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Help with .split delimiters

  1. #1
    Senior Member
    Join Date
    Nov 2001
    Location
    Houston TX
    Posts
    563

    [F8] Help with .split delimiters

    Hi,
    I am working with a string which has been imported from an XML file which contains double quotes in it. I need to use the split function to serperate out the data in the string between the double quotes to an array.

    Here is the string...

    <node label=" Specialized Bones B" ImageCount="1" />

    Here is the script I am using which gives me an undefined when I trace it.

    var charDelimiter = "\"";
    var folder_array:Array = this.target.selectedNode.split(charDelimiter);
    trace(folder_array[0]);


    The charDelimiter variable is not working.

    What am I doing wrong?

    Also, where can I find a complete list of exceptable delimiters for flash?

    Best regards
    Toby
    Best regards
    Toby Mack

    For the best and funniest Audio Blog on the Internet come visit:

    http://feeds.feedburner.com/Fla****UpBlog

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    escape the string and split by the url-encoded char.
    an example -
    PHP Code:
    str escape('<node label=" Specialized Bones B" ImageCount="1" />');
    arr str.split('%22');

    trace(unescape(arr[1])); //  Specialized Bones B
    trace(unescape(arr[3])); // 1 

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