Pages

Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Thursday, February 26, 2015

From Public Speaking Class to CEO of Google Schmidt

  • YouTube - Eric Schmidt Public Speaking Class
  • Wikipedia - Eric E. Schmidt
  • Portfolio.com - Dr.Eric E. Schmidt, Ph.D.
WHO?
Eric Emerson Schmidt, Ph.D (born 1955 in Washington, D.C.) is Chairman and CEO of Google Inc and a member of the Board of Directors of Apple Inc. In contrast to Bill Gates and Steve Jobs, he has a strong (formal) educational background, including a PhD in Electrical Engineering and Computer Sciences (EECS) from the University of California, Berkeley (1982). Schmidt started of his working career as research staff for Xerox. In 1983, Schmidt joined Sun Microsystems as software manager. At Sun he led the development of Java, Suns platform-independent programming technology (Microsoft or Dot NETs arch-rival?), and defined Suns Internet software strategy. He later became chief technology officer and corporate executive officer. From 1997 to 2001, Schmidt was CEO of Novell. In 2001, Google founders Larry Page and Sergey Brin (with the assistance of executive search firm Heidrick & Struggles, Inc.) recruited Eric Schmidt to run their company under the influence of venture capitalists John Doerr and Michael Moritz (Source).

Interestingly, Schmidt beat out 50 other contenders (It would be thrilling to know their selection and evaluation methods!) to become chairman and eventually CEO of Google. Importantly, he pioneered the company’s 70-20-10 model: Google employees are expected to spend 70 percent of their time on the core search and advertising businesses, 20 percent on related activities, and 10 percent on new projects (Source).

Also, Schmidt is one of the few people who have become a billionaire (estimated wealth of US$ 6.2 Billion) based on stock options received as an employee in a corporation of which neither he nor a relative was the founder (Source). Yeah, Steve Ballmer is another one of those few!


PUBLIC SPEAKING CLASS?
While searching for something else yesterday evening (Great discoveries often happen by accident!), I discovered this interesting YouTube video entitled: Eric Schmidt Public Speaking Class. Based on watching the video and reading the comments, I assume Schmidt is about 33 years old (1988) here, and is the general manager at Sun Microsystems. He basically wants to improve his public speaking skills, and be able to communicate better to larger audiences (Yes, as he goes up in rank, he is facing larger audiences. So better prepare!). Based on some of the given clues (video, search tags, comments and buzzer!) this seems to be a Toastmasters session. Yes, Eric Schmidt was/is a Toastmaster (I assume). Also, you will have fun watching him being grilled (by his own staff?) and evaluated by the small audience (I assume based on the noise. The camera is mostly focused on him, obviously!). Here we go:


JUICE?
Actually, the main reason for sharing with you this video is not really to show you an example of excellent public speaking. If that was the case, I would rather show you a Martin Luther King ("I have a dream..."), or Ed Tate (2000 World Champion of Public Speaking) speech. Actually, if you want to improve your public speaking skills, these two public speaking champions (in their own way!) would certainly give you some ideas and inspiration.

Hmm, lets get back on track! The real juice of this video to me, is not how he speaks, but what he says about management, leadership, innovation and organizational growth. Lets recap some of the juice.

Here is a summarized version of what Eric Schmidt said with a bit of creative flavor.

Where there is no conflict, there is no life.
-Niccolo Machiavelli

"The most important quality of a manager is his ability to lead people. Leadership comes from within, and is not something one can easily teach. It is about getting your staff excited, motivated and inspired to action. I have discovered that it is much more important to be a good leader, than actually understand what you are doing. If you are a good leader you can hire people that can teach you things.

From my experience the most successful companies are the ones where there is enormous conflict. Conflict does not mean killing one another, but instead means there is a process by which there is a disagreement. It is okay to have different points of views and disagree, because tolerance for multiple opinions and people often leads to the right decision through some kind of process.

It is really the only way to deal with the high rate of change (and continuous and disruptive innovation!) we find in the technology industry. Nothing in school prepares you for this... that was the thing that really annoyed me the most... In fact if you look in the computer industry, every one of the successful companies is run by a real tough guy, somewhere high up in the management chain, who has established a tone of conflict. A professional constructive conflict tone!

