Packagenet.guttershark.util
Classpublic final class SetterUtils

The SetterUtils class is a singleton that has 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 su:SetterUtils=SetterUtils.gi();
  
  var mc1,mc2,mc3:MovieClip;
  var mcref:Array=[mc1,mc2,mc3];
  
  su.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.
  su.visible(false,mcref);
  

There are a ton of other methods in here that offer the same benefts.



Public Methods
 MethodDefined by
  
alpha(value:Number, ... objs):void
Set the alpha property on all objects provided.
SetterUtils
  
autoSize(value:String, ... fields):void
Set the autoSize property on multiple textfields.
SetterUtils
  
buttonMode(value:Boolean, ... objs):void
Set the buttonMode property on all objects provided.
SetterUtils
  
cacheAsBitmap(value:Boolean, ... objs):void
Set the cacheAsBitmap property on all objects provided.
SetterUtils
  
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.
SetterUtils
  
flipBoolean(prop:String, ... objs):void
Toggles the value of a boolean property to the opposite value for all objects provided.
SetterUtils
  
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.
SetterUtils
  
[static] Singleton access.
SetterUtils
  
mouseChildren(value:Boolean, ... objs):void
Set the mouseChildren property on all objects provided.
SetterUtils
  
mouseEnabled(value:Boolean, ... objs):void
Set the mouseEnabled property on all objects provided.
SetterUtils
  
prop(prop:String, ... value, objs:*):void
Set any property to the specified value, on all objects.
SetterUtils
  
propsFromModel(obj:*, propsId:String):void
Set properties on an object, the properties come from the model in a <propset></propset> node.
SetterUtils
  
tabChildren(value:Boolean, ... objs):void
Set the tabChildren property on all objects passed.
SetterUtils
  
tabEnabled(value:Boolean, ... objs):void
Set the tabEnabled property on all objects passed.
SetterUtils
  
tabIndex(... fields):void
Set tab index's on multiple textfields.
SetterUtils
  
toggleVisible(... objs):void
Toggles the visible property on all objects provided.
SetterUtils
  
useHandCursor(value:Boolean, ... objs):void
Set the useHandCursor property on all objects provided.
SetterUtils
  
visible(value:Boolean, ... objs):void
Set the visible property on all objects provided.
SetterUtils
  
x(value:Number, ... objs):void
Set the x property on multiple object.
SetterUtils
  
y(value:Number, ... objs):void
Set the y property on multiple object.
SetterUtils
Method detail
alpha()method
public 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 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 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.
cacheAsBitmap()method 
public 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 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 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 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.
gi()method 
public static function gi():SetterUtils

Singleton access.

Returns
SetterUtils
mouseChildren()method 
public 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 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 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:*
propsFromModel()method 
public function propsFromModel(obj:*, propsId:String):void

Set properties on an object, the properties come from the model in a <propset></propset> node.

Parameters
obj:* — The object whose properties will be updated.
 
propsId:String — The id of the <propset> node in the model.
tabChildren()method 
public 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 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 function tabIndex(... fields):void

Set tab index's on multiple textfields.

Parameters
... fields — The textfields to set tabIndex on.
toggleVisible()method 
public 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 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 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.
x()method 
public function x(value:Number, ... objs):void

Set the x property on multiple object.

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

Set the y property on multiple object.

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