Class| Function Tunnel

Hello everyone,

I have a simple quesiton about class, method and functions inside a method and class properties…

here’s my problem…

I created a new class form my custom component… But upon developing it i found out that you can not access a property inside the function which is also inside a method…

example


 
class myClass{
 
private var myProperty:Number = 1; //default is 1
 
//constructor
public function myClass(){
}
//Method 
public function setMyP(pMyP:Number){
this.myProperty = pMyP;
}
 
//The Problem that exist
 
 
public function getMyP(){
trace(this.myProperty); // Output 1
function SomeFunction(){
trace(this.myProperty); // undefined <------------
}
 
SomeFunction();
}
}

What I want to do is to access the property inside the method… I also have a work-around still i cannot point a certain variable to a property of my class inside the method’s function…