Skip to main content
Participating Frequently
March 3, 2008
Answered

Simple AS2 script Output Generates Undefined

  • March 3, 2008
  • 3 replies
  • 430 views
I'm running Flash CS3 Pro with the flash settings specific to ActionScript 2.0 and Flash Player 9 in the Publish settings. If you run this AS 2.0 script in a frame, it generates and Undefined message in the output window. Any thoughts on why? I am following an online training course instruction and can't figure out what would generate the error since I'm following along. Any help appreciated.

Thanks!!

Chris
This topic has been closed for replies.
Correct answer Damon Edwards
you need to be tracing multiply, since that's the function name, ie:

trace(multiply(5, 6));

3 replies

Damon Edwards
Inspiring
March 3, 2008
nProduct isn't being created until the function is run.
escargoAuthor
Participating Frequently
March 3, 2008
Thanks! That works great. When I changed it to this:

trace(multiply(5, 6);
trace(nProduct);

I got the correct answer 30 and once again Undefined. Why can't I trace the value of nProduct? Thanks again for the help.
Damon Edwards
Damon EdwardsCorrect answer
Inspiring
March 3, 2008
you need to be tracing multiply, since that's the function name, ie:

trace(multiply(5, 6));