Class org.as2lib.io.file.SimpleFile

org.as2lib.core.BasicClass
   +--org.as2lib.io.file.SimpleFile

Implemented Interfaces

File

Description

Default implementation of a file used within ActionScript. Supports all common features without any advantages.

Method Index

new SimpleFile()

addListener(), countLines(), exists(), getBytesLoaded(), getBytesTotal(), getContent(), getLine(), getLocation(), isLoaded(), isLoading(), load(), toString()

Constructor Detail

SimpleFile

public function SimpleFile(Void)

Constructs a new simple file. It prepares the helperXML and resets all states.

Method Detail

load

public function load(url:String):Void

Implementation of File.load.

Parameters

urlURL to be loaded.

Specified By

load() in org.as2lib.io.file.File

isLoading

public function isLoading(Void):Boolean

Implementation of File.isLoading.

Return

true if the File is still loading.

Specified By

isLoading() in org.as2lib.io.file.File

isLoaded

public function isLoaded(Void):Boolean

Implementation of File.isLoaded.

Return

true if the File is already loaded.

Specified By

isLoaded() in org.as2lib.io.file.File

exists

public function exists(Void):Boolean

Implementation of File.exists. This is a low level implementation of .exists. It won't work properly if you didn't load a file before.

Return

true if the file exists.

Throws

FileNotLoadedExceptionif no file was loaded before. (Is related to the onLoad event.)

Specified By

exists() in org.as2lib.io.file.File

getBytesLoaded

public function getBytesLoaded(Void):Number

Implementation of File.getBytesLoaded.

Return

Total amount of bytes loaded.

Specified By

getBytesLoaded() in org.as2lib.io.file.File

getBytesTotal

public function getBytesTotal(Void):Number

Implementation of File.getBytesTotal.

Return

Total file size in bytes.

Specified By

getBytesTotal() in org.as2lib.io.file.File

getLocation

public function getLocation(Void):String

Implementation of File.getLocation.

Return

Recent loaded location.

Specified By

getLocation() in org.as2lib.io.file.File

getContent

public function getContent(Void):String

Implementation of File.getContent.

Return

Content of the File (if the file is loaded, else "null")

Specified By

getContent() in org.as2lib.io.file.File

getLine

public function getLine(line:Number):String

Implementation of File.getLine.

Return

Content of the requested line, "undefined" if the line doesn't exist.

Specified By

getLine() in org.as2lib.io.file.File

countLines

public function countLines(Void):Number

Implementation of File.countLines.

Return

Total amount of lines in the content.

Specified By

countLines() in org.as2lib.io.file.File

addListener

public function addListener(listener:FileListener):Void

Implementation of File.addListener.

Parameters

listenerListener to be added to the file.

Specified By

addListener() in org.as2lib.io.file.File

toString

public function toString():String

Extended Stringifier Example: [type org.as2lib.io.file.SimpleFile | Location: MyFile.txt; Size: 12KB; ]

Return

The file as string.

Specified By

toString() in org.as2lib.core.BasicInterface

Overrides

toString() in org.as2lib.core.BasicClass