Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Get Key Code
Check valid date
Set Frame Rate for Flash Member
Install-us Pro
Retrun Properties on a Sprite
Print Current Marker
Happy Hour Fonts
Find Last Label
Wondershare Flash SlideShow Builder
Effector Set II for Alphamania
 

 

 

Behavior Ceiling and floor math functions

Added on 1/14/2006

 

Compatibilities:
behavior D7 D8 D8_5 D9 Mac PC

This item has not yet been rated

Author: Chunick (website)

These two are math functions. They should be placed in a movie script. ceil() - The ceiling of a number is the closest integer that is greater than or equal to the number. floor() - The floor is the closest integer that is less than or equal to the specified number or expression. These have been tested and work for both positive and negative values.

on ceil(x)
  return bitOr(x,0) + ((x>0) + (x <> integer(x)) = 2)
end

on floor(x)
  return bitOr(x,0) - ((x<0) + (x <> integer(x)) = 2)
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail