dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Clipping graphics of child movies

  1. #1

    Clipping graphics of child movies

    Is there a way to clip the graphics of a child movie? I want to draw a circle that runs over the edge of the movie and I want only the part inside the movie to show up. The actual function is more complicated than this, so please clipping responses only, I will not be able to draw semicircles instead.

  2. #2
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    All I found is to use masks.. sure, clipping rectangle would be faster but I did not found one in flash api.
    Or mayby using fixed size bitmap for drawing plane.. (totally untested... )
    Last edited by Finjogi; 12-30-2007 at 06:54 AM.

  3. #3
    Senior Member kusco's Avatar
    Join Date
    Nov 2001
    Posts
    681
    The standard method of clipping in Flash is to use a mask. Masks have the disadvantage of extra processing, but have the advantage of extra flexibility. Rendering to a bitmap surface would be as processing intensive as a mask.
    Cheers,
    kusco
    (3DFA Support Team)

  4. #4
    Ok. Where would the mask go? The samples show how to mask other elements, but I need clipping for this.graphics.drawStuff, with 'this' being a small movie within the main movie. Do I create a mask on the child movie then do mask.graphics.drawStuff?

  5. #5
    This need help with this one.

  6. #6
    Senior Member
    Join Date
    Dec 2006
    Posts
    274
    Draw for example a rectangle to your "small movie" ( using add visual elements-> paint->) Enable it's properties... Then add these lines in movie script(When movie starts script..)

    // these 2 lines make a mask to your small movie
    var mymask = element ("maski");
    this.mask = mymask;

    // test that masking is working...
    this.graphics.beginFill(0xFF0000);
    this.graphics.drawRect(0, 0, 800, 20); // draw very long rect..

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