I'm not sure, but you may have conflated two steps in the tutorial. You're right that with your definition of sayHello
, you should call
sayHello();
To have the function take an argument, you need to define the function to take an argument:
public function sayHello(user:String):String {
return "Hello, " + user + "!";
}
You would then call:
sayHello('Hamza');
and it would return
"Hello, Hamza!"