New learner needing some help with class constructor

i was testing with class constructor using code from the manual. from my understanding, the code (in screenshot) should give a output of “3” but the output is empty. i’m probably not seeing something, any help is appreciated

1 Like

your say() method is what outputs but you’re not calling it, you’re only calling new(). notice that it even says “0 references” above public function say() {
try

new Point(3).say();
2 Likes

thanks for saving this noob :smile:

1 Like

You can also assign it to a variable:

var point = new Point(3);
point.say();

or without the say function you can do:

var point = new Point(3);
trace(point.x);
1 Like