Wednesday, April 6, 2011

Flex unable to see mask

I have two sprites, the first is the mask and the second on is going to be masked by the first. Right now I can see the second sprite that is masked, but not the first that is doing the masking. Is there a way to show the sprite that is doing the mask?

From stackoverflow
  • I don't know If I understand your question, but that's the point of masks. Those are invisible. On the other hand, in Flex Builder I can see masks in Design mode:

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
    <mx:Canvas width="100" height="100" backgroundColor="0xFF6644" id="mask1"/>
    <mx:Canvas width="100" height="100" backgroundColor="0x4466FF" x="30" y="20" mask="{mask1}"/>
    </mx:Application>
    
    asawilliams : youre right, the question was not very clear. I re-worded the question to hopefully make it clearer
  • apparently there is no way to make the mask visible

    George Profenza : once a clip is used as a mask, you can no longer display it if that's what you mean. use a duplicate, either a separate instance of a bitmapData clone using the draw() method, inserted into a Bitmap object and added to the display list
  • Do you need to show the mask object as a demo of some sort ?

    You could just create another instance of the mask and stick on top, maybe make it transparent of change it's blendMode so the elements bellow are visible.

    asawilliams : I ended up creating another instance and adding it to the parent before the child that was going to be masked.
    George Profenza : glad u got it sorted out

0 comments:

Post a Comment