[BNM] Flash "if" statement @
Seb L
pluginseb at gmail.com
Wed Nov 1 00:01:30 GMT 2006
Hi Robert,
indexOf should work fine in this case... check for a result of -1 :
var mystr:String = "12345 at 234";
var mystr2:String = "123454t";
trace(mystr.indexOf("@")); // returns 5
trace(mystr2.indexOf("@")); // returns -1
If that's still not working I suspect you have a referencing problem,
make sure you're actually testing the right thing! I'd trace the value
to make sure that it's what you should be checking.
good luck :-)
Seb
On 31/10/06, Robert Stevens <robs_here at btinternet.com> wrote:
> Hi All,
>
> An easy one here for many of you I'm sure.
>
> I have a function set up for a button which includes
> an 'if' statement.
> I simply need to check if the "@" symbol is present in
> a form field.
> I've tried the "indexOf" method but it didn't seem to
> work.
>
> Thanks in advance,
>
> Rob
>
>
> --
>
> BNM info/subscription/archives: http://www.brightonnewmedia.org/
>
> BNM archive search: http://www.roddis.org/bnm/search.php
> BNM Del.icio.us tag: http://del.icio.us/tag/bnm/
> BNM Flickr group: http://www.flickr.com/groups/bnm/
>
> BNM powered by http://www.screen-play.net/
>
More information about the BNMList mailing list
BNMList is hosted by Screenlists, a Screen-Play.net service