0 Replies Latest reply on Jul 26, 2007 7:32 AM by Izzy1138

    Rotate throwing error

    Izzy1138 Level 1
      Hi All,
      I get this error when I run this code. The application is calling the increment method. I have checked this code against a couple different examples and I don't see anything different. What am I missing?
      Thanks.

      Error #1006: value is not a function.
      at mx.effects::EffectInstance/play()[C:\dev\flex_201_gmc\sdk\frameworks\mx\effects\EffectIns tance.as:521]
      at mx.effects.effectClasses::RotateInstance/play()[C:\dev\flex_201_gmc\sdk\frameworks\mx\eff ects\effectClasses\RotateInstance.as:202]
      at mx.effects::EffectInstance/startEffect()[C:\dev\flex_201_gmc\sdk\frameworks\mx\effects\Ef fectInstance.as:502]
      at mx.effects::Effect/play()[C:\dev\flex_201_gmc\sdk\frameworks\mx\effects\Effect.as:763]

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Canvas xmlns:mx=" http://www.adobe.com/2006/mxml">
      <mx:Image source="xyz.swf" id="lens"/>
      <mx:Rotate id="rotate" target="lens"/>

      <mx:Script>
      <![CDATA[
      private var _angle : int = 0;

      [Bindable(event="valueChanged")]
      public function get angle() : int {
      return _angle;
      }

      public function set angle(angle:int) : void {

      if( rotate.isPlaying ) rotate.end();
      rotate.angleFrom = _angle;
      rotate.angleTo = angle;
      rotate.play();

      _angle = angle;

      dispatchEvent( new Event("valueChanged") );
      }

      public function incrementAngle() : void {
      this.angle = _angle + 1;
      }

      public function decrementAngle() : void {
      this.angle = _angle - 1;
      }
      ]]>
      </mx:Script>
      </mx:Canvas>