PDA

View Full Version : Lil confused with classes and return functions



kingscooty
November 3rd, 2007, 02:32 PM
Hey all can someone tell me why i recieve this in a trace



function Function() {}


when i use this return function inside a custom class called Node:


public function getID():int
{
return id;
} //get node ID


I thought :


trace(node.getID);


would work, but it's giving me a wierd output :/

Felixz
November 3rd, 2007, 04:01 PM
trace(node.getID());
or change ur function

public function get ID():int
{
return id;
} //get node ID and trace(node.ID)

kingscooty
November 3rd, 2007, 04:17 PM
Ah, silly me! :) Thanks, felixz!
You're way's much better! :D