0

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. Commented Oct 6, 2011 at 15:58

1 Answer 1

2

Try

var printMe:Function = information;
printMe();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.