package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var filename:String = "document.jpg";
var extensionIndex:Number = filename.lastIndexOf( '.' );
var extension:String = filename.substr( extensionIndex + 1, filename.length );
trace( "The file extension is " + extension );
}
}
}
|