# Somebody shoot me

**URL:** <https://forum.kirupa.com/t/somebody-shoot-me/29473>\
**Category:** Uncategorized\
**Created:** [August 27, 2003, 7:41am UTC](https://forum.kirupa.com/t/somebody-shoot-me/29473 "2003-08-27T07:41:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![inVZbl](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/invzbl/32/309_2.png) [@inVZbl](https://forum.kirupa.com/u/inVZbl)\
**Post date:** [August 27, 2003, 7:41am UTC](https://forum.kirupa.com/t/somebody-shoot-me/29473/1 "2003-08-27T07:41:45Z")

</div>

Alo

Having problems with the following script. What the script is supposed to do is, first find out if the variable name text is the length of for letters, then if it is check to see if the 4 letters is found in an array called buttons. If yes added one to attempts, if not add one to \*\*\*\*e.

At the moment its adding 2 to attempts everytime i click a button, and the array check doesnt work.

here is the code for the frame:

// Defines array buttons  
var buttons = new Array(“b1b2”,“b2b1”);

//Checks to see if text equals array  
clickaction = (text == buttons\*)

//Function for clicked buttons  
clickedbutton = function (){  
if (text.length == 4){  
for (var i=0 ; i \< buttons.length ; i++){  
if (clickaction){  
trace(“attempt is good”);  
attempts++  
text = “”  
}else{  
\*\*\*\*e++;  
text = “”  
}}}}

On the buttons i have added this script:  
on (release) {  
text = text + “b1”;  
clickedbutton();  
}

Where am i going wrong?? i am so baffeled at the moment

:q:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2003, 1:37pm UTC](https://forum.kirupa.com/t/somebody-shoot-me/29473/2 "2003-08-27T13:37:34Z")

</div>

I havn’t looked at your fla…but i’m not sure if you can use stars (\*) as part of a variable…unless \*\*\*\*e is not a variable. Can’t you give it a better name!!! Oh yea try to use AS tags next time 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 27, 2003, 11:40pm UTC](https://forum.kirupa.com/t/somebody-shoot-me/29473/3 "2003-08-27T23:40:26Z")

</div>

Sorry there not actual stars, i just called something that the swear filter on this board picked up.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 28, 2003, 3:28am UTC](https://forum.kirupa.com/t/somebody-shoot-me/29473/4 "2003-08-28T03:28:08Z")

</div>

i’m not really sure what you want to do, but i think the problem is:

if (text.length == 4)

Where do you input your text length or somethign?! i’m sorta confused…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 28, 2003, 4:20am UTC](https://forum.kirupa.com/t/somebody-shoot-me/29473/5 "2003-08-28T04:20:08Z")

</div>

Sorry, i think i confused myself on this one… i found out an easier way to do it from another other post. Thanks though
