[BNM] Flash text variables issue

Paul Booth paul at paulbooth.com
Tue Nov 14 10:35:45 GMT 2006


Hi Rob,

Glad you found a solution. A trim function is used to remove leading and
trailing whitespace from a string but it looks like AS doesn't include a
trim function as standard (I assumed it would). Here is a link to a class
which adds this
functionality<http://theolagendijk.wordpress.com/2006/06/30/experience-with-actionscript-20/>
if
you need it in the future.

Cheers,

Oaul.


On 14/11/06, Robert Stevens <robs_here at btinternet.com> wrote:
>
> Hi Paul,
>
> I'm not sure what the "trim function" is.
> Anyway, I think I've fixed it by having it check for
> both  == "undefined" and == "");
>
> Cheers,
> Rob
>
>
> --- Paul Booth <paul at paulbooth.com> wrote:
>
> > I'd use the trim function on the text, then check
> > for an empty string.
> >
> > Cheers,
> >
> > Paul.
> >
> >
> > On 14/11/06, Robert Stevens
> > <robs_here at btinternet.com> wrote:
> > >
> > > Morning All,
> > >
> > > Here's my Flash problem.
> > >
> > > I have a flash form that has 5 txt fields. A
> > 'submit'
> > > button Mc checks that all fields have been filled
> > in
> > > before the movie can go forward.
> > >
> > > This all works perfectly fine by checking that the
> > txt
> > > field vars are == "null" or "undefined". But I
> > have
> > > discovered an issue...
> > > If I type into one of the fields and then remove
> > the
> > > text using the backspace or delete key and leave
> > it
> > > blank - it then fails to be recognised as "null"
> > or
> > > "undefined". I've checked the output window and
> > what
> > > seems to be occuring is some sort of white space.
> > > Have looked into a KeyPress work around but to no
> > > avail, yet.
> > > Has anybody come across this issue?
> > >
> > > If I can't solve it - it may be that as a
> > workaround I
> > > will need to check for the presence of at least 2
> > > characters in the text fields. If so, can anyoine
> > > advise on how I could do this?
> > >
> > > Many thanks,
> > >
> > > 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/
> > >
> > --
> >
> > 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/
> >
>
>
> --
>
> 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