The benefits that you get from conflict from the standpoint of the company, is the ability to compete, innovate, grow and make lot of money."

"...With decades of corporate experience, Schmidt brings a grown-up approach to the Page-and-Brin show. When the two know-it-alls are locked in heated argument, it’s up to Schmidt to lead them to agreement so that the company can present a united front to employees and Wall Street. (Source) "

So you see, his early understanding, experience and ability to facilitate Creative Disagreements (A term he used during the video) has certainly helped him to succeed at Google and spark more innovation and success. Schmidt plays today a critical role in "building the corporate infrastructure needed to maintain Googles rapid growth as a company and on ensuring that quality remains high while product development cycle times are kept to a minimum. (Source)"

Overall, I am pretty sure I missed out on some of the juice from the video (and perhaps added a bit!), so you better watch the video to catch the rest (and correct me where I went wrong!). Also, I am reasonably sure that Eric Schmidts ideas about management, leadership, innovation and organizational growth has evolved since this video (19 years ago!), so you might want to Google some of his latest videos or articles to keep yourself updated.

Finally, I hope by watching this video you realize that having weaknesses or knowing about your weaknesses is actually a strength, if you deal with them. Eric Schmidt knew that he was not a good public speaker or communicator, but he also knew that if he worked on these weaknesses he would improve... (and the rest is history, still in the making!). So, there is still hope (and stay away from dope!) for people like us to succeed (in whatever we aspire to be!). We just got to keep on trying, and never give up. Hmm, I beginning to sound like a motivation speaker, so I better stop here.

Anyway, have fun learning something from this video. This video could also be an excellent trigger for class/online discussions :)

Read more »

Thursday, February 5, 2015

Creating EasyTooltip class Part 4

Today we will make a simple mouse follower, which displays very simple tool tips.

Before we move on to adding new code, lets go to TooltipListener class and set tip and list variables public instead of private:

package com.kircode.EasyTooltip 
{
import flash.display.DisplayObject;
import flash.events.MouseEvent;

/**
* Manages a single visible object that displays a tooltip when rolled over.
* @author Kirill Poletaev
*/
public class TooltipListener
{

public var tip:Tooltip;
public var list:DisplayObject;

public function TooltipListener(listener:DisplayObject, tooltip:Tooltip)
{
list = listener;
tip = tooltip;
listener.addEventListener(MouseEvent.ROLL_OVER, onOver);
listener.addEventListener(MouseEvent.ROLL_OUT, onOut);
}

public function kill():void {
list.removeEventListener(MouseEvent.ROLL_OVER, onOver);
list.removeEventListener(MouseEvent.ROLL_OUT, onOut);
}

private function onOver(evt:MouseEvent):void {
tip.display = true;
}

private function onOut(evt:MouseEvent):void {
tip.display = false;
}

}

}

Now lets create a new class called TooltipCursor. I want to make this the only object thats displayed in Tooltip - the content of it changes depending on what tooltip is currently displayed, but the object itself is the same.

Create TooltipCursor.as class, which extends MvoieClip. Add "txt" variable, which is a TextField, add it to the display list:

package com.kircode.EasyTooltip 
{
import flash.display.MovieClip;
import flash.text.TextField;
/**
* The cursor that follows the mouse (if not set otherwise) and displays each tooltip.
* @author Kirill Poletaev
*/
public class TooltipCursor extends MovieClip
{

public var txt:TextField;

public function TooltipCursor()
{
txt = new TextField();
addChild(txt);
txt.y = - 20;
}

}

}

We can now go to EasyTooltip.as and declare an instance of this new class:

private var cursor:TooltipCursor;

In the constructor, set its mouseChildren and mouseEnabled properties to false, add it to the parents display list and also add an ENTER_FRAME event listener for the cursor.

cursor = new TooltipCursor();
cursor.mouseChildren = false;
cursor.mouseEnabled = false;
parent.addChild(cursor);
cursor.addEventListener(Event.ENTER_FRAME, onFrame);

