# \[OOP\] Help with this simple code

**URL:** <https://forum.kirupa.com/t/oop-help-with-this-simple-code/186519>\
**Category:** flash\
**Created:** [April 21, 2006, 10:40pm UTC](https://forum.kirupa.com/t/oop-help-with-this-simple-code/186519 "2006-04-21T22:40:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Artofacks1](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Artofacks1](https://forum.kirupa.com/u/Artofacks1)\
**Post date:** [April 21, 2006, 10:40pm UTC](https://forum.kirupa.com/t/oop-help-with-this-simple-code/186519/1 "2006-04-21T22:40:00Z")

</div>

Hey guys. So I am trying to get my head around OOP these days. You know trying to keep up with the times. So i wrote this simple class

class buttonUI {  
[COLOR=#000087]var[/COLOR] btnLabel:[COLOR=#000087]String[/COLOR];  
[COLOR=#000087]var[/COLOR] page:[COLOR=#000087]String[/COLOR];  
[COLOR=#000087]var[/COLOR] [COLOR=#000087]target[/COLOR]:[COLOR=#000087]MovieClip[/COLOR]

```
    static [COLOR=#000087]function[/COLOR] loadPage (btnLabel, page, [COLOR=#000087]target[/COLOR]):Void {
            btnLabel.[COLOR=#000087]text[/COLOR] = btnLabel;
            [COLOR=#000087]target[/COLOR].[COLOR=#000087]loadMovie[/COLOR](page);
    }

```

}

and in my flash movie I have a dynamic text field with an instance name  
of btnLabel and an empty movie clip with an instance name of targetMC.  
so in my flash file I use my class like this.

buttonUI.loadPage("[COLOR=blue]Name[/COLOR]", “[COLOR=blue]load.swf[/COLOR]”, targetMC);

the load.swf works and the targetMC works but the label wont change to Name.

here is the example. Al you will see is a black square cus that what it  
loads but you will also notice that my text field doesnt change to

“Name”

[http://www.creativescientist.com/OOP/test.html](http://www.creativescientist.com/OOP/test.html)

Thanks for your help.

Rob
