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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:56:01+00:00 2026-05-17T06:56:01+00:00

I have a spark borderContainer that contains a spark TextInput. I have an mouse_down

  • 0

I have a spark borderContainer that contains a spark TextInput.
I have an mouse_down and mouse_up event handlers on the borderContainer in order to drag it around the screen; while dragging I change the cursor.

I would like to make the textInput behave as a “standard” textInput, i.e. when clicking on the textInput the user should not be able to drag the whole component but simply interact with text as he/she would normally. Also, I’d like the textInput cursor to look like a normal textInput cursor.

I’m not sure I’m doing this right. My assumption is that I need to stop the propagation of mouse_down and mouse_up on the textInput to inhibit the drag behavior from its parent, and manage rollOver and rollOut in order for the cursor to look ok. See below an example of my code (to simplify it there is no borderContainer or drag – but the code for that would be very simple – just a bit longer).

So here’s the issue: if one clicks on the spark textInput and then rolls out of it the cursor turns into a combination of a textInput cursor + the standard cursor set for for the borderContainer. This doesn’t seem to happen on mx textInput components (thus the two boxes), but unfortunately I need to use spark components. My guess is that I’m either not calling the cursorManager correctly or I’m not stopping the propagation of mouse_up properly – it seems like it should hit the textInput but not propagate to the borderContainer. I tried stopPropagation() as well but no luck.

Would love any advice / constructive criticism.

thank you!

f


<?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="application1_creationCompleteHandler(event)"
               mouseDown="application1_mouseDownHandler(event)"
               mouseUp="application1_mouseUpHandler(event)">


<fx:Script>
    <![CDATA[
        import mx.events.FlexEvent;
        import mx.managers.CursorManager;
        [Bindable] [Embed(source="../resources/hand.png")] private var _handIcon:Class;
        [Bindable] [Embed(source="../resources/Fist.png")] private var _fistIcon:Class;

        private var _cursorID:int;


        protected function textinput1_rollOutHandler(e:MouseEvent):void
        {
            e.stopImmediatePropagation();
            CursorManager.removeCursor(_cursorID);
            _cursorID = CursorManager.setCursor(_handIcon);
        }


        protected function textinput1_rollOverHandler(e:MouseEvent):void
        {
            e.stopImmediatePropagation();
            CursorManager.removeCursor(_cursorID);                              
        }


        protected function application1_creationCompleteHandler(e:FlexEvent):void
        {
            _cursorID = CursorManager.setCursor(_handIcon);
        }


        private function stopPropagation(event:MouseEvent):void
        {
            event.preventDefault();
            event.stopImmediatePropagation();
        }

        protected function textinput1_mouseDownHandler(event:MouseEvent):void
        {
            stopPropagation(event);
        }


        protected function textinput1_mouseUpHandler(event:MouseEvent):void
        {
            stopPropagation(event);
        }


        protected function application1_mouseDownHandler(event:MouseEvent):void
        {
            CursorManager.removeCursor(_cursorID);
            _cursorID = CursorManager.setCursor(_fistIcon);
        }


        protected function application1_mouseUpHandler(event:MouseEvent):void
        {
            CursorManager.removeCursor(_cursorID);
            _cursorID = CursorManager.setCursor(_handIcon);
        }

    ]]>
</fx:Script>

<s:TextInput x="43" y="30"
             rollOut="textinput1_rollOutHandler(event)"
             rollOver="textinput1_rollOverHandler(event)"
             mouseDown="textinput1_mouseDownHandler(event)"
             mouseUp="textinput1_mouseUpHandler(event)"/>
<mx:TextInput x="43" y="70"
              rollOut="textinput1_rollOutHandler(event)"
              rollOver="textinput1_rollOverHandler(event)"
              mouseDown="textinput1_mouseDownHandler(event)"
              mouseUp="textinput1_mouseUpHandler(event)"/>

  • 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-17T06:56:01+00:00Added an answer on May 17, 2026 at 6:56 am

    You can simply do not start drag and do not change the cursor if user clicks on input:

    protected function application1_mouseDownHandler(event:MouseEvent):void
    {
        var container:DisplayObjectContainer = event.target as DisplayObjectContainer;
        if (!container || container == textInput || textInput.contains(container))
            return;
    
        // start drag and change the cursor
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spark.components.TileGroup that contains buttons. I would like the buttons to appear like
... while still enabling it scroll? I have a Spark List running in a
I've created a skin that allows me to have two labels on a spark
Hi have a Spark TextInput control but I haven't figured out a way to
Using ASP.NET MVC & Spark, I have a view that is listing a number
I have a BorderContainer with some instances of spark Line. I need to select
I have a spark group with layout set to horizontal. The group contains a
I have a spark List defined as: <s:List id=symbolList dataProvider={symbolListCollection} change=symbolNameChangeHandler(event)></s:List> With the change
I have a Flex Spark Button that I've changed the background to a dark
I have an issue with Spark Lists whereby I am trying to ensure that

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.