something is wrong with my encapsulation, but i dont know what it is:
I got a document class named Main bound to the stage:
package {
import flash.display.MovieClip;
public class Main extends MovieClip
{
var chapter1:Chapter1;
public function Main() {
// constructor code
chapter1 = new Chapter1;
addChild(chapter1);
}
}
}
a Chapter1 class bound to a MovieClip:
package {
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.TimerEvent;
import flash.utils.Timer;
public class Chapter1 extends MovieClip {
public var numberOfFrames:uint;
public function Chapter1()
{
numberOfFrames = 3;
//constructor
trace("Chapter 1 constructed");
Transition.moveFromTo();
}
public static function get getNumberOfFrames():uint
{
return numberOfFrames;
}
}
}
and a class called Transition that i like to use as a simple utility:
package {
public class Transition {
public var gotNumber:uint;
public function Transition() {
trace(Chapter1.getNumberOfFrames);
}
static public function moveFromTo()
{
/* in the end id like to use this as a utility working with
NumberOfFrames from a parent Chapter instance.*/
}
}
}
I get an error message telling me: "1120: Access of undefined property numberOfFrames." so the getter function itself seems not to be allowed to use numberOfFrames. But I dont see why, for all examples I found (although working just with two classes and no binding) make the getter return a var just like that. Do I miss something there?