Hmm… still not what I’m looking for.  I guess what I would like is for something like this (what the previous responder sent) to work:

 

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">

         <mx:Button click="toggleVis()" label="click me"/>

         <mx:TitleWindow id="tw" title="Some title">

                 <mx:Label text="hi there"/>

         </mx:TitleWindow>

         <mx:Script>

         <![CDATA[

                 function toggleVis(){

                         tw.visible = !tw.visible;

                 }

 

         ]]>

         </mx:Script>

</mx:Application>

 

But I need the TitleWindow to behave not like a standard interface element (one that takes up space in the layout), but like a normal popup window, one that appears above the content at a specified location.

 

It looks like using another MXML file is the way to go…

 

 

 

 

/******************************************
* Jeff Beeman
******************************************/


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Matt Horn
Sent: Thursday, May 12, 2005 11:41 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Internal popups

 

Here's an example that uses createPopUp() to create a TextArea popup (no other file required):

 

<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Script>
import mx.managers.PopUpManager;

var app = mx.core.Application.application;
var a = mx.controls.TextArea;
var p:MovieClip;

 

function createTextAreaPopup() {
 p = PopUpManager.createPopUp(app,a,false,{ width:200,height:150,text:'Pop goes the weasel and the weasel goes pop' });
}

 

function destroyPopup() {
 p.deletePopUp();
}
</mx:Script>

 

<mx:VBox xmlns:mx="http://www.macromedia.com/2003/mxml" width="500" height="200">
 <mx:Button id="b1" label="Create TextArea Popup" click="createTextAreaPopup();" />
 <mx:Button id="b2" label="Destroy Popup" click="destroyPopup();" />
</mx:VBox>
</mx:Application>

 

HTH,

 

matt horn

flex docs

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of JesterXL
Sent: Thursday, May 12, 2005 2:26 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Internal popups

It's compiled into the final SWF so there isn't technically a dependency.

 

However, if you want a simple popup, you could use an Alert.

 

check out Alert.show for that, and for loading internal components as popups, look up PopUpManager.createPopUp

 

----- Original Message -----

From: Jeff Beeman

Sent: Thursday, May 12, 2005 2:21 PM

Subject: RE: [flexcoders] Internal popups

 

I can’t find an example or description of how to use the TitleWindow component without it being in an external file.  Any pointers?

 

 

/******************************************
* Jeff Beeman
******************************************/


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Tracy Spratt
Sent: Thursday, May 12, 2005 10:45 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Internal popups

 

You probably want the TitleWindow component.

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of Jeff Beeman
Sent: Thursday, May 12, 2005 12:56 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Internal popups

 

I’ve been scouring the documentation, but I can’t seem to find how to do something that should be quite simple.  How do I create a popup window that doesn’t reference an external file?  All examples point to loading in an external mxml file, but I would like to simply create a panel that is hidden on startup and have it hide / unhide on different events.  Is this possible?

 

 

/*******************************************
* Jeff Beeman
* Digital Media & Instructional Technologies
* Arizona State University
*******************************************/

 

 



Yahoo! Groups Links

Reply via email to