A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: loaded swf - offstage items showing

  1. #1
    Member
    Join Date
    May 2006
    Posts
    70

    Question loaded swf - offstage items showing

    I have some external swf's that I am loading in, but when they are loaded in, I can see things that are "off stage" in the loaded swf.

    Anyone know of any solutions to this?

    Thanks!

  2. #2
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Get rid of the items off stage, or set them to invisible. Or use a setMask filter.

  3. #3
    Member
    Join Date
    May 2006
    Posts
    70
    I can't really set them to invisible because they are used in the movies. They are brought in at some point.

  4. #4
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    Okay, can't you just set them to visible when they come in?

  5. #5
    Member
    Join Date
    May 2006
    Posts
    70
    Not really, because the way they are set up. I just need to figure out a way to either not show what is offstage in the loaded swfs, or a way to mask them out.

    By the way I don't think setmask is still used in as3. I gave it a try, but didn't seem to work.

  6. #6
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    My mistake, it's mask, not setmask. Anyway, here's a code snippet from the help file. Try it and see if it helps.

    import flash.display.Shape;

    // Draw a square and add it to the display list.
    var square:Shape = new Shape();
    square.graphics.lineStyle(1, 0x000000);
    square.graphics.beginFill(0xff0000);
    square.graphics.drawRect(0, 0, 100, 100);
    square.graphics.endFill();
    this.addChild(square);

    // Draw a circle and add it to the display list.
    var circle:Sprite = new Sprite();
    circle.graphics.lineStyle(1, 0x000000);
    circle.graphics.beginFill(0x0000ff);
    circle.graphics.drawCircle(25, 25, 25);
    circle.graphics.endFill();
    this.addChild(circle);

    function maskSquare(event:MouseEvent):void
    {
    square.mask = circle;
    circle.removeEventListener(MouseEvent.CLICK, maskSquare);
    }

    circle.addEventListener(MouseEvent.CLICK, maskSquare);

  7. #7
    Member
    Join Date
    May 2006
    Posts
    70
    Hmm doesn't seem to work with externally loaded swfs.

  8. #8
    Senior Member jweeks123's Avatar
    Join Date
    Mar 2006
    Posts
    1,124
    hmm...How are you loading the swfs? Could you try loading them at a different level, say you load it then you say something like:

    stage.addChild(swf1);
    stage.swapChildren(swf1,cover1);

    Where as your cover is a concealer?

  9. #9
    Musical chair sumwungye's Avatar
    Join Date
    Jan 2008
    Location
    Planet Earth, third planet from the Sun
    Posts
    287
    Why don't you just try putting a rectangle that covers basically everything, from top to bottom and left to right, zoomed out all the way, of course, and cut a hole out for the stage?
    --SumWunGye

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