im trying to make a function that will be used in multiple projects and save , load or display a high score table depending on the parameters entered. my current code is
function test(action:String):void {
if (action == "loadHS") {
trace("loading")
} else if (action == "save") {
trace("saveinghs")
} else if (action == null) {
trace("please provide an operation for high score table")
} else {
trace(" the action" + action + "is not a valid action");
}
}
test(loadHS);
witch creates the following compiler error.
Scene 1, Layer 'Layer 1', Frame 1, Line 14 1120: Access of undefined property loadHS.
what am i doing wrong? thanks :)