I’m loading an MC and then attempting to activate a function onLoadComplete in order to hide the MC. The function is actually reused several times through out the “app” I’m building. I know the onLoadComplete works because I tested it, but the function isn’t being activated
var msgMC:MovieClipLoader = new MovieClipLoader();
var msgMCL:Object = new Object();
msgMC.loadClip("message.swf"+"?uniqueID="+getTimer(), msg);
msgMC.addListener(msgMCL);
var root:MovieClip = this;
msgMCL.onLoadComplete = function() {
msg.messageBox._x = Stage.width/2;
msg.messageBox._y = Stage.height/2;
root.msgHide();
};
function msgReveal(msgString:String, btn1B:Boolean, btn2B:Boolean, btn3B:Boolean, command1:String, command2:String, command3:String) {
msg.messageBox._visible = true;
msg.messageBox.textF.htmlText = msgString;
msg.messageBox.btn1._visible = false;
msg.messageBox.btn2._visible = false;
msg.messageBox.btn3._visible = false;
if (btn1B) {
msg.messageBox.btn1._visible = true;
}
if (btn2B) {
msg.messageBox.btn2._visible = true;
}
if (btn3B) {
msg.messageBox.btn3._visible = true;
}
msg.messageBox.btn1.onRelease = function() {
this._parent._parent._parent.msg.messageBox.textF.text = command1;
this._parent._parent._parent.callFunction(command1);
//root[command1]();
};
msg.messageBox.btn2.onRelease = function() {
this._parent._parent._parent.msg.messageBox.textF.text = command2;
this._parent._parent._parent.callFunction(command2);
//root[command2]();
};
msg.messageBox.btn3.onRelease = function() {
this._parent._parent._parent.msg.messageBox.textF.text = command3;
this._parent._parent._parent.callFunction(command3);
//root[command3]();
};
}
function callFunction(callUpon:String):Void {
//root[callUpon]();
eval(callUpon)();
msg.messageBox.textF.text = callUpon;
}
function msgHide() {
msg.messageBox._visible = false;
msg.messageBox.textF.htmlText = "";
msg.messageBox.btn1._visible = false;
msg.messageBox.btn2._visible = false;
msg.messageBox.btn3._visible = false;
}