1 Reply Latest reply on Jun 20, 2006 11:35 AM by Peter Lorent

    help with error please

    DPSwebmaster Level 1
      I am receiving an error trying to create a drop shadow with AS, and I am not sure why. I think the problem could be coming from using Flash MX with a Flash 8 tutorial, but I am not sure.

      the error:

      Scene=Scene 1, Layer=Layer 1, Frame=1: Line 2: ';' expected
      import flash.filters.DropShadowFilter;

      Scene=Scene 1, Layer=Layer 1, Frame=1: Line 19: '{' expected
      shapeClip.onPress = function():Void {

      Scene=Scene 1, Layer=Layer 1, Frame=1: Line 22: Unexpected '}' encountered
      };


      and the code:

      //import the filter classes
      import flash.filters.DropShadowFilter;
      //create a movie clip called shapeClip
      this.createEmptyMovieClip("shapeClip", 1);
      //use the drawing API to draw a shape
      with (shapeClip) {
      beginFill (0xFF0000, 100);
      moveTo(0, 0);
      lineTo(100, 0);
      lineTo(100, 100);
      lineTo(0, 100);
      lineTo(0, 0);
      endFill();
      }
      //position the shape
      shapeClip._x = 100;
      shapeClip._y = 100;
      //click the square, increase shadow strength
      shapeClip.onPress = function():Void {
      dropShadow.strength++;
      shapeClip.filters = [dropShadow];
      };
      //create a filter
      var dropShadow:DropShadowFilter = new DropShadowFilter(4, 45, 0x000000,
      0.4, 10, 10, 2, 3);

      var mouseListener:Object = new Object();
      //create and apply a listener that controls the filter when the mouse moves
      mouseListener.onMouseMove = function():Void {
      dropShadow.distance = (_xmouse / Stage.width) * 50 - 20;
      dropShadow.blurX = (_ymouse / Stage.height) * 10;
      dropShadow.blurY = dropShadow.blurX;
      shapeClip.filters = [dropshadow];
      };
      Mouse.addListener(mouseListener);

      TIA