dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Using Transparent PNG for mask

  1. #1
    Junior Member
    Join Date
    Mar 2005
    Posts
    18

    Using Transparent PNG for mask

    hi everybody,

    i'm wondering how i can use my imported PNG (imported from PS) as a mask. The picture is transparent and i want it to run over a bitmap and reveal it partially. But the thing is that even though it is transparent (see attached picture) it does not ACT as if it was transparent. It even shows as transparent in Flash but when i mask it, it acts like a square with the size of the picture how can this be solved (preferably without having to draw this in flash or illustrator, which would suck)
    Attached Images Attached Images

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You can't do that. Break apart the bitmap. Then set the magic wand to 75 - 100 and remove the transparency. Make a movieclip out of the leftover and use that as a mask.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Student
    Join Date
    Apr 2001
    Location
    -
    Posts
    4,756
    there was some trick with alpha- gradients used as masks. This could be archived if the gradient alpha shape as MovieClip had the attribute of cacheAsBitmap set to true.
    Perhaps this works as well with PNG alpha bitmaps?

  4. #4
    Junior Member
    Join Date
    Mar 2005
    Posts
    18
    Quote Originally Posted by renderhjs
    there was some trick with alpha- gradients used as masks. This could be archived if the gradient alpha shape as MovieClip had the attribute of cacheAsBitmap set to true.
    Perhaps this works as well with PNG alpha bitmaps?
    maybe, i did this on a gradient (color -> transparent) that i had created in Flash, and that works. but i tried doing this to my PNG mask, and it doesnt seem to work, still acts as a square, maybe im doing something wrong?

    if not, thanks anyway for the magic wand tip
    Last edited by Oli_86; 09-29-2007 at 04:23 PM.

  5. #5
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    You absolutely can do this with png's. The png must be in a movie clip set to cache as bitmap, and the clip to be masked must also be set to cache as bitmap. Then you set the mask in code, like:

    myClip.setMask(maskClip)

    Export for Flash 8 or higher, and you're set.

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