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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:34:46+00:00 2026-05-15T09:34:46+00:00

i’ve created a sprite to drag and drop around the stage. the sprite is

  • 0

i’ve created a sprite to drag and drop around the stage. the sprite is masked and has it’s mask as it’s child so that it too will drag along with the sprite. everything works fine until i add a drop shadow filter to the sprite. when the drop shadow is added, i can only mousedown to drag and mouseup to drop the sprite if the mouse events occur within the original location of the sprite when it was added to the stage.

how can i fix this problem? could this be an issue with 10.1? if not what am i doing wrong?

var thumbMask:Sprite = new Sprite();
thumbMask.graphics.beginFill(0, 1);
thumbMask.graphics.drawRoundRect(0, 0, 100, 75, 25, 25);
thumbMask.graphics.endFill();

var thumb:Sprite = new Sprite();
thumb.graphics.beginFill(0x0000FF, 1);
thumb.graphics.drawRect(0, 0, 100, 75);
thumb.graphics.endFill();

thumb.addEventListener(MouseEvent.MOUSE_DOWN, drag);
thumb.addEventListener(MouseEvent.MOUSE_UP, drop);

thumb.filters = [new DropShadowFilter(0, 0, 0, 1, 20, 20, 1.0, 3)];

thumb.addChild(thumbMask);
thumb.mask = thumbMask;
addChild(thumb)

function drag(evt:MouseEvent):void
    {
    evt.target.startDrag();
    trace("drag");
    }

function drop(evt:MouseEvent):void
    {
    evt.target.stopDrag();
    trace("drop");
    }

—————-
UPDATED SOLUTION
—————-

thanks to the binary’s suggestion, the issue is solved by using cacheAsBitmap. however, when i applied cacheAsBitmap to the container, which was housing the masked thumb sprite that has already a drop shadow applied, the mouse events were not working as well as expected. after reading the docs, i learned that adding a filter to a sprite automatically activates the cacheAsBitmap property for that sprite:

The cacheAsBitmap property is
automatically set to true whenever you
apply a filter to a display object
(when its filter array is not empty),
and if a display object has a filter
applied to it, cacheAsBitmap is
reported as true for that display
object, even if you set the property
to false. If you clear all filters for
a display object, the cacheAsBitmap
setting changes to what it was last
set to. 1

so i believe the error was caused by having 2 cacheAsBitmap properties within the same container sprite. therefore, in this situation, i’ve simply added the filter to the container rather than to the masked thumb sprite.

var thumbMask:Sprite = new Sprite();
thumbMask.graphics.beginFill(0, 1);
thumbMask.graphics.drawRoundRect(0, 0, 100, 75, 25, 25);
thumbMask.graphics.endFill();

var thumb:Sprite = new Sprite();
thumb.graphics.beginFill(0x0000FF, 1);
thumb.graphics.drawRect(0, 0, 100, 75);
thumb.graphics.endFill();

thumb.addChild(thumbMask);
thumb.mask = thumbMask;

var container: Sprite = new Sprite();
container.addChild(thumb);
container.filters = [new DropShadowFilter(0, 0, 0, 1, 20, 20, 1.0, 3)];

//if there is no filters applied or if the filters array is empty, use:
//container.cacheAsBitmap = true;

addChild(container);

container.addEventListener(MouseEvent.MOUSE_DOWN, drag);
container.addEventListener(MouseEvent.MOUSE_UP, drop);

function drag(evt:MouseEvent):void
    {
    evt.target.startDrag();
    trace("drag");
    }

function drop(evt:MouseEvent):void
    {
    evt.target.stopDrag();
    trace("--DROP");
    }
  • 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-15T09:34:46+00:00Added an answer on May 15, 2026 at 9:34 am

    u can work around this too by wrapping your thumb clip into a container.
    set cacheAsBitmap to true and adjust the event-handling.

        thumb.filters = [new DropShadowFilter(0, 0, 0, 1, 20, 20, 1.0, 3)];
    
    //  thumb.addEventListener(MouseEvent.MOUSE_DOWN, drag);
    //  thumb.addEventListener(MouseEvent.MOUSE_UP, drop);
    
    var cont: Sprite = new Sprite();
        cont.addChild(thumb);
        cont.cacheAsBitmap = true;
        cont.addEventListener(MouseEvent.MOUSE_DOWN, drag);
        cont.addEventListener(MouseEvent.MOUSE_UP, drop);
    
        addChild(cont);
    

    so maybe you’ll don’t have to deal with a second sprite for your dropshadow.
    hope this helps..
    regards..

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
I need a function that will clean a strings' special characters. I do NOT
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
In my XML file chapters tag has more chapter tag.i need to display chapters

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.