4 Replies Latest reply: Jun 14, 2012 9:08 PM by bhargavi reddy RSS

    mask problem

    bhargavi reddy Community Member

      I am trying to mask a movieclip. But mask (shape of rectangle) is displayed over the content instead of masking the content in flash as3.



      Please anyone help me...

        • 1. Re: mask problem



          Please try this, it is working perfectly.




          import flash.events.Event;


          //mc is the instance of stage movieClip which has to be shown.

          //myMask is instance of movieclip in which region movieClip mc is to be shown.

          mc.mask = myMask;


          mc.addEventListener(Event.ENTER_FRAME, onEnter);


          //Keep movieClip mc at initial postion and myMask in center of the stage.

          function onEnter(e:Event):void


                    mc.x += 10;





          • 2. Re: mask problem
            bhargavi reddy Community Member

            Thaks for your reply


            It is also working but my problem is different. Luckily with the help of my senior, I got the solution.

            • 3. Re: mask problem
              vipul.khandelwal Community Member



              It is good tht you gotthe solution, you stated that problem is something else, please share the problem so that i can also be aware about that.





              • 4. Re: mask problem
                bhargavi reddy Community Member

                Hi Vipul,


                Its good to ask about the problem and solution. I will explain you in detail what the problem is and how I solved it.



                Actually my problem is I was trying to load data from URL and add the loaded data to a movieclip (I assumed this movieclip as  appsHolder). I want to add Scrolling for this one. For that I created one class with masking, scrolling functionalities. In that class I created one movieclip called holder and add the previous appsHolder to holder by calling a funtion. Here I applied masking to holder. and also every time the data is loading, I create one new appsHolder.  As I mentioned above I got a problem in masking.



                I am trying to analyse my mistake and found that every time creating a new appsHolder generates a problem. Immediatley I removed that code and create appsHolder only once.


                And also I want to mention another thing, masking applied for either holder or appsHolder doesn't represents difference.


                I don't know whether it is logical or not. But finally the problem is solved.