A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Fill half the stage

  1. #1
    Member
    Join Date
    Oct 2007
    Posts
    76

    Fill half the stage

    I'm trying to fill half the stageheight with a single color and I can get it work in flash when I preview it, but when I check it in the browser it doesn't work.

    PHP Code:
    square = new Sprite();
    square.graphics.beginFill(0xCCFF00);
    square.graphics.drawRect(00stage.stageWidthstage.stageHeight/2);
    addChild(square); 

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Put an endFill in there and see if that helps.

  3. #3
    Member
    Join Date
    Oct 2007
    Posts
    76
    Oops, I accidently left that out on my post. It will fill up half the stage when its first loaded and if you make the stage larger, but if you make the stage smaller it won't resize. Or maybe it is resizing but its just not erasing the previous fill.

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If this is being called repeatedly, you'll probably want to call graphics.clear before beginFill.

    Is this an event listener for RESIZE?

  5. #5
    Member
    Join Date
    Oct 2007
    Posts
    76
    yeah clearing it worked, thanks!

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