# Question about AS1 to AS2 conversion of slots.fla

**URL:** https://forum.kirupa.com/t/question-about-as1-to-as2-conversion-of-slots-fla/271127
**Category:** flash
**Created:** [September 18, 2008, 5:59pm UTC](https://forum.kirupa.com/t/question-about-as1-to-as2-conversion-of-slots-fla/271127 "2008-09-18T17:59:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![somnamblst](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@somnamblst](https://forum.kirupa.com/u/somnamblst)
#### Post date: [September 18, 2008, 5:59pm UTC](https://forum.kirupa.com/t/question-about-as1-to-as2-conversion-of-slots-fla/271127/1 "2008-09-18T17:59:50Z")

</div>

I was looking for a tutorial or example of a very simple slot machine that is also easy to win and found a perfect example on the old Macromedia site from 2000. I didn’t even notice until much later that I was tweaking an AS1 file. Not having learned AS1 I am at a loss as to how to convert it without breaking it.

AS1

```auto
LeftChip = random(3);
tellTarget ("/LeftReel") {
 gotoAndStop(Number(/:LeftChip)+1);
}
CenterChip = random(3);
tellTarget ("/CenterReel") {
 gotoAndStop(Number(/:CenterChip)+1);
}
RightChip = random(3);
tellTarget ("/RightReel") {
 gotoAndStop(Number(/:RightChip)+1);
}

```

I have successfully removed characters that Flash identified as errors /: but that breaks the You Win functionality when you you match 3 images.

The AS1 for that was

```auto
if ((Number(LeftChip) == Number(CenterChip)) and (Number(CenterChip) == Number(RightChip))) {
 gotoAndPlay("You Win");
} else {
 gotoAndStop("Reset");
}
 
and 
 
stop();
call("/:Compare");

```
