Thursday, October 30, 2008

How to set the icons for an AIR application in Flex?

Open [ApplicationName]-app.xml file and add the following.

< icon>
< image16x16> yourIcon16.png</image16x16>
< image32x32> yourIcon32.png</image32x32>
< image48x48> yourIcon48.png</image48x48>
< image128x128> yourIcon128.png</image128x128>
</icon>

Icons will be included/updated once you build the .air package.

How to read a file from an AIR application in Flex?

//To read the file "src/myFiles/sampleFile.txt"

var myFile:File = File.applicationDirectory;
myFile = myFile.resolvePath("myFiles\\sampleFile.txt");

var myFileStream:FileStream = new FileStream();
myFileStream.open(myFile, FileMode.READ);

var fileData:String = myFileStream.readUTFBytes(myFileStream.bytesAvailable);

Tuesday, October 14, 2008

Flex 3: Panel is not showing rounded corners at the bottom even after setting cornerRadius

You will get rounded corners at the bottom only if your panel contains a control bar. So if you need rounded corners at the bottom of the panel then add a control bar to your panel.

< mx:Panel >
< !-- What ever you already have -- >
< mx:ControlBar/ >
< mx:Panel >

Here the colour of the control bar will be the colour of your panel border.