Hello,
I try to use scrollRect
package;
import com.SpriteMask;
import flash.display.Sprite;
import flash.events.MouseEvent;
class Main extends Sprite
{
private var spriteMask:SpriteMask = new SpriteMask();
public function new()
{
super();
spriteMask.graphics.beginFill(0x0000FF);
spriteMask.graphics.drawRect( 0, 0, 200, 200);
spriteMask.graphics.endFill();
spriteMask.buttonMode = true;
spriteMask.addEventListener(MouseEvent.CLICK, mouseClickOutsideHandler);
this.addChild( spriteMask );
}
private function mouseClickOutsideHandler(event:MouseEvent):Void
{
trace( spriteMask.width, spriteMask.height );
}
}
and
package com;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Rectangle;
class SpriteMask extends Sprite
{
public function new()
{
super();
this.scrollRect = new Rectangle( 0, 0, 100, 100);
var sprite:Sprite = new Sprite();
sprite.graphics.beginFill(0xFF0000);
sprite.graphics.drawRect( 0, 0, 200, 200);
sprite.graphics.endFill();
this.addChild(sprite);
}
}
but spriteMask.width, spriteMask.height return 200, 200 and not 100, 100 ?
thanks