# WHY?! - 1120: Access of undefined property \*HEAD-DESK\*

**URL:** <https://forum.kirupa.com/t/why-1120-access-of-undefined-property-head-desk/258135>\
**Category:** flash\
**Created:** [April 21, 2008, 10:45am UTC](https://forum.kirupa.com/t/why-1120-access-of-undefined-property-head-desk/258135 "2008-04-21T10:45:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nikomax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nikomax/32/3664_2.png) [@nikomax](https://forum.kirupa.com/u/nikomax)\
**Post date:** [April 21, 2008, 10:45am UTC](https://forum.kirupa.com/t/why-1120-access-of-undefined-property-head-desk/258135/1 "2008-04-21T10:45:13Z")

</div>

I can feel me posting a lot in my learning journey if AS3!  
Sorry if the answer is really obvious but i cant figure it out.

I’m still working on a pre-loader, and I’m having loads of “1120: Access of undefined property \_loadBar.” errors. I really don’t know why I’m getting these, so I hope someone can explain what I am doing wrong.

This is my code :

```php

package com.utils{

    import flash.display.*;
    import flash.events.*;
    import flash.net.URLRequest;
    import com.utils.Logo;
    import com.utils._loaderBar;

    public class Preloader extends MovieClip {

        public function Preloader() {

            var _myLoader:Loader = new Loader();
            var _myRequest:URLRequest = new URLRequest("lesson.swf");
            _myLoader.contentLoaderInfo.addEventListener(Event.OPEN, showLoader);
            _myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
            _myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, showLesson);
            _myLoader.load(_myRequest);

        }
        function showLoader(evt:Event) {
            var _loaderLogo:Logo = new Logo();
            _loaderLogo.x = (stage.stageWidth / 2) ;
            _loaderLogo.y = (stage.stageHeight / 2)- 30;
            addChild(_loaderLogo);

            var _loadBar:_loaderBar = new _loaderBar();
            _loadBar.x = (stage.stageWidth / 2) - 150;
            _loadBar.y = (stage.stageHeight /2);
            _loadBar.width = 300;
            addChild(_loadBar);

        }
        
        function showProgress(evt:ProgressEvent) {
            var _percent = Math.round((evt.bytesLoaded / evt.bytesTotal) * 100);
            var _percentWidth = _percent * 3;
            //_loadBar.width += _percentWidth;
            trace(_percent);

        }
        function showLesson(evt:Event) {
            //removeChild(_loaderLogo);
            //removeChild(_loadBar);
            //addChild(_myloader);
        }
    }
}

```

The commented lines are the problem lines each one causes a 1120 error.  
What am I doing wrong?

Thanks
