|
-
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!
-
Senior Member
Get rid of the items off stage, or set them to invisible. Or use a setMask filter.
-
I can't really set them to invisible because they are used in the movies. They are brought in at some point.
-
Senior Member
Okay, can't you just set them to visible when they come in?
-
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.
-
Senior Member
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);
-
Hmm doesn't seem to work with externally loaded swfs.
-
Senior Member
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?
-
Musical chair
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|