Eric,
Thank a lot for link to this great site :-).

As for "in_array", aren't string-based functions like mine faster than
these loops?
 I especially like this:

=========  author: lochie [+], Submitted: 10.17.02 1a =====
Array.prototype.find = function(n, lookwithin) {
if (lookwithin) {
var ex = "";
} else {
var ex = "^";
}
return ("^"+this.join("^")+"^").split(ex+n+ex).length>1;
};
=========

-- 
Best regards,
 GregoryN                        
================================
http://GOusable.com
Flash components development.
Usability services.

On 12/16/05, eric dolecki <[EMAIL PROTECTED]> wrote:
>
> Guy Watson:
>
> Array.prototype.in_array=function(value){
>       for(var z=0;z<this.length;++z){
>               if(this[z] == value){
>                       return true
>               }       
>       }
>       return false
> }
>
>
> Also found this @ layer51.com/proto:
>
>   msg3 { *k-zimir* [+] <http://www.layer51.com/proto/up.aspx?u=k-zimir>,
> posted: 10.22.02 9a∙-, top [^] <http://www.layer51.com/proto/d.aspx?f=6#>} 
> except using a while loop,
> this returns the position if found and -1 if
> not.. might be little handsomer sometimes.
>
> Array.prototype.in_array=function(value){
> var l;
> l = this.length;
> while(l--)
> {
> if(this[l] == value){
> return l;
> }
> }
> return -1;
> }
>
> Of course you could rewrite the above to make them AS2. There are tons of
> Array prototypes to be found there. (www.layer51.com/proto)
>
> edolecki


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to