In the event handler, we loop through all listeners to see which ones "display" property is true. If none is displayed, set cursors alpha to 0. If one of the listeners display value is true - set the cursors alpha to 1, and update its text fields text value and width:

private function onFrame(evt:Event):void {
var displayInd:int = -1;
for (var i:int = 0; i < listeners.length; i++) {
if (listeners[i].tip.display) {
displayInd = i;
break;
}
}
if (displayInd == -1) {
cursor.alpha = 0;
}else {
cursor.alpha = 1;
cursor.txt.text = listeners[displayInd].tip.msg;
cursor.txt.width = cursor.txt.textWidth + 10;
}
cursor.x = par.mouseX;
cursor.y = par.mouseY;
}

Full EasyTooltip class so far:

package com.kircode.EasyTooltip 
{
import flash.display.DisplayObjectContainer;
import flash.display.DisplayObject;
import flash.events.Event;
/**
* Utility for creation of tooltips.
* @author Kirill Poletaev
*/
public class EasyTooltip
{

private var par:DisplayObject;
public var listeners:Array;
private var cursor:TooltipCursor;

/**
* Create a Tooltip manager. Needed for creating and managing tooltips.
* @paramparent Reference to the parent of tooltips - the container, which will contain the objects that will be rolled over.
*/

public function EasyTooltip(parent:DisplayObjectContainer)
{
par = parent;
listeners = [];
cursor = new TooltipCursor();
cursor.mouseChildren = false;
cursor.mouseEnabled = false;
parent.addChild(cursor);
cursor.addEventListener(Event.ENTER_FRAME, onFrame);
trace("Tooltip manager created!");
}

/**
* Add a Tooltip listener.
* @paramlistener Object, which invokes the tooltip on roll over.
* @paramtooltip Message to be displayed.
* @returnNewly created Tooltip object. Can be used to dynamically change its properties in real-time.
*/

public function addListener(listener:DisplayObject, tooltip:String):Tooltip {
var tip:Tooltip = new Tooltip(tooltip);
var list:TooltipListener = new TooltipListener(listener, tip);
listeners.push(list);
return tip;
}

private function onFrame(evt:Event):void {
var displayInd:int = -1;
for (var i:int = 0; i < listeners.length; i++) {
if (listeners[i].tip.display) {
displayInd = i;
break;
}
}
if (displayInd == -1) {
cursor.alpha = 0;
}else {
cursor.alpha = 1;
cursor.txt.text = listeners[displayInd].tip.msg;
cursor.txt.width = cursor.txt.textWidth + 10;
}
cursor.x = par.mouseX;
cursor.y = par.mouseY;
}

}

}

Now when you roll over a listener, you can see a very simple tooltip appearing, and disappearing as you roll out.

Thanks for reading!
Read more »

Creating Advanced Alert Window class Part 34

Today well add the ability to reset the constructor options of an AdvAlertManager object in real-time, as well as add support for setting default width, height and minHeight values of an alert window.

Firstly, go to AdvAlertManager and declare 3 new variables for holding default width, height and minheigh values:

private var defWidth:int;
private var defHeight:int;
private var defMinHeight:int;

Now go to the constructor and add 3 new parameters - defaultWidth, defaultHeight and defaultMinHeight.

Inside the constructor, apply these values to defWidth, defHeight and defMinHeight.

Also, remove the if..statement that checks if tabDisable is true before adding keyboard listener.

/**
* AdvAlertManager constructor.
* @paramdefaultWindowContainer Parent container of alert windows.
* @paramstage Stage reference.
* @paramwindowSkin Default skin for alert windows.
* @parambuttonSkin Default skin for buttons in this window.
* @paramopenSound Default window open sound.
* @paramdisableTab Disable tab focusing on the parent container when an alert window is visible. This also enables tab navigation for the alert windows buttons.
* @paramdefaultWidth Set default width for all window alerts. 300 by default.
* @paramdefaultHeight Set default height for all window alerts. 0 by default. If 0, the window is auto-sized based on the text length.
* @paramdefaultMinHeight Set default minimal height for all window alerts. 0 by default.
*/

