/ Published in: ActionScript 3

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// Calculating the mouse position within an object to percentages in relation to its height // var scale = 100 ( result range from 0 - 100 ) // var scale = 10 ( result range from 0 - 10 ) // var scale = 1 ( result range from 0 - 1 ) trace( ( mySprite.mouseY / mySprite.height) * scale );
Comments
