com.michaelhejja.xmleditor.XMLInterface
An optional variable that can set the base or "root" of your interface. For example, if you had many levels of child movieclips being loaded and removed from the stage, you can always reference the base of your interface by using XMLInterface.base
baseurl gets passed to the interface from the main application if it has been set for this page inside of the Page Options window. This can help to complete the URL path to content (images, video, mp3) if the XML file itself does not contain the full path.
This only stores the location of our current XML file inside of the XML Manager. You should never need to mess with this variable at all when creating a custom interface.
This is the actual XML Data that we will be representing and manipulating. If the variable 'testing' is set to 'false,' XML data will be received directly from the XML Editor main application. If testing is set to true, a text XML file will be loaded (defined by testXMLPath), then XMLData will be received from the test file. This allows us to build and test interfaces independent from the main application.
Specifies whether we are in testing or live mode. If testing is set to true, the XML File defined by textXMLPath will be loaded, then the init() function will be fired. If testing is false, we are assuming that the interface will be loaded inside of the editor, and init() will immediately be fired. An interface with testing set to false will not function outside of the main application, so don't be alarmed if you receive runtime errors when compiling the file.
The default value is set to false
Specifies the location of the XML file that will be loaded when testing is set to true
This is the actual loader that loads the test XML file in testing mode. You should never need to mess with this variable at all when creating a custom interface.
This is a local instance of the XMLManager class, basically used to communicate between the main application and our interface. You you will probably never need to mess with this when creating a custom interface.
The constructor only creates a new instance of the XMLManager class and the added to stage event listener
Fires once the interface is added to the stage. It first checks whether testing is set to true or false. If true, we will load a local XML File specified by textXMLPath. If false, it will try to load the XML data from the Main application through XMLManager
init is where we start building our interface and all of its functionality.
If we are in live mode (testing = false), XMLData will immediately be received from the main application and init() will fire. If testing = true, init will fire only after the text XML file has been loaded. We will override this function on our own interface
example:
public override function init():void {
buildOurInterface();
}
onXMLSaved fires after the XML file has successfully been saved. We will override this function in our own interface.
example:
public override function onXMLSaved():void {
showSavedMessage();
}
This function will 'dim the lights' and load a movieclip (specified by clip) on top of the editor.
Unloads a loaded component movieclip (specified by clip) and fades the page back to normal.
example of loading and unloading a component on top of the page:
private function openEditor(e:Event):void {
thumbCreator = new ThumbCreator();
loadComponent(thumbCreator);
thumbCreator.addEventListener(ThumbCreator.ON_EXIT, unloadThumbCreator);
}
private function unloadThumbCreator(e:Event){
XMLInterface.base.unloadComponent(thumbCreator);
}
Sends our XMLData (which we have manipulated) back to the XMLManager to save the file. When save is complete, onXMLSaved() will fire.
This is a local instance of the XMLManager class, basically used to communicate between the main application and our interface. You you will probably never need to mess with this when creating a custom interface.