# Class problem

**URL:** https://forum.kirupa.com/t/class-problem/219856
**Category:** flash
**Created:** [March 20, 2007, 6:30pm UTC](https://forum.kirupa.com/t/class-problem/219856 "2007-03-20T18:30:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pedro\_paulo](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/pedro_paulo/32/2017_2.png) [@pedro\_paulo](https://forum.kirupa.com/u/pedro_paulo)
#### Post date: [March 20, 2007, 6:30pm UTC](https://forum.kirupa.com/t/class-problem/219856/1 "2007-03-20T18:30:42Z")

</div>

Here it is:

I have this Class:

```auto

class ClipClass {
    
    private var nome:String;
    private var foto:String;
    private var display:MovieClip;
    
    // constructor:
    function ClipClass() {
    }
    
    // setters:
    public function setDataProvider(n:String, f:String, d:MovieClip):Void {
        this.nome = n;
        this.foto = f;
        this.display = d;
    }
    
    // getters:
    public function getNome():String {
        return this.nome;
    }
    public function getFoto():String {
        return this.foto;
    }
    
    
    // construção visual:
    public function exibirDados():Void {
        this.exibirNome();
        this.puxarImagem();
    }
    private function puxarImagem():Void {
        this.display.load_mc.loadMovie(this.foto);
    }
    private function exibirNome():Void {
        this.display.nome_txt.text = this.nome;
    }
}

```

Well… Inside the class I have a MovieClip object. This movie clip is a clip wich has buttons, text box, fotos etc. like a “shopping iten” in a e-commerce.

So I want to get the var “nome” of my object or its “foto” string (the url by its photo) and manipulate it.

But when I try to do something like:

```auto

//obj.
this.display.button_btn.onRelease = function():Void {
trace(this.nome);
}

```

it doesn´t work! Because the keyword “this” points to “button\_btn” wich is inside the “display” movieClip, and not to the ClipClass object.

So: What I do to work with clips in flash stage and point it to a Class?

Another exemple: If I have a Class with a “private var url:String” and I set the var like “[http://www.kirupa.com](http://www.kirupa.com)”. Then I set a movieClip to its class. Inside de movieClip there is a button. When the mouse release this button, I want to access de “this.url” of the obj Class. How can I do this?

Can anyone help me? I think it is simple, but I can´t see it!

Sorry for my poor English.

pp
