Packagegs.util
Classpublic final class SetterUtils

The SetterUtils class contains utility methods that decrease amount of code you have to write for setting the same properties on multiple objects.

All methods can be used in two ways.


Example
Two uses for each method:
 
  var mc1,mc2,mc3:MovieClip;
  var mcref:Array=[mc1,mc2,mc3];
  
  SetterUtils.visible(true,mc1,mc2,mc3); //rest style.
  
  //array style - this is nice when you want to group
  //display objects to you can quickly toggle a property.
  SetterUtils.visible(false,mcref);
  



Public Methods
 MethodDefined by
  
alpha(value:Number, ... objs):void
[static] Set the alpha property on all objects provided.
SetterUtils
  
autoSize(value:String, ... fields):void
[static] Set the autoSize property on multiple textfields.
SetterUtils
  
buttonMode(value:Boolean, ... objs):void
[static] Set the buttonMode property on all objects provided.
SetterUtils
  
buttonModeAndHand(value:Boolean, ... objs):void
[static] Set the buttonMode, and useHandCursor property on all obejcts provided.
SetterUtils
  
cacheAsBitmap(value:Boolean, ... objs):void
[static] Set the cacheAsBitmap property on all objects provided.
SetterUtils
  
flipAlpha(val1:Number, val2:Number, ... objs):void
[static] Flip the alpha property on all objects provide, if the alpha on an object is equal to either val1 or val2, the values are flipped.
SetterUtils
  
flipBoolean(prop:String, ... objs):void
[static] Toggles the value of a boolean property to the opposite value for all objects provided.
SetterUtils
  
flipProp(prop:String, ... value1, value2:*, objs:*):void
[static] Toggle any property on any object - if the current value of the property is value1, it will be set to value2, as well as the reverse.
SetterUtils
  
height(value:Number, ... objs):void
[static] Set the height property on multiple objects.
SetterUtils
  
mouseChildren(value:Boolean, ... objs):void
[static] Set the mouseChildren property on all objects provided.
SetterUtils
  
mouseEnabled(value:Boolean, ... objs):void
[static] Set the mouseEnabled property on all objects provided.
SetterUtils
  
prop(prop:String, ... value, objs:*):void
[static] Set any property to the specified value, on all objects.
SetterUtils
  
setDropShadow(ds:DropShadowFilter, ... objs):void
[static] Set a drop shadow filter on all objects.
SetterUtils
  
stylesheet(ss:StyleSheet, ... tfields):void
[static] Set a stylesheet on all textfields.
SetterUtils
  
tabChildren(value:Boolean, ... objs):void
[static] Set the tabChildren property on all objects passed.
SetterUtils
  
tabEnabled(value:Boolean, ... objs):void
[static] Set the tabEnabled property on all objects passed.
SetterUtils
  
tabIndex(... fields):void
[static] Set tab index's on multiple textfields.
SetterUtils
  
textFormat(tf:TextFormat, ... tfields):void
[static] Set the text format property on all textfields.
SetterUtils
  
toggleVisible(... objs):void
[static] Toggles the visible property on all objects provided.
SetterUtils
  
useHandCursor(value:Boolean, ... objs):void
[static] Set the useHandCursor property on all objects provided.
SetterUtils
  
visible(value:Boolean, ... objs):void
[static] Set the visible property on all objects provided.
SetterUtils
  
width(value:Number, ... objs):void
[static] Set the width property on multiple objects.
SetterUtils
  
x(value:Number, ... objs):void
[static] Set the x property on multiple objects.
SetterUtils
  
y(value:Number, ... objs):void
[static] Set the y property on multiple objects.
SetterUtils
Method detail
alpha()method
public static function alpha(value:Number, ... objs):void

Set the alpha property on all objects provided.

Parameters
value:Number — The value to set the alpha to.
 
... objs — An array of objects with an alpha property.
autoSize()method 
public static function autoSize(value:String, ... fields):void

Set the autoSize property on multiple textfields.

Parameters
value:String — The autoSize value.
 
... fields — The textfields to set the autoSize property on.
buttonMode()method 
public static function buttonMode(value:Boolean, ... objs):void

Set the buttonMode property on all objects provided.

Parameters
value:Boolean — The value to set the buttonMode property to.
 
... objs — An array of objects that have the buttonMode property.
buttonModeAndHand()method 
public static function buttonModeAndHand(value:Boolean, ... objs):void

Set the buttonMode, and useHandCursor property on all obejcts provided.

Parameters
value:Boolean — The value to set buttonMode and useHand to.
 
