A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: .draw on a group of movieclips

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Posts
    23

    Question .draw on a group of movieclips

    Hey everyone,

    In a game I am making, I want bullets and missiles to leave a trail behind,
    so I'm using bitmapdata, drawing each bullet individually using matrix for them to appear in the right spot, like so...

    Code:
    function drawbmp(MC:Object) {
    	matrix.ty = MC._y;
    	matrix.tx = MC._x;
    	matrix.a = Math.cos(MC._rotation/(180/Math.PI));
    	matrix.b = Math.sin(MC._rotation/(180/Math.PI));
    	matrix.c = -Math.sin(MC._rotation/(180/Math.PI));
    	matrix.d = Math.cos(MC._rotation/(180/Math.PI));
    	fadebmp.draw(MC,matrix);
    }
    I was wondering if there was a way to "group" for example every bullet movieclip inside another movieclip/layer/whatever so I could draw them all at once, much like what happens when you draw _root...

    Code:
    fadebmp.draw(_root)
    Only then not only bullets appear, but the character and UI.

    I was thinking maybe I could use "attachMovieClip" instead of "duplicateMovieClip" to stick them to another MC, but I have code inside the MC I'm duplicating, anything I can do to like copy the code of a MC inside another one ?

    Or simply "attach" existing MC to a container of some kind ?

    Thx alot

  2. #2
    Junior Member
    Join Date
    Mar 2008
    Posts
    23
    Just a simple bump...

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