Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-07-2005, 03:04 PM   #1
Blake1024
Registered User
 
Join Date: May 2005
Posts: 13
Default Alerts show behind ActionScript generated components

When I create an Alert it appears on top of components added through the
IDE (Flash MX 2004 Pro) but it appears behind components I've added via
manual ActionScript code. I want the allert to behave like a message box
but it is no good since I generate most of my components via ActionScript.
How can I make the Alert's always show on top of all the components?

For example, create a SWF and add one TextInput control by fragging it
on the stage with the IDE. Then execute the following code:

import mx.controls.Alert;
import mx.controls.TextInput;

createClassObject(mx.controls.Label, "staticText1", getNextHighestDepth(), {});
staticText1.move(300 , 4 );
staticText1.setSize(94 , 20 );
staticText1.text = "Select Application";

createClassObject(mx.controls.TextInput, "City", getNextHighestDepth(), {});
City.move(48, 111 );
City.setSize(224 , 18 );
City.text = "Miami";

var msg = Alert.show("My message", "Message Window");[/FONT]

See how the Alert appears above the IDE added component but behind the
ActionScript generated controls. You can tell by moving the Alert around on
the screen. How can I fix this?

Thanks a lot.
Blake1024 is offline   Reply With Quote
Old 05-07-2005, 03:07 PM   #2
cxn926
no
 
cxn926's Avatar
 
Join Date: Mar 2005
Posts: 719
Default

Put It In As Tags Please!!!!!!!!!!!!!!
cxn926 is offline   Reply With Quote
Old 05-07-2005, 03:40 PM   #3
Blake1024
Registered User
 
Join Date: May 2005
Posts: 13
Default

What is a Tag?
Blake1024 is offline   Reply With Quote
Old 05-07-2005, 04:09 PM   #4
cxn926
no
 
cxn926's Avatar
 
Join Date: Mar 2005
Posts: 719
Default

do you see the symbol on the message thing that look like a black f on a red circle. click that 1nce then type your code then click it another time. i hope you understand
cxn926 is offline   Reply With Quote
Old 05-07-2005, 04:14 PM   #5
Blake1024
Registered User
 
Join Date: May 2005
Posts: 13
Default

I thik I got it. Like this:

ActionScript Code:
trace(getNextHighestDepth());

Now, how can I solve my problem?

I tried

ActionScript Code:
msg.setDepthAbove(City);

And it works but requires that I always know what my last added control is. I then
tried:

ActionScript Code:
msg.setDepthTo(getNextHighestDepth()-1);
or
ActionScript Code:
msg.setDepthTo(getNextHighestDepth()-1);
But that just hangs the Alert. ???
Blake1024 is offline   Reply With Quote
Old 05-07-2005, 04:16 PM   #6
Blake1024
Registered User
 
Join Date: May 2005
Posts: 13
Default

The second thing I tried was:

ActionScript Code:
msg.setDepthTo(getNextHighestDepth());

(which hung the Alert).
Blake1024 is offline   Reply With Quote
Old 05-07-2005, 04:59 PM   #7
mmm..pi..3.14..
/(bb|[^b]{2})/
 
mmm..pi..3.14..'s Avatar
 
Join Date: May 2004
Location: Denver, CO
Posts: 2,740
Default

One line is all it takes...

ActionScript Code:
import mx.controls.Alert; import mx.controls.TextInput; createClassObject(mx.controls.Label, "staticText1", getNextHighestDepth(), {}); staticText1.move(300, 4); staticText1.setSize(94, 20); staticText1.text = "Select Application"; createClassObject(mx.controls.TextInput, "City", getNextHighestDepth(), {}); City.move(48, 111); City.setSize(224, 18); City.text = "Miami"; var msg = Alert.show("My message", "Message Window"); //move the newly placed Alert component to the top level msg.swapDepths(_root.getNextHighestDepth());

Eric
__________________
Eric Hainer
Unleaded Software
970.581.3387
Email: Eric followed by the AT symbol, unleaded software (one word) DOT com
Denver Web Design
mmm..pi..3.14.. is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:04 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.