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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:14:57+00:00 2026-05-30T19:14:57+00:00

I have a problem and I have potential solution. But I wanted to confirm

  • 0

I have a problem and I have potential solution. But I wanted to confirm if there is an easy and simple way to solve my problem.

App type:

Isometric Game

Problem statement:

I am loading images in my flash app and have mouse events attached to them.

The images I load are prop images like vehicles, trees, buildings etc., and all of them are transparent.

Example: Red ball asset (please ignore the yellow background which I applied to describe the problem)

Red Ball Asset

If I click on the actual image area (colored in red), then every thing works perfect

I don’t want to trigger mouseevent when I click on empty image part (or transparent area, which I have shown in yellow color)

There is one way I know by creating masks in flash. I don’t want to do it unless that is the final option left because I load image assets instead of flash assets and I don’t want to create a new mask asset for all the assets

There is another method I was going to adopt by using getPixel method of Bitmap. Which is discussed here.

But there is another problem with this method.

I might be able to ignore the click event when I click on the empty part of the asset but if there is some other asset is behind the image in the same location, then I need to process the click event for the occluded image.

Well, thinking of solution to this problem takes me to the getObjectsUnderPoint where I can scan the occluded assets

  • 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-30T19:14:59+00:00Added an answer on May 30, 2026 at 7:14 pm

    One interesting solution is to use Sprite objects with the individual non-transparent pixels burnt onto them.

    Suppose this is your Loader “complete” handler:

    private function loaderCompleteHandler(event:Event):void
    {
        // Loader is not our child, we use a Sprite instead (below).
        var loader:Loader = Loader(event.target);
    
        var sprite:Sprite = new Sprite();
        addChild(sprite);
    
        var w:Number = loader.content.width;
        var h:Number = loader.content.height;
    
        // Use transparent bitmap.
        var bitmapData:BitmapData = new BitmapData(w, h, true, 0);
        bitmapData.draw(loader.content);
    
        // Now burn the image onto the Sprite object, ignoring
        // the transparent pixels.
        for (var xPos:int = 0; xPos < w; xPos++) {
            for (var yPos:int = 0; yPos < h; yPos++) {
                var pixel32:uint = bitmapData.getPixel32(xPos, yPos);
                var alpha:int = pixel32 >>> 24;
                if (alpha != 0) {
                    sprite.graphics.beginFill(pixel32 & 0xFFFFFF, alpha / 0xFF);
                    sprite.graphics.drawRect(xPos, yPos, 1, 1);
                    sprite.graphics.endFill();
                }
            }
        }
    
    }
    

    Essentially you want “empty” pixels that aren’t clickable, and fully transparent pixels aren’t quite the same thing. With this solution you get empty pixels.

    Only problem is that this might be slow. Give it a shot.

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

Sidebar

Related Questions

i have this problem: ms-access could not delete and i found a potential solution
I've solved my problem, but because I have tried and failed to solve it
I'm trying to figure out a potential solution to a future problem In my
My problem in fairly simple. I have a login system constructed using php, mysql
Problem: a table of coordinate lat/lngs. Two rows can potentially have the same coordinate.
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names
I have problem with starting processes in impersonated context in ASP.NET 2.0. I am
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with ActionLink. I'd like to pass to my ActionLink parameter for

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.