The API for jsFloater consists of 3 publicly available methods: floatHor, floatVer, and – you guessed it – floatHorVer. The first of these will float an object horizontally; the second will float an object vertically, and the third will float an object both horizontally and vertically.
Because web browsers are anchored to the top left of the window, you may want to use a combination of these three methods to achieve your desired results. jsFloater allows you to define a minimum stage size, so that your elements won’t crash together if the user squashes the page size down by dragging the browser window’s bottom right corner to the middle of the screen, for example. This minimum stage size is passed to the class constructor on instantiation.
There is a visual guide to the API available both in the downloadable zip file and also for browsing on this site. You can mouse over the various objects in the visual API guide to reveal what method has been used to float them, which align mode they are employing, and what their current pixel x – y coordinates are.
jsFloater allows you several types of floating, in addition to the ability to “pad” or “stick” your floats, as will be expained below. The types of floating are proportional (based off of the difference between the minimum stage size and current stage size) or Strict, meaning based only on the current stage size.
The methods:
constructor
public function jsFloat(sIW:uint, sIH:uint):void
returns: nothing
parameters:
sIW:uint – stage Initial Width. This is also the stage minimum width you define based on your designs.
sIH:uint – stage Initial Height. This is also the stage miniumum height you define based on your designs.
Both of these parameters will be used to calculate values in the proportional float modes and will also set the values for browser window resizes that are smaller than your minimum.
floatHor
public function floatHor(obj:Object, align:String, yStick:int, xPad:int, sW:Number, sH:Number):void
returns: nothing.
parameters:
obj:Object – the object passed to the method. Can be sprite or movieclip as well.
align:String – the alignment mode. Options are:
“left” – aligns left, proportionate to minimum stage size
“leftStrict” – aligns left, based strictly on current window size
“right” – aligns right, proportionate to minimum stage size
“rightStrict” – aligns right, based strictly on current window size
“center” – aligns center (horizontally) in the window
yStick:int – allows you to force the floated object to “stick” to a particular y value. A horizontal float with a yStick of 0 will align vertically with the top of the browser window. Negative values can be used, as well as your own math (provided it results in an integer).
xPad:int – allows you to pad your float values. For example, if you are using an image that always needs to be 20 pixels from the right edge of the window, you would use the “rightStrict” mode and and xPad of 20. Positive values for pads will move objects toward the center of the window (horiztontally, in this case), except when using the “center” mode, which moves positive values toward the right. Negative values can be used, as well as your own math (provided it results in an integer).
sW:Number – current stage width.
sH:Number – current stage height.
floatVer
public function floatVer(obj:Object, align:String, xStick:int, yPad:int, sW:Number, sH:Number):void
returns: nothing.
parameters:
obj:Object – the object passed to the method. Can be sprite or movieclip as well.
align:String – the alignment mode. Options are:
“top” – aligns top, proportionate to minimum stage size
“topStrict” – aligns top, based strictly on current window size
“bottom” – aligns bottom, proportionate to minimum stage size
“bottomStrict” – aligns bottom, based strictly on current window size
“middle” – aligns middle (vertically) in the window
xStick:int – allows you to force the floated object to “stick” to a particular x value. A vertical float with a xStick of 0 will align with the left side of the browser window. Negative values can be used, as well as your own math (provided it results in an integer).
yPad:int – allows you to pad your float values. For example, if you are using an image that always needs to be 20 pixels from the bottom of the window, you would use the “bottomStrict” mode and and yPad of 20. Positive values for pads will move objects toward the middle of the window (vertically, in this case), except when using the “middle” mode, which moves positive values to the bottom. Negative values can be used, as well as your own math (provided it results in an integer).
sW:Number – current stage width.
sH:Number – current stage height.
floatHorVer
public function floatHorVer(obj:Object, stickMode:String, xPad:int, yPad:int, sW:Number, sH:Number):void
returns: nothing.
parameters:
obj:Object – the object passed to the method. Can be sprite or movieclip as well.
stickMode:String – analogous to the align parameter in the methods above. Options are:
“center” – aligns to the center (horizontally) and middle (vertically) of the window
“right” – aligns vertically to the middle and horizontally to the right, proportionate to the minimum stage size
“rightStrict” – aligns vertically to the middle and horizontally to the right, based strictly on current window size
“bottom” – aligns horizontally to the center and vertically to the bottom, proportionate to the minimum stage size
“bottomStrict” – aligns horizontally to the center and vertically to the bottom, based strictly on current window size
“bottomright” – aligns to the bottom right, both proportionate to the minimum stage size
“bottomrightStrict” – aligns to the bottom right, both based strictly on current window size
“bottomleft” – aligns to the bottom left, proportionate to the minimum stage size
“left” – aligns vertically to the middle and horizontally to the left, proportionate to the minimum stage size
“topleft” – aligns to the top left, proportionate to the minimum stage size
“top” – aligns horizontally to the center and vertically to the top, proportionate to the minimum stage size
“topright” – aligns to the top right, proportionate to the minimum stage size
Note: because the browser window is anchored to the top left, certain stickMode parameters for this method would be redundant. For example, there is no topleftStrict, as that effect can be achieved with the floatHor method, taking an align mode of “leftStrict”.
xPad:int – allows you to pad your float values horizontally.
yPad:int – allows you to pad your float values vertically.
xPad and yPad are as described for the methods above. Either can accept negative values and math that results in an integer, except that both will push objects toward the center (horiztonally) and middle (vertically) of the window when given positive values, unless the “center” mode is used, which will push positive values down and to the right. For example, if you wanted two objects to float at the center of the screen, with one always offset from the other 20 pixels down and to the right, you would float the first using the floatHorVer method with xPad and yPad of 0 and 0, and float the second using the same method, with an xPad of 20 and a yPad of 20.
sW:Number – current stage width.
sH:Number – current stage height.
For more, see How To Use jsFloater.


Very nice Blog, I will tell my friends about it.
Thanks