title: Using the currentLabel property
body: <p>I am doing a project in AS3. It is a simple "slot machine." When the handle is clicked there are three MovieClips that play starting at random frames and when clicked again they stop on a random frame.</p>
  
  <p>Now, the part I'm having trouble with:  I need AS to evaluate the three frames (using currentLabel) and if they match launch a function called playWin.  If they don't match then nothing will happen.</p>
  
  <p>I tried a standard "if" statement but the currentLabel property is tripping me up. I also don't know how to compare three statements. I've only had practice comparing two.</p>
  
  <p>Any help would be appreciated!</p>
  
  <pre><code>package com.chandelle {
  import flash.display.MovieClip;
  import flash.display.FrameLabel;
  
  import flash.events.MouseEvent;
  
  public class Main extends MovieClip {
      var _spinner1:Spinner = new Spinner();
      var _spinner2:Spinner = new Spinner();
      var _spinner3:Spinner = new Spinner();
      var _lights:Lights = new Lights();
  
      public function Main() {
  
  
          var machine:Machine = new Machine();
          this.addChild(machine);
          machine.x = stage.stageWidth/2;
          machine.y = stage.stageHeight/2;
  
  
          machine.addChild(_lights);
          _lights.x = 14;
          _lights.y = -212;
          _lights.stop();
  
          var handle:Handle = new Handle();
          machine.addChild(handle);
          handle.x = 257;
          handle.y = -70;
          handle.addEventListener(MouseEvent.CLICK, spinSpinner);
  
  
          machine.addChild(_spinner1);
          _spinner1.x = 140;
          _spinner1.stop();
          _spinner1.addEventListener(MouseEvent.CLICK, stopSpinner);
  
  
          machine.addChild(_spinner2);
          _spinner2.x = 8;
          _spinner2.stop();
          _spinner2.addEventListener(MouseEvent.CLICK, stopSpinner);
  
  
          machine.addChild(_spinner3);
          _spinner3.x = -123;
          _spinner3.stop();
          _spinner3.addEventListener(MouseEvent.CLICK, stopSpinner);
      }
      private function spinSpinner(evt:MouseEvent):void {
          var num1:Number = Math.round(1+ Math.random() * 10);
          var num2:Number = Math.round(1+ Math.random() * 10);
          var num3:Number = Math.round(1+ Math.random() * 10);
          _spinner1.gotoAndPlay(num1);
          _spinner2.gotoAndPlay(num2);
          _spinner3.gotoAndPlay(num3);
      }
      private function stopSpinner(evt:MouseEvent):void{
          var num1:Number = Math.round(1+ Math.random() * 10);
          var num2:Number = Math.round(1+ Math.random() * 10);
          var num3:Number = Math.round(1+ Math.random() * 10);
          _spinner1.gotoAndStop(num1);
          _spinner2.gotoAndStop(num2);
          _spinner3.gotoAndStop(num3);
      }
  
  
  
      }
  
  
      //private function playWin():void{
          //_lights.play();
      }
  
  }  
  </code></pre>