Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1047895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T16:22:20+00:00 2026-05-16T16:22:20+00:00

My application will need some windows but I can’t use the popUpManager to handle

  • 0

My application will need some windows but I can’t use the popUpManager to handle custom components so I’m thinking to implement a new window system.

But I still don’t know how to merge it with my custom components. Any ideas?

My code:

My login skin:

<s:Skin(...)>
   <s:Group>
      (...login components...)
   </s:Group>
</s:Skin>


package com.totty.app.components.login {
import com.totty.app.TottysBrain;
import com.totty.app.components.window.Window;
import com.totty.app.events.LoginSuccessEvent;
import com.totty.tottysBrain.components.BrainyDynComponent;
import com.totty.tottysBrain.components.BrainyWindow;

import flash.events.Event;
import flash.events.MouseEvent;

import mx.controls.Alert;
import mx.managers.PopUpManager;

import spark.components.Button;
import spark.components.CheckBox;
import spark.components.Group;
import spark.components.Label;
import spark.components.TextInput;
import spark.components.supportClasses.SkinnableComponent;

[Event(name="loginSuccess", type="com.totty.app.events.LoginSuccessEvent")]
public class Login extends BrainyDynComponent {
    [SkinPart(required="true")]
    public var email:TextInput;

    [SkinPart(required="true")]
    public var password:TextInput = new TextInput();

    [SkinPart(required="false")]
    public var rememberMe:CheckBox;

    [SkinPart(required="false")]
    public var notification:Label;

    [SkinPart(required="true")]
    public var submit:Button = new Button();

    private var _currentState:uint = 0;
    private var _states:Array = ['default', 'logging', 'loginFailure', 'loginSuccess'];

    private var _default:Boolean = false;
    private var _logging:Boolean = false;
    private var _loggingSuccess:Boolean = false;
    private var _loggingFailure:Boolean = false;

    public function Login() {
        super();

        defaultCommand = 'users.login';
        defaultSkin = LoginSkin;

        _setCurrentState(0);

        onPartAdded('submit', function():void {
                submit.addEventListener(MouseEvent.CLICK, _submitLoginButton_click);
        });

        onPartRemoved('submit', function():void {
                submit.removeEventListener(MouseEvent.CLICK, _submitLoginButton_click);
        });

        onPartAdded('window', function():void{
            //window.addEventListener('close', _window_close);
            //window.title = 'Login';
        });
    }

    private function _window_close(evt:Event):void{
        dispatchEvent(evt);

        var parentAsGroup:Group = parent as Group
        parentAsGroup.removeElement(this);
    }

    protected function _submitLogin():void {
        _setCurrentState(1);
        submitData({email:email.text, password:password.text, rememberMe:rememberMe.selected});
    }

    override protected function _onSuccess(result:*):void {
        Alert.show(result);
        _setCurrentState(3);
        if(result) {
            dispatchEvent(new LoginSuccessEvent(email.text, rememberMe.selected));
            _loggingSuccess = true;
        }else{
            _setCurrentState(4);
            _loggingSuccess = false;
        }
    }

    override protected function _onFailure(result:*):void {
        Alert.show(result);
        _setCurrentState(4);
        _loggingSuccess = false;
    }

    private function _submitLoginButton_click(evt:MouseEvent):void {
        _submitLogin();
    }

    private function _setCurrentState(n:uint):void{
        if(_currentState == n) return;

        _currentState = n;
        invalidateProperties();
    }

    override protected function commitProperties():void{
        super.commitProperties();




        switch(_currentState){
            case 0:
                // default
                //window.footerText = '';
            break;
            case 1:
                // logging
                //window.footerText = 'logging';
            break;
            case 2:
                // loginFailure
                //window.footerText = 'loginFailure';
            break;
            case 3:
                // loginSuccess
                //window.footerText = 'loginSuccess';
                //parentBrain.removeElement(this);
                //var parentAsGroup:Group = parent as Group
                //PopUpManager.removePopUp(this);
                //parentAsGroup.removeElement(this);
            break;
        }
    }
}

}`

Now I have the main application to add this component in a window. I would prefer to be able to be able to see the window while I’m designing the interface. That means that the window component must be added to the component. Not to use the but something like to contain all the contents of the component.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T16:22:21+00:00Added an answer on May 16, 2026 at 4:22 pm

    Maybe you already saw this, but its a good place to start, anyway 🙂

    http://code.google.com/p/flexmdi/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My company is looking into writing a custom application that will need to perform
I might need to write some GUI application that runs on .Net (and Windows),
I'm building a Windows application that will go against a SQL 2008 database. Some
My application (written in WPF/C#) will monitor a live video source and will need
I need to find/create an application that will create employee web usage reports from
i am writing an application that will need to store less than about 1mb
I'm currently designing an application which I will ultimately want to move to Windows
For a requirement to generate per-PC license keys, I need some code which will
I'm currently in the need of developing a Windows application. I want to keep
I make a distributed embedded application that will make use of several micro-controllers. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.