as question!
- Started
- Last post
- 70 Responses
- ********
i need to get a variable from a rotation (with inertia) script.
this is the script:
-------import mx.transitions.Tween ;
import mx.transitions.easing.*;
function rotater(who) {
var rotate:Tween = new Tween(who, "_rotation", Strong.easeOut, 0, subsidie, 7, true);
rotater.onMotionFinished = function() {
// do somthing
};
}
rotater(large_arrow);---
the word "subsidie" is a final variable, the point where the arrow will stop rotating.
i want the variable of every current rotation of the arrow dynamically while it rotates..
any ideas?
(i got the above script from some kind helper here, no idea what is what, heh)
- UndoUndo0
get you just the property of the MC?
_root.who._rotation ??
assuming its on the root
- ********0
ok, i will try that, thx!
- ********0
that works nicely, thanks!
just another question, how do i add punctuation to a number?
i multiplied it to a number in the millions, in Euro annotation, which is points, for example:
12300468
should become
12.300.468
- joyride0
what do you mean every Current rotation? so if you start at 0 and end at subsidie = 360, you want the var of each 1, 2, 3, 4, etc.?
- ********0
yup. but that part is already solved.
take a look at my prev. post for the next question. :)
- ********0
i also want to add to the question that i want the variable from the roation should not contain decimals. how do i cut those off??
- UndoUndo0
if you want the two dots then you need to convert yr number to a tring and place the dots in the string.
if you want to show it as millions just divide the original number by a million.
- joyride0
for rounding to nearest int use Math.round
- ********0
if you want the two dots then you need to convert yr number to a tring and place the dots in the string.
if you want to show it as millions just divide the original number by a million.
UndoUndo
(Apr 27 06, 10:51)how do i create a string then?
i am a total AS n00b!
- ********0
thx joyride, i will add that.
- ********0
that did not work..
where do i put Math.round in this?
count_s = (_root.large_arrow._rotation *100000);
- UndoUndo0
you got mail :)
- ********0
ah. already solved math.round bit...
now i need to know how to make the string..
- ********0
ah. thx Undo!
and thx Joyride.
you guys rock!
- ********0
you got mail back!
- mpfree0
ask dinky
- ********0
brendan, did you get my mail?
i've been trying to use this as well, but it gets me 6 errors on testing the swf..
- UndoUndo0
no, no mail yet,
did my code give you errors?
- UndoUndo0
you have more mail!
- ********0
yeah i got errors..
my reply:
--thx.
i now called my dynamic text field var mystring, is this ok?
i get errors:count_s = Math.round(_root.large_arrow._ro... *100000);
myNum = count_s;
millions = count_s/1000000;
thous = (count_s-millions)/10000;
hundreds = count_s-(millions+ thous);mystring = millions+’.’+ thous+’.’+hundreds;
cheers,
Janne.