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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T01:05:55+00:00 2026-06-14T01:05:55+00:00

Alpha invisibility. I currently define circular regions on some images as hot spots. For

  • 0

Alpha invisibility.

I currently define circular regions on some images as “hot spots”. For instance, I could have my photo on screen and overlay a circle on my head. To check for interaction with my head in realtime, I would returnOverlaps and do some manipulation on all objects overlapping the circle. For debugging, I make the circle yellow with alpha 0.5, and for release I decrease alpha to 0, making the circle invisible (as it should be).

Does this slow down the program? Is there another way to make the circle itself invisible while still remaining capable of interaction? Is there some way to color it “invisible” without using a (potentially) costly alpha of 0? Cache as bitmap matrix? Or some other efficient way to solve the “hot spot” detection without using masks?

  • 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-06-14T01:05:56+00:00Added an answer on June 14, 2026 at 1:05 am

    Having just a few invisible display objects should not slow it down that much, but having many could. I think a more cleaner option may be to just handle it all in code, rather then have actual invisible display objects on the stage.

    For a circle, you would define the center point and radius. Then to get if anyone clicked on it, you could go:

    var xDist:Number = circle.x - mousePoint.x;
    var yDist:Number = circle.y - mousePoint.y;
    
    if((xDist * xDist) + (yDist * yDist) <= (circle.radius * circle.radius)){
        // mousePoint is within circle
    } else {
        // mousePoint is outside of circle
    }
    

    If you insist on using display objects to set these circular hit areas (sometimes it can be easier visually, then by numbers), you could also write some code to read those display objects (and remove them from being rendered) in to get their positions and radius size.


    added method:

    // inputX and inputY are the hotspot's x and y positions, and inputRadius is the radius of the hotspot
    function hitTestObj(inputA:DisplayObject, inputX:int, inputY:int, inputRadius:int):Boolean {
        var xDist:Number = inputX - inputA.x;
        var yDist:Number = inputY - inputA.y;
        var minDist:Number = inputRadius + (inputA.width / 2);
        return (((xDist * xDist) + (yDist * yDist)) =< (minDist * minDist))
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some components ( alpha controls ) I can install them to Delphi
I have some strings containing alpha numeric values, say asdf1234 , qwerty//2345 etc.. I
I have a somewhat transparent view (alpha = 0.6) that has some subviews. I'd
Is it possible to have Alpha component for object._colors ? var object = new
I have downloaded pysb 1.0 alpha and when in try to install it with
I have a list shaped like this: '((Alpha . 1538) (Beta . 8036) (Gamma
I have a UIView with an alpha of 0.5 which I add as a
I have a string Alpha 2 from which I need to extract the integer
I have a table ALPHA with 2 fields GroupId,Member: GroupId | Member; A1----------A; A1----------B;
I have a legacy Alpha server with a RDB database. This db is replicated

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.