-
hello
I have a film where I load some variables from a external txt:
idade=28&fcrepouso=60
I need to re-use it in the follow variables inside a MC
fcpessoal = 220-idade-fcrepouso;
b1_50 = Math.floor ((fcpessoal*50/100)+fcrepouso);
b1_55 = Math.floor ((fcpessoal*55/100)+fcrepouso);
but I can't set the "idade" and "fcrepouso" inside the expressions as numbers.
-
I assume these values are coming up as strings if they are not coming up as numbers. In that case, you could try:
fcpessoal = 220-Number(idade)- Number(fcrepouso);
b1_50 = Math.floor ((fcpessoal*50/100)+ Number(fcrepouso));
b1_55 = Math.floor ((fcpessoal*55/100)+ Number(fcrepouso));
-
I already have tried
I already have tried it, but the variable was indefinable.
Are there other problems that could affect it?
-
Are you using the code you gave:
fcpessoal = 220-idade-fcrepouso;
b1_50 = Math.floor ((fcpessoal*50/100)+fcrepouso);
b1_55 = Math.floor ((fcpessoal*55/100)+fcrepouso);
in the same frame where you are loading your text file from? If so, the variables may not have loaded when you perform these actions. I've found that you have to give a few frames between loading the text file and using the variables from that file. Either that, or use the onClipEvent(data).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|