Here’s some background: I am working on a project in which we have one main Flash file that loads other Flash swfs into an empty movie clip within the main file. The main file instantiates a class I’ve made (stateManager) into a _global variable. This object keeps track of the most recent states of the other individual files so users can navigate between them all and come back to the same status they left it.
Here’s the issue:
In the sub files, I need to access the _global object, which was created in the main file, many times so I would like to use the ‘with’ construct to reduce typing. However, because the ‘with’ statement needs an object to reference, I am unable to publish my files.
I’ve tried adding an if-statement at the top of each file (if (_global.stateManager == undefined){ ), but this doesn’t work either.
I’ve included a portion of my code for you. If someone could please let me know what I’m doing wrong or if there’s something I can do to get around this, PLEASE let me know.
import classes.stateManager;
if (_global.stateManager==null) {
_global.stateManager = new classes.stateManager("./InitFiles/global.xml");
}
with (_global.stateManager) {
... //Use properties and methods of _global.stateManager
...
}
Chris C