Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 actionscript help

views
     
TSvalho
post May 9 2006, 03:33 PM, updated 20y ago

Look at all my stars!!
*******
Senior Member
4,967 posts

Joined: Jan 2003
From: somewhere, far far away


ok here what i wanna do, i have meter like thing in flash that display the value it reads from an external text file. the same value read is use to move the meter hand to an approximate value in the meter

below is the script

var maxvalue:Number = 700;
loadText = new LoadVars();
loadText.load("Text.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
visitors.html = true;
visitors.htmlText = this.myVisitors;
var actualValue:Number = this.myVisitors;
vhand_mc._rotation = (275/maxvalue)*actualValue;
trace (actualValue);

}
}

the problem is the line mark red, now if i were to replace actualValue with a number, the hand does move, which mean the calculation is correct. but if actualValue is use i get 0 in vhand_mc._rotation. but the trace shows that there is value in actualValue

so i am stump on why it doesnt work even though there is number in actualValue. any help would be much appreciated
thanks
TSvalho
post May 9 2006, 03:49 PM

Look at all my stars!!
*******
Senior Member
4,967 posts

Joined: Jan 2003
From: somewhere, far far away


dang stupid of me, problem solve hahaha biggrin.gif
etsuko
post May 9 2006, 08:05 PM

Spaced out person
Group Icon
Elite
4,210 posts

Joined: Jan 2003
From: Malaysia


share the solution. wink.gif
TSvalho
post May 19 2006, 12:59 PM

Look at all my stars!!
*******
Senior Member
4,967 posts

Joined: Jan 2003
From: somewhere, far far away


simple solution actually, the text file should be coded like this:

&myEvents=69&
&myVisitors=263&
&myOrders=3&

i forgot to at the ampersand to the start and end of each variable

 

Change to:
| Lo-Fi Version
0.0127sec    0.70    5 queries    GZIP Disabled
Time is now: 26th November 2025 - 12:50 PM