如何将 Flex Alert 框放置在某个 x,y 位置,以下代码不起作用,Alert 框始终位于屏幕中央。
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" >
<fx:Script>
<![CDATA[
import mx.controls.Alert;
protected function showAlert(event:MouseEvent):void
{
myAlert = Alert.show('alert', 'Error - ');
myAlert.x = 40;
myAlert.y = 50;
// myAlert.move(-400,-500); // doesn't work either
}
private var myAlert:Alert;
]]>
</fx:Script>
<s:Button label="click me" click="showAlert(event)" />
</s:Application>