2 Replies Latest reply on Sep 3, 2007 12:21 PM by bonions

    escape /unescape oddity in arrays

      i have a data array that im breaking up correctly for what i need, but ive started adding smaller arrays 'escaped' into this array so that when i break it up i can unescape the sub arrays for my purposes.
      dataarray=1,2,f,2,4,%20ghgj%kglf,2,3 ( the escaped %% bit altho not proper escaped is just to show as example where it stands)

      so when i extract the %20ghgj%kglf from the data array i can unescape it into a further array of
      now this seems to work fine on testing but on publishing doesnt work and by deduction sems to be the problem, ( if i remove the escaped section of the array and replace with a normal variable things work)

      are there any known problems with escape/unescape in arrays that i am missing?
      many thanks for your time
        • 1. Re: escape /unescape oddity in arrays
          Greg Dove Level 4
          I don't understand what you're doing. Are you trying to represent complex data in flashvars or external textfiles - e.g for LoadVars?

          If you are trying to represent an array as text so you can recreate it in flash then you can do it with different delimiters.

          So top level could be a comma and elements that are arrays could be delimited with whatever you want e.g. a pipe character (|) or maybe 2 pipe characters (||)
          That way you just use String.split at each level as required. But you can't easily specify the type of data.

          For a more generic way of representing complex data in flashvars or in loaded config files (i.e. from external text files ) you could try using a JSON implementation - check this out if so: http://tinyurl.com/2a55z6
          • 2. Re: escape /unescape oddity in arrays
            bonions Level 1
            thanks GWD, i was starting to think about doing something like that anyway as a workaround.
            It is loaded from a text file on publish but not on test so think that may be causing me problems...
            thanks again