# Problem with a function within global function

**URL:** <https://forum.kirupa.com/t/problem-with-a-function-within-global-function/238977>\
**Category:** flash\
**Created:** [September 17, 2007, 5:40pm UTC](https://forum.kirupa.com/t/problem-with-a-function-within-global-function/238977 "2007-09-17T17:40:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreasCS](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@AndreasCS](https://forum.kirupa.com/u/AndreasCS)\
**Post date:** [September 17, 2007, 5:40pm UTC](https://forum.kirupa.com/t/problem-with-a-function-within-global-function/238977/1 "2007-09-17T17:40:30Z")

</div>

Hi!

I have a global function for loading php data:

```auto
_global.MovieClip.prototype.loadPHP = function(Url, Data) {
    var php_result:LoadVars = new LoadVars();
    php_result.onLoad = function(success:Boolean) {
        if (success) {
            // Connection OK
            if (!php_result.error) {
                this.Title.text = "Some info";
                this.gotoAndStop(2);
            } else {
                this.Title.text = "Some info";
                this.gotoAndStop(3);
            }
        } else {
            // Connection Error
        }
    };
    var php_send:LoadVars = new LoadVars();
    php_send.sendAndLoad(Url,php_result,"POST");
};

```

It works as it should, except I can’t access the Title.text or gotoAndStop from within the onLoad function. I’ve tried without the “this.” aswell. It works fine outside the onLoad function.

Any ideas?
