# Button Class

**URL:** <https://forum.kirupa.com/t/button-class/247608>\
**Category:** flash\
**Created:** [December 27, 2007, 4:36am UTC](https://forum.kirupa.com/t/button-class/247608 "2007-12-27T04:36:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snozbunny](https://avatars.discourse-cdn.com/v4/letter/s/34f0e0/32.png) [@snozbunny](https://forum.kirupa.com/u/snozbunny)\
**Post date:** [December 27, 2007, 4:36am UTC](https://forum.kirupa.com/t/button-class/247608/1 "2007-12-27T04:36:00Z")

</div>

Hi everybody. I’m working on making my buttons more… OOPie? It’s killing me. I used a target to load the movie clip I’d like to dump images into so I can make buttons the way I know they’re supposed to be made but as hard as I try I can’t add things to that movie clip from within that same file.

I need a life line. 🔗

```php

package components
{
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.display.Bitmap;
    import flash.display.MovieClip;

    public class ImageLoader extends Loader
    {
        private var target:Object;
        private var playup:String;
        private var playover:String;
        private var objx:int;
        private var objy:int;
        private var _playbtn=new MovieClip;

        public function ImageLoader(target:*, playup:String, playover:String, objx:int, objy:int) {            
            this.target = target;
            this.playup = playup;
            this.playover = playover;
            this.x = objx;
            this.y = objy;
            this.target.addChild(_playbtn);
            init(this.playup);
        }
        private function init(loadimg):void
        {
            this.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
            var request:URLRequest=new URLRequest(loadimg);
            this.load(request);
        }
        private function completeHandler(event:Event):void{
            var _image:Bitmap=Bitmap(this.content);
            #### "this.target + _playbtn" .addChild(_image); ????
        }
    }
}

```
