viewSourceURL属性:
可以从中查看应用程序源码的 URL。通过设置此属性,可以将“查看源”菜单项插入到应用程序的默认上下文菜单中(右键菜单)。选择此菜单项将在新窗口中打开 viewSourceURL。
verticalAlign属性:
top,middle,bottom.竖直位置
horizontalAlign属性:
left,center,right.水平位置
Flex读写XML的方法
Flex 读取xml文件的方法:
方法一:
private function readXML1():void{
var xmlFile:File = new File("file path");
var stream:FileStream = new FileStream();
stream.open(xmlFile, FileMode.READ);
var xml:XML = XML(stream.readUTFBytes(stream.bytesAvailable));
stream.close();
}
方法二:
private function readXML2():void{
var urlRequest:URLRequest = new URLRequest("xml file path");
var urlLoader:URLLoader = new URLLoader(urlRequest);
urlLoader.addEventListener(Event.COMPLETE,completeHandler);
}
private function completeHandler(event:Event):void{
var xml:XML = new XML(event.target.data);
trace(xml);
}
Flex写XML的方法:
public static function writeXMLFile(xml:XML):void{
var stream:FileStream = new FileStream();
var xmlFile:File = new File("file path");
var outputString:String = '<?xml version="1.0" encoding="utf-8"?>\n';
outputString += xml.toXMLString();
outputString = outputString.replace(/\n/g, File.lineEnding);
stream = new FileStream();
stream.open(xmlFile, FileMode.WRITE);
stream.writeUTFBytes(outputString);
stream.close();
}
继续寻找,不限制在AIR下的写的方法。。。