RE: [Flashcoders] Search in textfield AS2

2007-06-11 Thread vivek
var a=6.23456;
b=substring(a,1,5)

if (b == 6.234) {
trace(ok);
}
else{
trace(not ok)
}

Hope this will help you. :)


-Original Message-
From: Laurent CUCHET [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 11, 2007 4:35 PM
To: Flashcoders mailing list
Subject: [Flashcoders]  Search in textfield AS2

Hi

How can I do to find 5 caracter
in the 5 beginning caracter of var ?

Exemple :
var llat = ³6.23456²

how can I trace ³ok² if there is ³6.234² in llat var ?

if (?? == 6.234) {
trace(³ok²);
}



Thank you very much
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Search in textfield AS2

2007-06-11 Thread Mikko Törmälä

var llat:String = 6.23456;

if (llat.substr(0,5) == 6.234) {
   trace(ok);
} else {
   trace(not found);
}

- Mikko Törmälä

Hi

How can I do to find 5 caracter
in the 5 beginning caracter of var ?

Exemple :
var llat = ³6.23456²

how can I trace ³ok² if there is ³6.234² in llat var ?

if (?? == 6.234) {
trace(³ok²);
}



Thank you very much
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


  


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Search in textfield AS2

2007-06-11 Thread Wagner Amaral

var a:String = 6.23456;

if ( a.indexOf( 6.234 ) == 0 ) {
  trace( 6.234 are the first characters in  + a );
} else {
  trace( 6.234 are NOT the first characters in  + a );
}


indexOf() returns the index of the parameter inside the string, so if you
want the first position, the index would be 0



On 6/11/07, Laurent CUCHET [EMAIL PROTECTED] wrote:


Hi

How can I do to find 5 caracter
in the 5 beginning caracter of var ?

Exemple :
var llat = ³6.23456²

how can I trace ³ok² if there is ³6.234² in llat var ?

if (?? == 6.234) {
trace(³ok²);
}



Thank you very much
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com