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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:44:35+00:00 2026-05-11T17:44:35+00:00

If I have a sprite, with which I have drawn some stuff, how do

  • 0

If I have a sprite, with which I have drawn some stuff, how do I erase part of what I have drawn? Preferably I could use drawRect() with some “alpha=0” paint.

However, I don’t believe the beginFill() method lets you set an RGBA color (like you can in bitmapData). Setting alpha = 0 in the graphics method of beginFill() doesn’t really do anything — it just draws nothing.

In my particular use case, masking isn’t an option.

Also, calling clear() isn’t a good solution, since it clears away everything.

  • 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-11T17:44:35+00:00Added an answer on May 11, 2026 at 5:44 pm

    Unfortunately, you cannot do exactly what you’re hoping to do with the Graphics class. Though erasing could mean that you draw over something you’ve already drawn with the background color, I’m guessing you’re hoping to “draw transparency” back onto the Graphics object. Drawing with an alpha of 0 is not drawing “nothing” – you just don’t see what you draw because it is fully transparent.

    This is what you get for working with vectors as opposed to bitmaps. To “erase” part of a vector means that you are creating an entirely new vector, something that’s going to take some computation rather than just setting some pixel to a certain color value. Graphics doesn’t provide such advanced functionality, though you could certainly write your own functions to do it. 😛

    One workaround is to use bitmaps instead:
    http://www.actionscript.org/forums/showthread.php3?t=187857
    http://www.actionscripts.org/forums/showthread.php3?t=149021

    Another is to consider whether you could implement what you’re trying to do in a different way; one that would lend itself to using clear().

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

Sidebar

Related Questions

I have written a CSS sprite auto-generator which takes selected images out of the
i have a input tag which is non editable, but some times i need
I have a sprite loaded as a texture and I need to animate it,
I have a Flash sprite in my Director project. Under the Properties of that
I have a swf with loads text into a Sprite that resizes based on
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part
I have a login.jsp page which contains a login form. Once logged in 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.