• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Click through a transparent area of a bitmap

Engaged ,
Sep 18, 2008 Sep 18, 2008

Copy link to clipboard

Copied

Hey all,
I am importing some graphics on the fly, and want to be able to drag them around the stage, which all works great. My issue is that if I add a large element, like a border around the edge of the stage, this covers up all the other items so that clicking on them is not possible. I can see them, but when I click, the large item gets the event, even though visually, it is transparent. There are things I could do if I was doing all the development of the graphics in the IDE, but these items load at runtime, so it has to work with bitmaps. Any ideas?

- B
TOPICS
ActionScript

Views

1.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Sep 18, 2008 Sep 18, 2008

Copy link to clipboard

Copied

LATEST
Well,
I figured it out, and it wasn't too bad. I figured I'd post to let anyone else searching this board find the answer that I used. I load in pngs, and instead of just dropping the item on the stage, I now also save the bitmapData from the graphic. When the sprite that this graphic was added to is clicked on, it checks the alpha value to the alpha value in the stored bitmapData. If it's 0, then it starts to pass the event along to the other children below it. There may be a better way than this, but it seems to work for me...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines