Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

rounding to nearest integer...

Status
Not open for further replies.

bugg

Programmer
Jun 20, 2001
62
US
I've got a piece of ActionScrip that onClipEvent (mouseMove) sets the frame# of a mc to a variable equal to the _ymouse within that mc. It sticks and is rather tempramental, the only thing I can think of is the fact that _ymouse is read to an accuracy which includes decimals, and obviously there are no frames which will satisfy this. I am having a total brainfart as far as how to write an expression which will round the _ymouse to an integer, any ideas?

thanks

bugg
 

Start from this script...

var x = 50.9856785699;
var y = int(x);
trace (y);

...And work from there!
 
thanks for the quick response, I'll give it a go...

bugg
 
slam dunk

thankyou, the "int" was the key I was searchin for...

bugg
 
Doubt it will solve your sticking problem though!

;-)
 
It fixed all of the probs. I think it was sticking because it couldn't go to frame 4.5,4.6, etc...

thanks again

bugg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top