pseudo.IconButton class
View Sample :: Return to index  
pseudo.IconButton.IconButton(pThis:MovieClip)
IconButton constructor. You never use the constructor to create this component.

Parameters pThis The movie clip on which the new IconButton will be drawn.
Returns Nothing
Example
    None


pseudo.IconButton.create(pOwner:MovieClip, strName:String, nDepth:Number):pseudo.IconButton
Use this static function to create new IconButton on the specified movie clip. Never use constructor directly to do it.

Parameters pOwner The movie clip on which the new IconButton will be drawn.
strName The new IconButton instance name.
nDepth The new IconButton instance depth.
Returns The reference to new IconButton instance
Example
		
  // Create an instance of the skin look
  var look:Object = pseudo.look.StdLook.getInstance();
  //Create an instance of the IconButton component
  btnIcon = pseudo.IconButton.create(_root, "btnIcon", 1);

	//apply the slin to the IconButton instanc
  btnIcon.setLook(look);
  btnIcon._x = 10;
  btnIcon._y = 10;
  btnIcon.setSize(40, 40);

  //Set buttons icons from the library
  btnIcon.setIcon("iconTestOut", "iconTestOver", "iconTestPress");
  btnIcon.update();
  btnIcon.draw();

//Create another instance of the IconButton component
  btnIcon2 = pseudo.IconButton.create(_root, "btnIcon2", 2);
  btnIcon2.setLook(look);
  btnIcon2._x = btnIcon._x + btnIcon.getW() + 5;
  btnIcon2._y = 10;
  btnIcon2.setSize(40, 40);

//load icons from the files
  btnIcon2.loadIcon("iconTestOut.swf", "iconTestOver.swf", "iconTestPress.swf");
  btnIcon2.update();
  btnIcon2.draw();


           


pseudo.IconButton.setIcon(iconOut:String, iconOver:String, iconPress:String):Void
Sets the linkage identifiers of symbols in the library to be used as icons for three states of a button instance
Parameters iconOut String
iconOver String
iconPress String
Returns Nothing
Example
    
  //Set buttons icons from the library the icons symbols should exist in the library before you
  //pass them as the parameters to the method
  btnIcon.setIcon("iconTestOut", "iconTestOver", "iconTestPress");
  btnIcon.update();
  btnIcon.draw();		   

pseudo.IconButton.loadIcon(iconOut:String, iconOver:String, iconPress:String):Void
Loads the icons for three states of the button instance using URLs to the JPG or SWF files.

Parameters iconOut String
iconOver String
iconPress String
Returns Nothing
Example
    
  //load icons from the files. Icon files should be located on the server
  btnIcon2.loadIcon("iconTestOut.swf", "iconTestOver.swf", "iconTestPress.swf");
  btnIcon2.update();
  btnIcon2.draw();

 

Flash UI Components (c)TUFaT.com, All Rights Reserved.