... objs — Rest style, array of objects.
cacheAsBitmap()method 
public static function cacheAsBitmap(value:Boolean, ... objs):void

Set the cacheAsBitmap property on all objects provided.

Parameters
value:Boolean — The value to set the cacheAsBitmap property to.
 
... objs — An array of objects with the cacheAsBitmap property.
flipAlpha()method 
public static function flipAlpha(val1:Number, val2:Number, ... objs):void

Flip the alpha property on all objects provide, if the alpha on an object is equal to either val1 or val2, the values are flipped.

Parameters
val1:Number — The first alpha value.
 
val2:Number — The second alpha value.
 
... objs — The objects to toggle the visible property on.
flipBoolean()method 
public static function flipBoolean(prop:String, ... objs):void

Toggles the value of a boolean property to the opposite value for all objects provided.

Parameters
prop:String — The property to toggle.
 
... objs — All objects whose property will be flipped.
flipProp()method 
public static function flipProp(prop:String, ... value1, value2:*, objs:*):void

Toggle any property on any object - if the current value of the property is value1, it will be set to value2, as well as the reverse.

Parameters
prop:String — The property to toggle.
 
... value1 — The first value.
 
value2:* — The second value.
 
objs:* — The objects whose property will be toggled.
height()method 
public static function height(value:Number, ... objs):void

Set the height property on multiple objects.

Parameters
value:Number — The width value.
 
... objs — An array of objects with the height property.
mouseChildren()method 
public static function mouseChildren(value:Boolean, ... objs):void

Set the mouseChildren property on all objects provided.

Parameters
value:Boolean — The value to set the mouseChildren property to on all objects.
 
... objs — An array of objects with the mouseChildren property.
mouseEnabled()method 
public static function mouseEnabled(value:Boolean, ... objs):void

Set the mouseEnabled property on all objects provided.

Parameters
value:Boolean — The value to set the mouseEnabled property to on all objects.
 
... objs — An array of objects with the mouseEnabled property.
prop()method 
public static function prop(prop:String, ... value, objs:*):void

Set any property to the specified value, on all objects.

Parameters
prop:String — The objects to toggle the visible property on.
 
... value
 
objs:*
setDropShadow()method 
public static function setDropShadow(ds:DropShadowFilter, ... objs):void

Set a drop shadow filter on all objects.

Parameters
ds:DropShadowFilter
 
... objs
stylesheet()method 
public static function stylesheet(ss:StyleSheet, ... tfields):void

Set a stylesheet on all textfields.

Parameters
ss:StyleSheet — The stylesheet to apply.
 
... tfields — An array of text fields.
tabChildren()method 
public static function tabChildren(value:Boolean, ... objs):void

Set the tabChildren property on all objects passed.

Parameters
value:Boolean — value to set the tabChildren property to on all objects.
 
... objs — An array of objects with the tabChildren property.
tabEnabled()method 
public static function tabEnabled(value:Boolean, ... objs):void

Set the tabEnabled property on all objects passed.

Parameters
value:Boolean — value to set the tabChildren property to on all objects.
 
... objs — An array of objects with the tabEnabled property.
tabIndex()method 
public static function tabIndex(... fields):void

Set tab index's on multiple textfields.

Parameters
... fields — The textfields to set tabIndex on.
textFormat()method 
public static function textFormat(tf:TextFormat, ... tfields):void

Set the text format property on all textfields.

Parameters
tf:TextFormat — The text format to apply.
 
... tfields — An array of text fields.
toggleVisible()method 
public static function toggleVisible(... objs):void

Toggles the visible property on all objects provided.

Parameters
... objs — The objects to toggle the visible property on.
useHandCursor()method 
public static function useHandCursor(value:Boolean, ... objs):void

Set the useHandCursor property on all objects provided.

Parameters
value:Boolean — The value to set the useHandCursor property to.
 
... objs — An array of objects with the useHandCursor property.
visible()method 
public static function visible(value:Boolean, ... objs):void

Set the visible property on all objects provided.

Parameters
value:Boolean — The value to set the visible property to.
 
... objs — An array of objects with the visible property.
width()method 
public static function width(value:Number, ... objs):void

Set the width property on multiple objects.

Parameters
value:Number — The width value.
 
... objs — An array of objects with the width property.
x()method 
public static function x(value:Number, ... objs):void

Set the x property on multiple objects.

Parameters
value:Number — The x value.
 
... objs — An array of objects with the x property.
y()method 
public static function y(value:Number, ... objs):void

Set the y property on multiple objects.

Parameters
value:Number — The y value.
 
... objs — An array of objects with the y property.