public function AdvAlertManager(defaultWindowContainer:DisplayObjectContainer, stage:Stage, windowSkin:AdvAlertSkin = null, buttonSkin:AdvAlertButtonSkin = null, openSound:Sound = null, disableTab:Boolean = true, defaultWidth:int = 300, defaultHeight:int = 0, defaultMinHeight:int = 0)
{
defWidth = defaultWidth;
defHeight = defaultHeight;
defMinHeight = defaultMinHeight;
openingSound = openSound;
skin = windowSkin;
bSkin = buttonSkin;
tabDisable = disableTab;
if (skin == null) skin = new AdvAlertSkin();
if (bSkin == null) bSkin = new AdvAlertButtonSkin();
defaultContainer = defaultWindowContainer;
pWidth = stage.stageWidth;
pHeight = stage.stageHeight;
stg = stage;
windows = [];
stg.addEventListener(KeyboardEvent.KEY_DOWN, kDown);
}

The if...statement was taken away because well add an option to change the value of tabDisable variable. Instead of deciding whether to add a keyboard listener based on the value, well always add the keyboard event, but check if tabDisable is true inside the kDown function before executing the code:

private function kDown(evt:KeyboardEvent):void {
if(tabDisable){
if (evt.keyCode == 9 && topWindow!=null && topWindow.buttons.length>0) {
focusedButton++;
if (focusedButton == topWindow.buttons.length) {
focusedButton = 0;
}
for (var i:int = 0; i < topWindow.buttons.length; i++) {
topWindow.buttons[i].over = false;
topWindow.buttons[i].updateDraw();
}
topWindow.buttons[focusedButton].over = true;
topWindow.buttons[focusedButton].updateDraw();
}
if (evt.keyCode == 13 && topWindow != null && topWindow.buttons.length > 0) {
if (focusedButton == -1) {
focusedButton = 0;
}
var currentIndex:int = windows.length - 1;
var closeHandler:Function = windows[currentIndex].onclose;
closeWindow(currentIndex, closeHandler);
}
}
}

Now go to alert() function and add 3 new lines that check if width, height or minHeight values are 0, and if so - apply default values to them:

if (width == 0) width = defWidth;
if (height == 0) height = defHeight;
if (minHeight == 0) minHeight = defMinHeight;

Full alert() function:

/**
* Create an alert window.
* @paramtext Text value of the alert window.
* @paramtitle Title value of the alert window.
* @parambuttons (Optional) Array of AdvAlertButton objects that represent buttons in the alert window.
* @paramcloseHandler (Optional) Close handling function. Must receive a string value as parameter (which will hold the label of the button that was clicked).
* @paramwidth (Optional) Width of the alert window. If 0, set to default.
* @paramheight (Optional) Height of the alert window. If 0, set to default. If default is 0, window will be auto sized.
* @paramposition (Optional) Coordinates of top-left corner of the alert window. If not specified - the window is centered.
* @paramminHeight (Optional) The minimum height value of the alert window. 0 by default.
*/

public function alert(text:String, title:String = "", buttons:Array = null, closeHandler:Function = null, width:int = 0, height:int = 0, position:Point = null, minHeight:int = 0, openSound:Sound = null):AdvAlertWindow {
if (width == 0) width = defWidth;
if (height == 0) height = defHeight;
if (minHeight == 0) minHeight = defMinHeight;
if (openSound != null) {
openSound.play();
}else
if (openingSound != null) {
openingSound.play();
}
if (position == null) position = new Point((pWidth / 2) - (width / 2), (pHeight / 2) - (height / 2));
if (buttons == null) buttons = [new AdvAlertButton("OK")];
for (var i:int = buttons.length - 1; i >= 0; i--) {
if (!buttons[i] is AdvAlertButton) {
throw new Error("An item in buttons array is not an AdvAlertButton instance. Ignoring...");
buttons.splice(i, 1);
}else {
buttons[i].addEventListener(MouseEvent.CLICK, buttonHandler);
}
}
var w:AdvAlertWindow = new AdvAlertWindow(text, title, width, height, position, skin, buttons, bSkin, pWidth, pHeight, minHeight);
var b:AdvAlertBlur = new AdvAlertBlur(pWidth, pHeight, skin);
var currentIndex:int = windows.length;
windows.push( {window:w, blur:b, onclose:closeHandler} );
defaultContainer.addChild(b);
defaultContainer.addChild(w);

topWindow = w;
focusedButton = -1;
if (tabDisable) {
defaultContainer.tabChildren = false;
defaultContainer.tabEnabled = false;
}

function buttonHandler(evt:MouseEvent):void {
closeWindow(currentIndex, closeHandler);
}
return w;
}

