Hi,
I can’t try this at the moment, but I would like to know if this is the way to do it.
So here is the scenario:
I am developing a standalone app that is composed of modules.
A module is a sprite container that contains other sprites or movieclips. Pure AS3, design was made with the IDE and exported as SWF.
In one module, I have a curved background that is loaded from an SWF.
On this curved background I have other modules loaded that are displayed with an alpha tween and they are fully on the background, they don’t move.
But I have two modules that have a rectangle base bigger than the height of the curved background and I want to motion tween them on the curved background in a way that the parts hanging off the curved background are masked.
So the Z order and hierarchy would be like this:
------ sprite container parent
[LIST]
[]curved background
[]module 1 (staying inside background)
[]module 2 (inside)
[]module … (inside)
[]bigger rectangle module that need to be masked and motion tweened in
[/LIST]My solution would be:
[LIST]
[]load another instance of the curved background to use it as a mask.
[]add this mask to the display list as a child of the “sprite container parent”
[]keep this mask on the top of all modules(??? not sure about this)
[]position the mask exactly as the curved background
[]load the module that I want to mask and position it outside of the visible stage
[]add the mask on the module that need to be masked.
[]motion tween the module to the visible area
[/LIST]
What I am not sure about:
[LIST]
[]even if the mask is not child the module to be masked, will it move with the module that is tweened? (I want the mask to stay still)
[]I want every other display object to be visible under the mask, only the masked module should be masked (this is obvious I guess)
[/LIST]
Thanks a lot for helping me out with this!
Greg