ahh, somehow i missed that comment...
well i checked and it seemed to be half broken - some things worked and some didn't.
i tweaked the code a little bit - ended up escaping *everything* going out of the flash movie, but it looks like there are still some issues with spaces. backslashes and forwards slashes work, along with everything else I tested except for spaces.
I'm thinking at this point it's a bug in the serialization code in the flash player. the only character it seems to have issues with is a space (" ").
all the replace() calls work fine, but when i try to match a space: /\s/ the result is always null.
so when you try to match multiple spaces, the result is an array of null values, but i knows how many spaces there are at least :)
so it must just be an issue with passing a single space through ExternalInterface. but other than that it works great.
I updated my example on that page to address a couple bugs - check it out.
here's a zip of the files:
and the sample page:
if you want, try testing a few complex regex patterns and see how it handles them... as long as a result of a match isn't an empty space (or a bunch of spaces) it should work fine.
also replace() works with spaces now, so if that's all you need you could use this method.
On Feb 24, 2006, at 12:49 PM, erixtekila wrote:
just to add some more to this conversation - i made a flash 8 /
externalinterface regex setup...
the flash just passes the regex out to the browser and then uses
_javascript_ to test/match and gets an answer back.
here's the post:
externalinterface/
Yes, but did you read my comment at the end of the file ?
it is because RegExp uses metacharacters that conflicts with as strings.
Any idea on this ?
Thanks.
-----------
erixtekila
_______________________________________________
osflash mailing list
_______________________________________________
osflash mailing list