A Flash Developer Resource Site

Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2008

    onPress only non-transparent area in PNG movieclip?

    Is this possible? I have an irregular shape png with transparency contained in a movieclip, but when i use onPress on the movieclip it presses the whole bounding box.

    ActionScript Code:

    pngMC.onPress = function() {

    Is there any way to make it only fire when it presses the non-transparent area of the PNG?


  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    You have to go inside your movieclip or button, then select your PNG, press Cntrl + B to Break apart your PNG and convert it to editable bitmap, and then with the Eraser Tool, remove all the white/transparent leftovers outside your png's boundaries.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  3. #3
    Senior Member
    Join Date
    Aug 2012
    You might find it easier to use magic wand tool to do this, but this only good if you have static image from library, no good if you import dynamic image and stuff, then you need use things like getPixel(x,y) and BitmapData. many tutories on web

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width

HTML5 Development Center

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.