Here it is:
I have this Class:
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:
//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”. 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