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

  • SEARCH
  • Home
  • 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 5983323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:12:50+00:00 2026-05-22T22:12:50+00:00

I wish while I am dragging and moving around TitleWindow instance and a specific

  • 0

I wish while I am dragging and moving around TitleWindow instance and a specific event occure to simulate drop of the window, and not further moving been possible for a few seconds.

It is very unusual question but it will be more than handy each point to a solution

P.S: The whole idea is as follow: When I am dragging a TitleWindo instance with the mouse, and if the TitleWindow hit the border of it’s parent container then to drop the TitleWindow, and not further moving is possible (simulating release mouse button). If I wish to move it again, then I should click the TitleWindow title again and grag it.

  • 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-22T22:12:51+00:00Added an answer on May 22, 2026 at 10:12 pm

    @Yordan:

    Let’s see if I understand you correctly. The demo below will “stop” a window from being drug offstage. When you try to drag it off the top or left border, it will “simulate the release mouse button” as you requested. The right and bottom border won’t cause this to occur.

    AutoDropTitleWindow.mxml:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="setup()">
    <fx:Script>
        <![CDATA[
            import mx.managers.PopUpManager;
    
            private function setup() : void {
                var titleWin:MyTitleWindow = PopUpManager.createPopUp(this, MyTitleWindow, false) as MyTitleWindow;
                PopUpManager.centerPopUp(titleWin);
            }
        ]]>
    </fx:Script>
    
    </s:Application>
    

    MyTitleWindow.mxml:

    <?xml version="1.0" encoding="utf-8"?>
    <s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300"
               creationComplete="setup()"
               >
    
    <fx:Script>
        <![CDATA[
            import spark.events.TitleWindowBoundsEvent;
    
            private function setup(): void {
                addEventListener(TitleWindowBoundsEvent.WINDOW_MOVING, dragWatcher);
            }
    
            protected function dragWatcher(event:TitleWindowBoundsEvent):void
            {
                if (event.afterBounds.left < 0) {
                    event.afterBounds.left = 0;
                    dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP));
                } else if (event.afterBounds.right > systemManager.stage.stageWidth) {
                    event.afterBounds.left = systemManager.stage.stageWidth - event.afterBounds.width;
                }
                if (event.afterBounds.top < 0) {
                    event.afterBounds.top = 0;
                    dispatchEvent(new MouseEvent(MouseEvent.MOUSE_UP));
                } else if (event.afterBounds.bottom > systemManager.stage.stageHeight) {
                    event.afterBounds.top = systemManager.stage.stageHeight - event.afterBounds.height;
                }
            }
    
        ]]>
    </fx:Script>
    
    <s:Label x="10" y="10" text="X:"/>
    <s:Label x="10" y="30" text="Y:"/>
    
    <s:Label x="40" y="10" text="{this.x}"/>
    <s:Label x="40" y="30" text="{this.y}"/>
    
    </s:TitleWindow>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wish to remove specific characters inside Spark TextInput while user typing on it,
I wish to automatically enter a password while running an install script. I have
I wish Subversion had a better way of moving tags. The only way that
I wish to know whether a user is scrolling the DataGridView. While the user
I wish to create and operate textures with integer internal format (for further interop
While setting the Canonical tag, i found out that i am not getting all
How can I do this? I just wish to write something like while(true) {
I wish to drop all the constraints of tables I have. Since this is
I have a while loop i wish to escape when i hit the number
While browsing through source code in my IDE I'll sometimes wish I could see

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.