FPlayer6 &7 NAN Problem

Hi guys, :kommie:

I’m making a drag and drop test and using dollar bills and coins and I puted this code in every coin and dollar bill :
_root.Value1 = 0.25;//this is a quarter coin
_root.Value1 = 0;

and on a blue box with an instance name of Harry i puted


_root.TotalValue = _root.Value1+_root.Value2+_root.Value3;//keeps going until _root.Value 33

and a dynamic text box with the Variable name TotalValue and here is where my problem comes i tested the swf and and the text box said NAN(not a number)
but then I changed the publishing settings to Flash Player 6 and then the textbox worked
anyone knows how can i make it work in Flash Player 7

Thanks, :slight_smile:

sounds like you have a problem with cases. Flash MX 2004 is case sensitive, and Flash MX is not. For example, Value1 does not equal value1. And if you accidentally did this on one of them, it would be undefined, and you would not be able to add it because “undefined” is in fact “NaN”. Hope this helps :slight_smile:

By the way, there are better ways to do this than writing out all of this on every movieclip, and writing out the entire equation to add them all. If you’re interested in making it more efficient, look up loops and arrays =)

Thanks Yeldarb but i don’t think is a case problem because when I drag all the money to the blue box it starts working. weird uh :slight_smile:
but the thing is that i want it to work from the start
and i’ll use your advise to look up for loops and arrays. :wink:

I found the problem! I’m glad i did but now i feel stupid
one variable was missing :stuck_out_tongue:
Its hard to find a missing variable over 66 of them I have to learn how to use those arrays and loops thank you for your help :slight_smile: