Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-03-2003, 06:36 AM
Member
 
Join Date: Jun 2003
Posts: 39
Default search

I'm not having any luck trying to use the search method.

I have tried may different ways to get it to work but still always get '-1' as my result. What am I doing wrong?

istest = new String('I am a hairy cat');
var name = 'cat';
var result = istest.search('cat');
trace('cat: ' + result);

I get '-1' even if I use:
var result = istest.search(name);

Any ideas?

Also the example for match does not even use match.
Reply With Quote
  #2 (permalink)  
Old 09-03-2003, 08:58 AM
Member
 
Join Date: Jan 2003
Posts: 54
Default Re:search

search works with an instance of a regular Expression (just let Topcmm tell u what is that).

try this:
istest = 'I am a hairy cat';
s = /cat/i
r = istest.search(s)
trace(r)

u can also use if (istest.indexOf('cat')!=-1) bla...bla

Madcha
__________________
http://www.alyze.com - http://www.ecomzone.net - http://www.alisook.com -http://www.madcha.com - http://www.i-multimedia.fr -
Reply With Quote
  #3 (permalink)  
Old 09-03-2003, 11:25 PM
Member
 
Join Date: Jun 2003
Posts: 39
Default Re:search

Thanks for your quick reply - working wonders.

Any SWFKit workers reading this, you may want to add an example like this to the Manual.

Thanks Madcha.
Reply With Quote
  #4 (permalink)  
Old 09-06-2003, 06:31 PM
Member
 
Join Date: Jan 2003
Posts: 54
Default Re:search

Quote:
Thanks Madcha.
De Nada.

U can download from the microsoft web site the full documentation about Jscript 5 dot something.
As the SWFKIT's script core is the same (among myself...no warranty at all about that ;D )
as the official Jscript you may find that doc usefull.

Apache
Madcha
__________________
http://www.alyze.com - http://www.ecomzone.net - http://www.alisook.com -http://www.madcha.com - http://www.i-multimedia.fr -
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:17 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.