views:

495

answers:

3

I have a flash program that loads movie clips dynamically and sometimes they want to use more than the space that I give them. Ideally I'd like to force them to only show content in borders I give them. The reason I want this is that my program has a user interface that sometimes gets covered up by this behavior. I'd like to avoid rewriting my program to have these loaded movies be on the first level but that's looking like my only option. Any suggestions?

A: 

You can put your movie in a DIV with a style of overflow:hidden, but be sure to add "wmode=transparent" to your movie embedding to keep it from popping on top of your HTML.

Diodeus
My interface is in Flash as well but that is a good suggestion to avoid the HTML getting covered.
Jon
Flash won't ever expand out of the "box" it is embedded in (in html) so this isn't really an issue.
grapefrukt
+4  A: 

Have a look at the scrollRect property in MovieClip

Iain
A: 

Could you dynamically resize the MovieClips once they are loaded?

Maybe something like this:

private function onClipLoaded(clipRef:MovieClip) {
    if (clipRef.width > myViewArea.width) {
        var scaleRatio:Number = myViewArea.width / clipRef.width;
        with (clipRef) {
            scaleX = scaleRatio;
            scaleY = scaleRatio;
        }
    }
}
defmeta