[osflash] How do you do Masking? Do we need another new way?

iiley iiley.chen at gmail.com
Wed Mar 7 05:39:45 EST 2007


A online demo here:
http://www.rgenerat.org/iileyblog/?p=64


2007/3/7, iiley <iiley.chen at gmail.com>:
>
> OH, NO!!!!!!!!!! AS3/FlashPlayer9 is driving me crazy these days!
>
> Rakos, you are right, masked by child is very cool, i love it. BUT, there
> is a bug of event triggering, see this demo:
>
>
> package
> {
> import flash.display.Sprite;
> import flash.display.Shape;
> import flash.filters.GlowFilter;
> import flash.events.MouseEvent;
>
> public class MaskTest extends Sprite
> {
>  private var sprite:Sprite;
>
>  public function MaskTest()
>  {
>   super();
>
>   sprite = new Sprite();
>   sprite.graphics.beginFill(0xff0000);
>   sprite.graphics.drawRect (0, 0, 100, 100);
>   sprite.graphics.endFill();
>   addChild(sprite);
>
>   var clip:Sprite = new Sprite();
>   clip.graphics.beginFill(0x000000);
>   clip.graphics.drawEllipse(0, 0, 100, 100);
>   clip.graphics.endFill ();
>   sprite.addChild(clip);
>   sprite.mask = clip;
>
>   //if you comment this line, the mouse down event will works well
>   //Why?????????
>   sprite.filters = [new GlowFilter(0x0000FF, 1, 10, 10, 4)];
>   //If you comment this line, the event works well too.
>   sprite.y = 150;
>   sprite.addEventListener(MouseEvent.MOUSE_DOWN, __mouseDown);
>  }
>
>  private function __mouseDown(e:MouseEvent):void{
>   trace("__mouseDown");
>  }
> }
> }
> If i moved both set filters and moved sprite, the mouse event will not
> trigger, if i comment any one of them, then event triggers corrently.
> This must be a bug of filters, similar to filters work with scrollRect
> bug.
>
> Sadly~~~ my poor flash player 9. sadly.................
>
> Regards~~~
>
> --
> iiley
> AsWing http://www.aswing.org
> Personal http://www.iiley.com
>



-- 
iiley
AsWing http://www.aswing.org
Personal http://www.iiley.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/osflash_osflash.org/attachments/20070307/27b50d7c/attachment.htm


More information about the osflash mailing list