LOGIN Don't have an account yet?   Register

Forgot password?
 
18Dec2009

9-slice scaling a mask


If you ever tried to apply 9-slice scaling to a mask, you probably noticed it doesn’t work.

The solution is this:
1. Use a movieclip and apply 9-slice scaling to it. (let’s say mcShape)
2. Add this movieclip into the mask. (so you would have mcMask.mcShape)
3. Apply cacheAsBitmap to mcMask and mcObject, where mcObject is the object you want to mask.
4. Apply the mask with ActionScript: mcObject.mask = mcMask; (do not apply 9-slice scaling to mcMask)

Hope this helps! :-)

This post has 3 comments | Post your comment

jackson

October 1, 2010 at 9:23 am

THANK YOU!

Reply

Amer

August 3, 2011 at 10:05 pm

mask_mc.cacheAsBitmap = true;
mc.cacheAsBitmap = true;
mask_mc.width = 800;
mc.mask = mask_mc;

9-Slice scalling not working.

Reply
 

corneliu.chitanu

August 15, 2011 at 6:09 am

Hello,

The 9 slice scaling is not supported by masks so this workaround solves it by setting a movie clip inside that mask. In order to increase the size of the mask you just need to change the width for the movieclip inside the mask and not the width of the actual mask.

So it should be:

mask_mc.object_mc.width = 800;

where object_mc is the movieclip inside the mask_mc which you would apply the 9-slice scaling to.


Leave a Reply

blog entries RSS Feedproducts RSS Feed

Categories

Popular Files

  • Compact Flash Mp3 Player
  • Horizontal Image Slide on Mouse Move
  • Accordion Menu with Images from XML
  • Accordion Banner Rotator
  • Continuous Image Slider
  • Mp3 Player with Playlist
  • Flash Ken Burns Effect Slideshow
  • Accordion Gallery
  • Horizontal Scroller Slideshow
  • Fade In Fade Out Slideshow With Navigation
  • Simple AS3 Flash Video Player
  • Zoom Gallery

Download the plugin above
Read more about Flabell WordPress plugin

Archives

Search the blog