Skip to main content
July 24, 2008
Answered

How do I stop objects that are not on the stage appearing in a browser?

  • July 24, 2008
  • 2 replies
  • 617 views
I have scrolling text in my ActionScript 3.0 code and this involves the complete text scrolling in from outside the viewable stage area onto the stage and then off it again.

However, when I view this in a web browser anything that is outside the stage is also displayed?! How do I stop the browser from displaying the objects outside of the stage and only display the objects when they are on stage?

Thanks very much.

Rhys
This topic has been closed for replies.
Correct answer robdillon
quote:

Change your width and height settings from percentage to actual numbers. Right now the background is being stretched to 100% width and height


i have tried this but it won't let me align the flash project in the center of the browser this way?

How would I then align the flash project in the center?

Thanks

If you just want left - right centering, then just wrap the Flash content in a <div> tag and and set the alignment to centered.

2 replies

robdillon
Participating Frequently
July 24, 2008
Can you share this with us? If you have properly published your movie, you should only see the image area that is inside the bounds of the stage.
July 26, 2008
The complete code and relevant media is in the .zip file at this location:

http://www.megaupload.com/?d=W94KFV1O

The yellow text when a menu item is highlighted appears outside the stage.

Loading the published .html file will reveal what I mean.

Thanks very much for your time and help.

Rhys
robdillon
Participating Frequently
July 26, 2008
Change your width and height settings from percentage to actual numbers. Right now the background is being stretched to 100% width and height. Set these values to pixel dimensions in the HTML settings of the Publish settings window and the text will work as expected.
July 24, 2008
Maybe add a mask over your movie clip.

This code is not tested, but something like this -->

var maskClip:MovieClip=new MovieClip();
maskClip.graphics.beginFill(0x000000,1);
maskClip.graphics.drawRect(0,0,(stage width),(stage height));
maskClip.endfill();
(Clip to Mask).mask=maskClip;