How to crop / crop on Sprite in Flex?
<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="Init()">
<mx:Script>
<![CDATA[
public function Init():void {
var spr:Sprite=new Sprite();
uic.addChild(spr);
uic.graphics.lineStyle(2,0);
uic.graphics.moveTo(22, 22);
uic.graphics.lineTo(2222, 2222);
}
]]>
</mx:Script>
<mx:Panel title="StackOverflow">
<mx:UIComponent width="200" height="200" id="uic"/>
</mx:Panel>
</mx:WindowedApplication>
Note that lineTo completely leaves UIComponent and Panel.
How can I make crop / crop my UIComponent or Sprite or Panel? alt text http://www.liquidfeline.com/images/stackoverflow.png
I understand that I can just change the hard-coded 2222 to something more reasonable, but I need a generalized solution to this, since in the actual project there are no hard-coded values that I can change, but it works with dynamic data.
source
share