[FMX] variables from a TxT Files

This is really bugging me! Sometimes it works sometimes it doesn’t!
The external TxT file is loaded into _root!
In the text file I have these variables:
&ro1=122
&ro2=112
They work fine but when I want to divide ro1 by ro2 it returns NaN! wtf?
It was workin’ a minute ago! I’ve been messin’ if it for days now!
helllp!

What if you do:


myNumber = Number(ro1)/Number(ro2);

?? 'cause I guess that ro1 and ro2 are string variables.

nope… I even tried int()… still now workin’

change your txt file to:
&ro1=122&ro2=112

instead of:
&ro1=122
&ro2=112

don’t ask… :stuck_out_tongue:

wait… i think i got it. :stuck_out_tongue:

if i’m correct, technically ro1 is equal to "122
". =)

Well, I guess that makes sense. Cheers :slight_smile:

yup… =)

and actually, i think it’s "122
" since flash takes both carriage return (\r) and new line (
) when importing from a txt file. :stuck_out_tongue:

ehhhhhh! wtf?
I tried it that way then I thought" It works… to make it look better I’ll try putting them in seperate lines" Then it worked again so I thought it doesn’t make a difference if they are

ro1
ro2

or

ro1ro2

now I try it doesn’t work! I change it back again it works…
heh thx! Now I can go on creating my little poll!

:stuck_out_tongue:

no problem, syko. :beam:

yea this happens to me too…with the external text loading, sometimes it shows sometimes it doesnt