Core functionality

Categories:Framework basics


The core of the xJSFL framework is the xjsfl object. It by no means contains the majority of the functionality of the framework, but it does contain some important methods and properties that you will commonly use in your xJSFL development.

Some of the core xJSFL methods are used internally, and some are meant for developer use; this page briefly discusses the latter.

More detailed information is available in the API section.

Core functionality

Initialize the framework (see xJSFL Environment for more details)


Trace output to the output panel

trace('This is a trace');

Clear the output panel


Get the current document DOM

$dom; // same as fl.getDocumentDOM()

Get and set the current selection

var selection = $selection;
$selection = someObject;

File and URI functionality

The URI of the xJSFL root folder


Load a file relative to the current file:

var txt = load('text.txt');

Load an XML file from the cascading file structure

var xml = load('path/to/file.xml', 'settings'); // will return the appropriate datatype

Grab a URI

var uri = new URI.toURI('../parent file.txt'); file:///E|/some/path/to/parent file.txt

Get Flash elements, and show a standard warning if not available

The current document

var dom = UI.dom;
if(dom){  }

Selected library items

var items = UI.items;
if(items){  }

Current selection

var sel = UI.selection;
if(sel){  }

Next Steps

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>