# Prototype giving error in action script 2.0

**URL:** <https://forum.kirupa.com/t/prototype-giving-error-in-action-script-2-0/174254>\
**Category:** Uncategorized\
**Created:** [January 4, 2006, 6:26am UTC](https://forum.kirupa.com/t/prototype-giving-error-in-action-script-2-0/174254 "2006-01-04T06:26:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flash007](https://avatars.discourse-cdn.com/v4/letter/f/4bbf92/32.png) [@flash007](https://forum.kirupa.com/u/flash007)\
**Post date:** [January 4, 2006, 6:26am UTC](https://forum.kirupa.com/t/prototype-giving-error-in-action-script-2-0/174254/1 "2006-01-04T06:26:11Z")

</div>

Hi,  
following prototype is running fine for action action script 1.0 but its giving error in action script 2.0…  
Could anybody please tell me why I m having error…

Prototype is here:

> 

var str1 = new Array();

[COLOR=navy][COLOR=magenta]  
[COLOR=navy][COLOR=magenta]String.prototype.lettres = function() {  
cOK = “ABCDEFGHIJKLMNOPQRSTUVWXYZ”;  
if (cOK.indexOf(this.substr(0, 1).toUpperCase()) != -1) {  
str1[str1.length] = (this.substr(0, 1));  
}  
if (this.length\>1) {  
this.slice(1).lettres();  
}  
};[/COLOR]  
[/COLOR]  
(“a213213t3213u321313133l”).lettres();  
trace(str1);  
[/COLOR][/COLOR]

[/quote]thanks in advance…
