Posts

Showing posts from February, 2010

Accessing File System

import flash.filesystem.*; public class MyFile { private var stream: FileStream; private function saveFile(): void { var file:File = File.desktopDirectory.resolvePath("file.txt"); var stream:FileStream = new FileStrem(); stream.open(fiel, FileMode.WRITE); var str:String = "file content"; stream.writeUTFBytes(str); stream.close(); } }

Building a Flex Custom Component Using ActionScript

// MyComboxBox.as package mycomponets; { import mx.controls.ComboBox; public class MyComboBox extends ComboBox { public function MyComboBox() { dataProvider = ["Hyderabad", "Bangalore", "Pune", "Noida"]; } } }

Generating random numbers within a given limit using ActionScript 3.0

Math.round(Math.random() * (high - low)) + low;