I'm confused by exactly what you want to do. You have a reference to the
SimpleDialog/TitleWindow class you just created (myPopUp).

After you center it, why not just set some value on it? myPopUp.somestring =
"hello";

 

 

  _____  

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Saturday, December 15, 2007 3:46 PM
To: [email protected]
Subject: [flexcoders] Basic Question from a Flex Newbie

 

Hello All ----

I have been using Flash and AS3 for some time now, however I am new to Flex
(and this group) and looking forward to seeing all that it can do.  I have
come across a situation which I believe to be rather simple to resolve, yet
I have been unable to do so. I have my Application file which is calling a
PopUp Component created with a TitleWindow Component. I have a button in the
Application file that when it's clicked will open the PopUpComponent. How
can I pass a variable/parameter from the Application to the TitleWindow for
the text . Here's the code I am using in Application:

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

<mx:Script>
    <![CDATA[
        
        import dialogue.SimpleDialogue;
        import mx.managers.PopUpManager
        import mx.containers.TitleWindow;
        
        private var myPopUp:TitleWindow
        
        private function showPopUp():void

            myPopUp =
PopUpManager.createPopUp(this,dialogue.SimpleDialogue,true) as TitleWindow;
            PopUpManager.centerPopUp(myPopUp)
        }
    ]]>
</mx:Script>
    
<mx:Button label="Show Popup Dialogue" click="showPopUp()"></mx:Button>
</mx:Application>
--------------------------------------------------------------------------

And here's the code in the Component:
---------------------------------------------
//SimpleDialogue Component

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

<mx:Label id="message" text="" fontSize="24">
    
</mx:Label>
    
</mx:TitleWindow>
-----------------------------------------------------------

Hopefully, this makes sense. If not, I would be happy to clarify. Thanks for
any and all replies.

SL

 

Reply via email to