Core functionality

Categories:Framework basics

Overview

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)

xjsfl.init(this);

Trace output to the output panel

trace('This is a trace');

Clear the output panel

clear();

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

xjsfl.uri;

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

Comments are closed.