P
P
pxsh2014-02-16 21:18:08
ActionScript
pxsh, 2014-02-16 21:18:08

How to fix as3 number?

The object changes its height along the y axis. How to fix the minimum number (the highest point of the object's flight)?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GRIM2D, 2014-02-19
@GRIM2D

var obj:Object; //Tvoy obyekt
var minY:Number = 10; //Minimalnoye znacheniye po Y osi
if (obj.y < minY)
{
  obj.y = minY;
}

A
Alexander Flasher, 2014-03-14
@alexvoz

var obj:DisplayObject; 
var minY:Number = 10; // Минимальное значение
var currentY:Number; //Значение, которое будет меняться
...
obj.y = Math.max(minY, currentY)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question