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 6216233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:11:56+00:00 2026-05-24T07:11:56+00:00

I have an AIR application. It should be moved around the screen with the

  • 0

I have an AIR application. It should be moved around the screen with the mouse. In order to achieve this I use the event:

this.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, true,-2);

It should be activated with the lowest priority compared to inserted elements for example those that should be scrolled, clicked, etc.

I tried the solution shown below with the event priority set to -1 because there might happen 2 different events and my moving application event should be the last one to be serviced or shouldn’t be serviced at all.

<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication 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="200" 
                       height="200"
                       applicationComplete="init()">
    <fx:Script>
        <![CDATA[
            import mx.core.Window;
            import mx.events.ScrollEvent;

            private function init():void {
                this.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, true,-2);   
            }

            private function onMouseDown(event:MouseEvent):void {
                trace("clicked on stage "+event.currentTarget.toString());
                if(event.currentTarget == stage){
                    trace("catched stage target");
                    this.nativeWindow.startMove();
                    event.stopImmediatePropagation();
                }

            }
            function scrolledCanvasHandler(event:ScrollEvent){
                trace("clicked on canvas "+event.currentTarget.toString());
                event.stopPropagation();
            }

        ]]>
    </fx:Script>
    <mx:Canvas x="29" y="34" width="80%" height="80%" backgroundColor="#343434" scroll="scrolledCanvasHandler(event)">
        <mx:Label x="25" y="77" text="moving window, moving window"
                  fontSize="18" color="#FFFFFF" fontWeight="bold"/>

    </mx:Canvas>
</s:WindowedApplication>

As you will notice the

event.stopPropagation(); 

doesn’t work.

Perhaps my solution isn’t the best suited to achieve this. Are there better solutions?

Chris

  • 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-24T07:11:56+00:00Added an answer on May 24, 2026 at 7:11 am

    that’s what i did in an app of mine:

    <s:HGroup id="appTitleBar" 
      width="100%" height="35" 
      styleName="titleBar" 
      mouseDown="nativeWindow.startMove();" 
      doubleClickEnabled="true" 
      doubleClick="nativeWindow.minimize();"  
      contentBackgroundColor="#313131"/>
    

    click (+drag) on this HGroup will drag the window. duobleclick will minimize it.

    edit
    don’t make your whole app draggable this will only confuse the user.
    and btw priority should be positive not negative – but also don’t mess with this. not expected behavior for anyone.

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

Sidebar

Related Questions

I have an AIR application that is downloaded from a webpage. In order to
We have developed Air application and next step it is porting this application to
I'm developing a Adobe Air application that should make use of a SWF file
I have an Air application with a main window. I would like to have
I have an Air application that lets users import jpg, png and swf files
I have an AIR application with a login form. What I want to do
I have written an AIR Application that downloads videos and documents from a server.
I am working on a small AIR desktop application and I have some configuration
I need to send data from an Air application, using a certificate. This certificate
I have AIR application that i have created. One of my customers wants me

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.