Now create a new public function called reset(), with the same parameters as the constructor. The contents are the same as in the constructor too, with the exception of 2 lines - exclude the ones that set windows array to a new array and the one that adds keyboard listener.

/**
* Set new options for the alert manager object - has the same parameters as the constructor.
* @paramdefaultWindowContainer Parent container of alert windows.
* @paramstage Stage reference.
* @paramwindowSkin Default skin for alert windows.
* @parambuttonSkin Default skin for buttons in this window.
* @paramopenSound Default window open sound.
* @paramdisableTab Disable tab focusing on the parent container when an alert window is visible. This also enables tab navigation for the alert windows buttons.
* @paramdefaultWidth Set default width for all window alerts. 300 by default.
* @paramdefaultHeight Set default height for all window alerts. 0 by default. If 0, the window is auto-sized based on the text length.
* @paramdefaultMinHeight Set default minimal height for all window alerts. 0 by default.
*/

public function reset(defaultWindowContainer:DisplayObjectContainer, stage:Stage, windowSkin:AdvAlertSkin = null, buttonSkin:AdvAlertButtonSkin = null, openSound:Sound = null, disableTab:Boolean = true, defaultWidth:int = 300, defaultHeight:int = 0, defaultMinHeight:int = 0)
{
defWidth = defaultWidth;
defHeight = defaultHeight;
defMinHeight = defaultMinHeight;
openingSound = openSound;
skin = windowSkin;
bSkin = buttonSkin;
tabDisable = disableTab;
if (skin == null) skin = new AdvAlertSkin();
if (bSkin == null) bSkin = new AdvAlertButtonSkin();
defaultContainer = defaultWindowContainer;
pWidth = stage.stageWidth;
pHeight = stage.stageHeight;
stg = stage;
}

Full AdvAlertManager class:

