# Why doesn't this work?

**URL:** <https://forum.kirupa.com/t/why-doesnt-this-work/67885>\
**Category:** Uncategorized\
**Created:** [October 20, 2004, 1:22pm UTC](https://forum.kirupa.com/t/why-doesnt-this-work/67885 "2004-10-20T13:22:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![innoxist](https://avatars.discourse-cdn.com/v4/letter/i/a88e4f/32.png) [@innoxist](https://forum.kirupa.com/u/innoxist)\
**Post date:** [October 20, 2004, 1:22pm UTC](https://forum.kirupa.com/t/why-doesnt-this-work/67885/1 "2004-10-20T13:22:55Z")

</div>

I’m a beginner to Actionscript still, so pardon me if I make some really stupid mistakes.

I made one of those things where you click one of the squares and it changes colour. When you click it again it changes back to the original colour. I have 3 of these called **box1** , **box2** and\*\* box3\*\* respectively.

I did this by creating 3 frames in the “box” mc, the first one being the original colour and containing **stop();**.

The second frame has the second changed colour, and **stop();**.

The third frame has **gotoAndPlay(1);**

Basically I instructed the clip to play the currentFrame+1 everytime it was clicked.

Then I placed the following code on the \_root level on frame 1:

\*\*\_root.clear.onRelease = function() {  
n=1;  
while(n\<4) {  
\_root[“box”+n].gotoAndPlay(1);  
n++;  
};  
};

\*\*Thanks for any help in advance.
