0
votes

If I wanted to create a function called printMe, what's the proper syntax so that it prints what the function information prints?

var named:String="me";
var age:int=100;



function information():void{
    trace(named, age);
}

information();

I tried a few things like

printMe=information;
printMe();

Here are the errors I'm getting

Scene 1, Layer 'Layer 1', Frame 1, Line 8 1120: Access of undefined property printMe.

Scene 1, Layer 'Layer 1', Frame 1, Line 9 1180: Call to a possibly undefined method printMe.

1
It's helpful if you post the errors you get. - Jonatan Hedborg

1 Answers

2
votes

Try

var printMe:Function = information;
printMe();