This class does all the work of saving/reading sections data in/from db. In the repository : /trunk/core/DynDataManager.as
1
Alexandre Hoyau
| org. | This class does all the work of saving/reading sections data in/from db. |
| Variables | |
| silex_ptr | Reference to silex main Api object (org.silex.core.Api). |
| Functions | |
| DynDataManager | Constructor. |
| registerVariable | Register a variable in SILEX: - load the corresponding value from dom to the variable - mark the variable so that its value will be saved into the dom when core.silex.save will be called |
| unRegisterVariable | Removes a variable from the registeredVariables array. |
| unRegisterClipOutOfContext | Stop keeping track of that variable so that its value will be updated in the dom during the save process. |
| registerClipOutOfContext | Keep track of the variable so that it will still be saved in db, even if the container does not exist anymore (because it is out of context). |
| duplicateDom | Duplicate a dom object and its child objects. |
| buildLayoutDom | Use a layout’s registeredVariables array to build it’s dom object. |
| addValueToDom | Update the a variable in the dom object. |
function registerVariable( target_mc: MovieClip, variableName: String, type: String ):Boolean
Register a variable in SILEX: - load the corresponding value from dom to the variable - mark the variable so that its value will be saved into the dom when core.silex.save will be called
| target_mc | the object which contains the variable to be registered |
| variableName | the name of the variable |
| type | [optional] - the type of the variable (as returned by typeof ActionScript function) |
true if a value was found in the XML and false otherwise
function unRegisterClipOutOfContext( target_mc: MovieClip, variableName: String )
Stop keeping track of that variable so that its value will be updated in the dom during the save process. There are still some BUGs in this process.
| target_mc | the object which contains the variable to be registered |
| variableName | the name of the variable |
function registerClipOutOfContext( target_mc: MovieClip, variableName: String ):Boolean
Keep track of the variable so that it will still be saved in db, even if the container does not exist anymore (because it is out of context). Retrieve the layout root and the path of the target. Retrieve the corresponding dom node in layout’s dom object. Add the target’s dom to the domOutOfContext of the layout. There are still some BUGs in this process.
| target_mc | the object which contains the variable to be registered |
| variableName | the name of the variable |
function buildLayoutDom( layout: org.silex.core.Layout )
Use a layout’s registeredVariables array to build it’s dom object. The registeredVariables elements have these attributes: variableName_str,containerPath_array,type_str, target_str (which is the container_mc.target property).
| layout | the layout |
Reference to silex main Api object (org.silex.core.Api).
var silex_ptr: org.silex.core.Api
Constructor.
function DynDataManager ( api: org.silex.core.Api )
Register a variable in SILEX: - load the corresponding value from dom to the variable - mark the variable so that its value will be saved into the dom when core.silex.save will be called
function registerVariable( target_mc: MovieClip, variableName: String, type: String ):Boolean
Removes a variable from the registeredVariables array.
function unRegisterVariable( target_mc: MovieClip, variableName: String ):Boolean
Stop keeping track of that variable so that its value will be updated in the dom during the save process.
function unRegisterClipOutOfContext( target_mc: MovieClip, variableName: String )
Keep track of the variable so that it will still be saved in db, even if the container does not exist anymore (because it is out of context).
function registerClipOutOfContext( target_mc: MovieClip, variableName: String ):Boolean
Duplicate a dom object and its child objects.
function duplicateDom( _obj: Object ):Object
Use a layout’s registeredVariables array to build it’s dom object.
function buildLayoutDom( layout: org.silex.core.Layout )
Update the a variable in the dom object.
private function addValueToDom( dom: Object, path_array: Array, variableName: String, variableValue )