Yeah, you were just a little quicker than me getting that one posted.  Mine is pretty much the same solution:

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

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

    <mx:Script>
        <![CDATA[
       
            function toggleVis(){
                tw.visible = !tw.visible;
            }
        ]]>
   
    </mx:Script>
   
    <mx:Canvas width="100%" height="100%">
        <mx:VBox x="0" y="0" width="100%" height="100%" horizontalAlign="center">
            <mx:Button click="toggleVis()" label="click me"/>
        </mx:VBox>
        <mx:TitleWindow x="100" y="0" id="tw" title="Some title" width="300" height="200" visible="false">
            <mx:Label text="hi there"/>
        </mx:TitleWindow>       
    </mx:Canvas>

</mx:Application>

-- Matthew

On 5/12/05, Sreejith Unnikrishnan <[EMAIL PROTECTED]> wrote:
ok ... thats interesting ..
Here's an idea ... you can try it ...
 
<mx:Application>
    <mx:Canvas>
        <mx:HBox>
// Your entire application goes here //
        </mx:HBox>
        <mx:HBox>
// The poup you need can go in here preferably in another Hbox hidden initially that takes x and y coordinates that you can pass either by mouse coordinates on Click//
            <mx:HBox x="" y="">
            </mx:HBox>
        </mx:Hbox>
    </mx:Canvas>
<mx:Application>
 
:-)
-----Original Message-----
From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Jeff Beeman
Sent: Friday, May 13, 2005 12:18 AM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] Internal popups

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 -----

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



Yahoo! Groups Links

Reply via email to