# onLoadComplete issue

**URL:** <https://forum.kirupa.com/t/onloadcomplete-issue/212322>\
**Category:** flash\
**Created:** [January 10, 2007, 5:19am UTC](https://forum.kirupa.com/t/onloadcomplete-issue/212322 "2007-01-10T05:19:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbailey](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jbailey/32/2380_2.png) [@jbailey](https://forum.kirupa.com/u/jbailey)\
**Post date:** [January 10, 2007, 5:19am UTC](https://forum.kirupa.com/t/onloadcomplete-issue/212322/1 "2007-01-10T05:19:31Z")

</div>

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

```auto

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;
}

```
