我正在尝试拖动我的面板并在某行之前停止我的面板。我不知道该怎么做。让我用我的代码解释一下(它不起作用):
//MyPanel
<s:Panel
mouseMove="rectangle_mouseMoveHandler(event)"
width="30" height="30" id="panel" backgroundAlpha="0.2"
mouseDown="onMouseDown(event)" mouseUp="onMouseUp(event)"
skinClass="intetech.PanelNoTitleBar" backgroundColor="blue">
</s:Panel>
//rectangle_mouseMoveHandler
protected function rectangle_mouseMoveHandler(event:MouseEvent):void
{
if ((panel.x+panel.width)>=(minimap.x+minimap.width)){
panel.x = (minimap.x+minimap.width-panel.width+0.001);
}
trace("panel.x = "+panel.x);
}