Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open window with buttons when a button is clicked?

Posted on 2011-03-09
2
Medium Priority
?
218 Views
Last Modified: 2012-05-11
hi guys

I have a requirment where when a user clicks on a button i want a small window to pop-up. The window should say

'Are you sure you want to submit?' and should contain two buttons 'Yes' and 'No'.

Any idea how i can acchieve this with flex?


thanks
0
Comment
Question by:royjayd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 37

Assisted Solution

by:CyanBlue
CyanBlue earned 400 total points
ID: 35094262
I think this tutorial just do what you need to do...
   http://www.roseindia.net/flex/flex-alert-box.shtml

CyanBlue
0
 
LVL 2

Accepted Solution

by:
sunsonmahesh earned 1600 total points
ID: 35094898
Hi
as CyanBlue said using alert is easiest way..
if u really want a window of ur own ,u have to create a window and add buttons and message to that window,and add event listeners and display (everything have to be done by u)..

-mahesh
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" creationComplete="init()">

    <mx:Script>
        <![CDATA[
            import mx.containers.ControlBar;
            import mx.containers.Panel;
            import mx.containers.VBox;
            import mx.controls.Button;
            import mx.controls.Label;
            import mx.controls.Spacer;
            import mx.controls.TextInput;
            import mx.managers.PopUpManager;

            private var panel:Panel;

            private function init():void {
                var vb:VBox = new VBox();
                var label:Label = new Label();
                var textInput:TextInput = new TextInput();

                var cb:ControlBar = new ControlBar();
                var s:Spacer = new Spacer();
                var b1:Button = new Button();
                var b2:Button = new Button();

                s.percentWidth = 100;

                b1.label = "Yes";
                b1.addEventListener(MouseEvent.CLICK, closePopUp);
                b2.label = "No";
                b2.addEventListener(MouseEvent.CLICK, closePopUp);

                cb.addChild(s);
                cb.addChild(b1);
                cb.addChild(b2);

                label.text = "Your message here:";

                vb.setStyle("paddingBottom", 5);
                vb.setStyle("paddingLeft", 5);
                vb.setStyle("paddingRight", 5);
                vb.setStyle("paddingTop", 5);
                vb.addChild(label);
                vb.addChild(textInput);

                panel = new Panel();
                panel.title = "My Title";
                panel.width = 240;
                panel.height = 180;
                panel.addChild(vb);
                panel.addChild(cb);
            }

            private function closePopUp(evt:MouseEvent):void {
                PopUpManager.removePopUp(panel);
            }

            private function createPopUp(evt:MouseEvent):void {
                PopUpManager.addPopUp(panel, this, true);
                PopUpManager.centerPopUp(panel);
            }
        ]]>
    </mx:Script>

    <mx:Button label="Launch Pop-Up" click="createPopUp(event)" />

</mx:Application>

Open in new window

0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question