package com.kircode.AdvAlert 
{
import flash.display.DisplayObjectContainer;
import flash.display.MovieClip;
import flash.display.Stage;
import flash.events.MouseEvent;
import flash.geom.Point;
import flash.events.KeyboardEvent;
import flash.events.Event;
import flash.media.Sound;
/**
* Advanced Alert window manager.
* @author Kirill Poletaev
*/
public class AdvAlertManager
{
private var windows:Array;
private var defaultContainer:DisplayObjectContainer;
private var pWidth:int;
private var pHeight:int;
private var skin:AdvAlertSkin;
private var bSkin:AdvAlertButtonSkin;
private var tabDisable:Boolean;
private var topWindow:AdvAlertWindow;
private var focusedButton:int;
private var stg:Stage;
private var openingSound:Sound;
private var defWidth:int;
private var defHeight:int;
private var defMinHeight:int;

/**
* AdvAlertManager constructor.
* @paramdefaultWindowContainer Parent container of alert windows.
* @paramstage Stage reference.
* @paramwindowSkin Default skin for alert windows.
* @parambuttonSkin Default skin for buttons in this window.
* @paramopenSound Default window open sound.
* @paramdisableTab Disable tab focusing on the parent container when an alert window is visible. This also enables tab navigation for the alert windows buttons.
* @paramdefaultWidth Set default width for all window alerts. 300 by default.
* @paramdefaultHeight Set default height for all window alerts. 0 by default. If 0, the window is auto-sized based on the text length.
* @paramdefaultMinHeight Set default minimal height for all window alerts. 0 by default.
*/

public function AdvAlertManager(defaultWindowContainer:DisplayObjectContainer, stage:Stage, windowSkin:AdvAlertSkin = null, buttonSkin:AdvAlertButtonSkin = null, openSound:Sound = null, disableTab:Boolean = true, defaultWidth:int = 300, defaultHeight:int = 0, defaultMinHeight:int = 0)
{
defWidth = defaultWidth;
defHeight = defaultHeight;
defMinHeight = defaultMinHeight;
openingSound = openSound;
skin = windowSkin;
bSkin = buttonSkin;
tabDisable = disableTab;
if (skin == null) skin = new AdvAlertSkin();
if (bSkin == null) bSkin = new AdvAlertButtonSkin();
defaultContainer = defaultWindowContainer;
pWidth = stage.stageWidth;
pHeight = stage.stageHeight;
stg = stage;
windows = [];
stg.addEventListener(KeyboardEvent.KEY_DOWN, kDown);
}

private function kDown(evt:KeyboardEvent):void {
if(tabDisable){
if (evt.keyCode == 9 && topWindow!=null && topWindow.buttons.length>0) {
focusedButton++;
if (focusedButton == topWindow.buttons.length) {
focusedButton = 0;
}
for (var i:int = 0; i < topWindow.buttons.length; i++) {
topWindow.buttons[i].over = false;
topWindow.buttons[i].updateDraw();
}
topWindow.buttons[focusedButton].over = true;
topWindow.buttons[focusedButton].updateDraw();
}
if (evt.keyCode == 13 && topWindow != null && topWindow.buttons.length > 0) {
if (focusedButton == -1) {
focusedButton = 0;
}
var currentIndex:int = windows.length - 1;
var closeHandler:Function = windows[currentIndex].onclose;
closeWindow(currentIndex, closeHandler);
}
}
}

/**
* Close the top alert window.
*/

public function closeLast():void {
var currentIndex:int = windows.length - 1;
var closeHandler:Function = windows[currentIndex].onclose;
closeWindow(currentIndex, closeHandler);
}

private function closeWindow(currentIndex:int, closeHandler:Function):void {
if (closeHandler != null) closeHandler.call(topWindow.buttons[focusedButton], topWindow.buttons[focusedButton].txt);
windows[currentIndex].window.parent.removeChild(windows[currentIndex].window);
windows[currentIndex].blur.parent.removeChild(windows[currentIndex].blur);
windows.splice(currentIndex, 1);
focusedButton = -1;
if (windows.length > 0) topWindow = windows[windows.length - 1].window;
if (windows.length == 0) topWindow = null;
if (tabDisable && windows.length==0) {
defaultContainer.tabChildren = true;
defaultContainer.tabEnabled = true;
}
}

/**
* Set skin of all future created alert windows.
* @paramwindowSkin Reference to an AdvAlertSkin object.
*/

public function setSkin(windowSkin:AdvAlertSkin):void {
skin = windowSkin;
}

/**
* Set skin of all buttons of future created alert windows.
* @parambuttonSkin Reference to an AdvAlertButtonSkin object.
*/

public function setButtonSkin(buttonSkin:AdvAlertButtonSkin):void {
bSkin = buttonSkin;
}

/**
* Set new options for the alert manager object - has the same parameters as the constructor.
* @paramdefaultWindowContainer Parent container of alert windows.
* @paramstage Stage reference.
* @paramwindowSkin Default skin for alert windows.
* @parambuttonSkin Default skin for buttons in this window.
* @paramopenSound Default window open sound.
* @paramdisableTab Disable tab focusing on the parent container when an alert window is visible. This also enables tab navigation for the alert windows buttons.
* @paramdefaultWidth Set default width for all window alerts. 300 by default.
* @paramdefaultHeight Set default height for all window alerts. 0 by default. If 0, the window is auto-sized based on the text length.
* @paramdefaultMinHeight Set default minimal height for all window alerts. 0 by default.
*/

public function reset(defaultWindowContainer:DisplayObjectContainer, stage:Stage, windowSkin:AdvAlertSkin = null, buttonSkin:AdvAlertButtonSkin = null, openSound:Sound = null, disableTab:Boolean = true, defaultWidth:int = 300, defaultHeight:int = 0, defaultMinHeight:int = 0)
{
defWidth = defaultWidth;
defHeight = defaultHeight;
defMinHeight = defaultMinHeight;
openingSound = openSound;
skin = windowSkin;
bSkin = buttonSkin;
tabDisable = disableTab;
if (skin == null) skin = new AdvAlertSkin();
if (bSkin == null) bSkin = new AdvAlertButtonSkin();
defaultContainer = defaultWindowContainer;
pWidth = stage.stageWidth;
pHeight = stage.stageHeight;
stg = stage;
}

/**
* Create an alert window.
* @paramtext Text value of the alert window.
* @paramtitle Title value of the alert window.
* @parambuttons (Optional) Array of AdvAlertButton objects that represent buttons in the alert window.
* @paramcloseHandler (Optional) Close handling function. Must receive a string value as parameter (which will hold the label of the button that was clicked).
* @paramwidth (Optional) Width of the alert window. If 0, set to default.
* @paramheight (Optional) Height of the alert window. If 0, set to default. If default is 0, window will be auto sized.
* @paramposition (Optional) Coordinates of top-left corner of the alert window. If not specified - the window is centered.
* @paramminHeight (Optional) The minimum height value of the alert window. 0 by default.
*/

public function alert(text:String, title:String = "", buttons:Array = null, closeHandler:Function = null, width:int = 0, height:int = 0, position:Point = null, minHeight:int = 0, openSound:Sound = null):AdvAlertWindow {
if (width == 0) width = defWidth;
if (height == 0) height = defHeight;
if (minHeight == 0) minHeight = defMinHeight;
if (openSound != null) {
openSound.play();
}else
if (openingSound != null) {
openingSound.play();
}
if (position == null) position = new Point((pWidth / 2) - (width / 2), (pHeight / 2) - (height / 2));
if (buttons == null) buttons = [new AdvAlertButton("OK")];
for (var i:int = buttons.length - 1; i >= 0; i--) {
if (!buttons[i] is AdvAlertButton) {
throw new Error("An item in buttons array is not an AdvAlertButton instance. Ignoring...");
buttons.splice(i, 1);
}else {
buttons[i].addEventListener(MouseEvent.CLICK, buttonHandler);
}
}
var w:AdvAlertWindow = new AdvAlertWindow(text, title, width, height, position, skin, buttons, bSkin, pWidth, pHeight, minHeight);
var b:AdvAlertBlur = new AdvAlertBlur(pWidth, pHeight, skin);
var currentIndex:int = windows.length;
windows.push( {window:w, blur:b, onclose:closeHandler} );
defaultContainer.addChild(b);
defaultContainer.addChild(w);

topWindow = w;
focusedButton = -1;
if (tabDisable) {
defaultContainer.tabChildren = false;
defaultContainer.tabEnabled = false;
}

function buttonHandler(evt:MouseEvent):void {
closeWindow(currentIndex, closeHandler);
}
return w;
}

}

}

Heres an example of using both of the new features in main.as:

var mySkin:AdvAlertSkin = new AdvAlertSkin();
mySkin.addContent(warning_icon, new Point(5, 40));
mySkin.textPadding.left = 140;
mySkin.titleFilters = [new DropShadowFilter(0, 0, 0, 1, 3, 3, 2, 3)];
mySkin.textFilters = [new DropShadowFilter(1, 45, 0, 0.4, 0, 0, 5, 1)];

var myButtonSkin:AdvAlertButtonSkin = new AdvAlertButtonSkin();
myButtonSkin.textFilters = [new DropShadowFilter(1, 45, 0, 0.4, 0, 0, 5, 1)];
myButtonSkin.hover_textFilters = [new DropShadowFilter(1, 45, 0, 0.4, 0, 0, 5, 1), new DropShadowFilter(0, 0, 0, 1, 3, 3, 1, 3)];

AlertManager = new AdvAlertManager(this, stage);
AlertManager.alert("Alert window with default settings.", "Example alert!");
AlertManager.reset(this, stage, mySkin, myButtonSkin, null, true, 400, 0, 160);
AlertManager.alert("Alert window with custom settings.", "Example alert!");

Thanks for reading!
Read more »