perhaps a
bit confused ...
the alert boxes appear on top of each other, sort of a 'last in - first
out" type of scenario, meaning the 'hi' is rendered, then the 'hello' is
rendered on top of 'hi'
working code below ...
----------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="doInit()">
<mx:Script>
import mx.controls.Button;
public var btn:Button = new Button();
public function doInit():void
{
btn.addEventListener("click",handleClick);
cnv1.addChild(btn);
}
public function handleClick(e:Event):void
{
mx.controls.Alert.show("hi"); // appears below the 'hello'
alert
mx.controls.Alert.show("hello"); // appears on top of the
'hi'
alert
}
</mx:Script>
<mx:Canvas id="cnv1" height="100" width="100"
backgroundColor="white"/>
</mx:Application>
"rama satoskar" To: [EMAIL PROTECTED]ups.com
<satoskar.rama@gmail.com>
cc:
Sent by: Subject: [flexcoders] Mx.controls.Alert confusion
[EMAIL PROTECTED]ups.com
06/13/2006 07:32 AM
Please respond to
flexcoders
hi all,
Has anyone come across this?
I have a button whose click event activates an event listener where i
have two alert boxes. The first one displays a message "hi" and the
second one displays"hello". They are written one after the
other.
However the second alert message displays first. Why is this?? i am
confused??
The code is given below:
var btn:Button = new Button()
btn.addEventListener(MouseEvent.Click,handleClick)
public function handleClick(event:Event):void
{
mx.controls.Alert.show("hi");
mx.controls.Alert.show("hello");
}
----------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure. If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
----------------------------------------------------------