com.theoworlds.TheoApp

TheoApp class -- basic Theo application class.  All other Theo apps should extend it

Version

1.0

Author

© TheoWorlds.com, 2007--2008.

Summary
com.theoworlds.TheoAppTheoApp class -- basic Theo application class.
Variables
_confInstance
_ui
_worldTargetMC
_world
_worldLogic
_worldDelegates
_mapXMLthis object is used for loading and parcing the map XML.
_libraryloads, parces and manages the libraries data
Functions
TheoAppConstructor.
initUIUI initialization -- to be implemented in the child classes
initConfigloads the configuration XML
onLoadedConfigevent generated at the end of the loading and parcing of the config.xml file
initcalled after the parcing of config.xml.
loadMapXMLloads the XML of a given map
onLoadXMLMapevent generated when the map XML is loaded
onParsedMapXMLLibraryevent generated when the map XML is parsed
parseMapXMLLibrarythis function does: 1 -- “finds” the <library> tag in the XML of the map, and parses it 2 -- creates a new object (Library) 3 -- generates an event when the parcing is over -- this.onParsedMapXMLLibrary();
parseMapXMLParses the loaded XML of a map
createNewWorldthis function does: 1 -- destroys the old World 2 -- creates a new one (if there is no UI -- directly in the _root)
getNewChatColorForCharater
uiHandlerto be implemented in the child classes
worldLogicHandler
worldHandler
onMouseDown
destroyWorlddestroys the World

Variables

_confInstance

private var _confInstance: Config

_ui

private var _ui: ITheoUI

_worldTargetMC

private var _worldTargetMC: MovieClip

_world

private var _world: World

_worldLogic

private var _worldLogic: WorldLogic

_worldDelegates

private var _worldDelegates: Array

_mapXML

private var _mapXML: XML

this object is used for loading and parcing the map XML.  It’s discarded at the end

_library

private var _library: Library

loads, parces and manages the libraries data

Functions

TheoApp

function TheoApp(gui)

Constructor.  As a parametter it get the link to the UI It needs it to know from who to pass the messages to the WorldLogic & World -- from UI or from own mouse events

Parameters

param gui:UI (UI)

initUI

private function initUI():Void

UI initialization -- to be implemented in the child classes

initConfig

private function initConfig():Void

loads the configuration XML

onLoadedConfig

private function onLoadedConfig(event: Object):Void

event generated at the end of the loading and parcing of the config.xml file

Parameters

success(Boolean)

init

private function init():Void

called after the parcing of config.xml.  To be implemented in child classes

loadMapXML

private function loadMapXML(url: String):Void

loads the XML of a given map

Parameters

param url (String)

onLoadXMLMap

private function onLoadXMLMap(success: Boolean):Void

event generated when the map XML is loaded

Parameters

param success (Boolean)

onParsedMapXMLLibrary

private function onParsedMapXMLLibrary():Void

event generated when the map XML is parsed

parseMapXMLLibrary

private function parseMapXMLLibrary():Void

this function does: 1 -- “finds” the <library> tag in the XML of the map, and parses it 2 -- creates a new object (Library) 3 -- generates an event when the parcing is over -- this.onParsedMapXMLLibrary();

parseMapXML

private function parseMapXML():Object

Parses the loaded XML of a map

Returns

returns Object that contains the attributes needed to generate the new World

createNewWorld

private function createNewWorld(mapInfo: Object):Void

this function does: 1 -- destroys the old World 2 -- creates a new one (if there is no UI -- directly in the _root)

Parameters

param mapInfo (Object)

getNewChatColorForCharater

private function getNewChatColorForCharater():Number

uiHandler

private function uiHandler(o: Object):Void

to be implemented in the child classes

worldLogicHandler

private function worldLogicHandler(o: Object):Void

worldHandler

private function worldHandler(o: Object):Void

onMouseDown

function onMouseDown():Void

destroyWorld

private function destroyWorld():Void

destroys the World

TheoChatUI class - TheoChat application main class
TheoEditor class - Theo MapEditor application main class
private var _confInstance: Config
private var _ui: ITheoUI
private var _worldTargetMC: MovieClip
private var _world: World
private var _worldLogic: WorldLogic
private var _worldDelegates: Array
private var _mapXML: XML
this object is used for loading and parcing the map XML.
private var _library: Library
loads, parces and manages the libraries data
function TheoApp(gui)
Constructor.
private function initUI():Void
UI initialization -- to be implemented in the child classes
private function initConfig():Void
loads the configuration XML
private function onLoadedConfig(event: Object):Void
event generated at the end of the loading and parcing of the config.xml file
private function init():Void
called after the parcing of config.xml.
private function loadMapXML(url: String):Void
loads the XML of a given map
private function onLoadXMLMap(success: Boolean):Void
event generated when the map XML is loaded
private function onParsedMapXMLLibrary():Void
event generated when the map XML is parsed
private function parseMapXMLLibrary():Void
this function does: 1 -- “finds” the <library> tag in the XML of the map, and parses it 2 -- creates a new object (Library) 3 -- generates an event when the parcing is over -- this.onParsedMapXMLLibrary();
LibraryItem class i- stores and manages a collection of LibraryItem objects organized in sub-libraries - those are map objects like Floor tiles, Furniture and Characters that can be placed on maps
private function parseMapXML():Object
Parses the loaded XML of a map
private function createNewWorld(mapInfo: Object):Void
this function does: 1 -- destroys the old World 2 -- creates a new one (if there is no UI -- directly in the _root)
private function getNewChatColorForCharater():Number
private function uiHandler(o: Object):Void
to be implemented in the child classes
private function worldLogicHandler(o: Object):Void
private function worldHandler(o: Object):Void
function onMouseDown():Void
private function destroyWorld():Void
destroys the World
Close