| Example |
//get instance of the look that will be used to draw elements
var look:Object = pseudo.look.XPLook.getInstance();
//create movie clip where the components will be drawn
_global.main = pseudo.BaseMovie.create(_root, "main", 1);
pseudo.ToolTip.create(_root, "m_toolTip", 2);
// add label to the main movie. addItem function will
// also create a movie clip using a specified
// class function
var lbl = _global.main.addItem(pseudo.Label, "lbl", 1);
//applying the look to the movie will use the same look and feel
// to all components that were added to it
_global.main.setLook(look);
//set the size of the label
lbl.setSize(250, 20);
lbl.setAlign("center");
lbl.setText("Place Mouse Over Me To See Tool Tip");
// add listener that will display the tool tip when the mouse is over
// the label. We use tryToShow() function that shows the tool tip after
// a little delay
lbl.addListener("rollOver", lbl, function(){ pseudo.ToolTip.getInstance().tryToShow(this, "Tool Tip Text"); });
//Draw main movie with everything that is on it
_global.main.update();
_global.main.draw();
var tip = pseudo.ToolTip.getInstance();
//Set the type of the tool tip
tip.setData({type:"label"});
//Set the look of the tool tip. ToolClass is not derived
// from the pseudo.BaseMovie, so it has its own setLook() function
tip.setLook(look);
|