2 Replies Latest reply on Nov 17, 2006 12:29 PM by RemyR

    loadMovie (swf) scaling problem...

    RemyR
      I have a movieClip for loading external pictures or SWF files that's works just fine - unless the loaded SWF has an object that is located or moves off the stage (it's original stage - the one the loaded SWF was published with). The movieClip rescales the SWF to keep the object in view. For example, if a line of text starts off-stage left and is tweened to off-stage right, the movieClip will zoom in, then out, to keep it displayed.
      While this may one day be a nifty effect to play with, it's not what I intended.
      I've tried using this in the loaded SWF:
      Stage.scaleMode = "noScale";
      and this in the loading movie:
      myMovieClip._lockRoot = true;
      Thinking this would prevent the loaded SWF from scaling (and to make sure the loading movie didn't think I was telling *it* to stop scaling...), but that didn't work. I tried to rework the loaded SWF so that nothing actually left the stage, but the effect doesn't work with text or bitmap images (they skew) and the animation gets a bit jumpy. I'd like to avoid converting it to an animated GIF or movie, since GIFs don't animate and I'm concerned about file size (and I'd like to able to allow for SWFs that may do things those simply can't do).
      I'd also like to keep it a movieClip, since I want it to be able to still accept images.
      I'm pretty sure there's an easy answer to this - maybe I just screwed up with my placement of the code above (in the loaded SWF, it's the first line of actionscript to run; Scene 1, frame 1 -- in the movieClip movie, it's the line right after the movieClip is created with createEmptyMovieClip and right before the SWF is passed to it).

      So, is there a way to prevent a movieClip from resizing a loaded SWF that contains elements off-stage?
        • 1. Re: loadMovie (swf) scaling problem...
          .:}x-=V!P=-x{:. Level 3
          mask off your stage
          • 2. Re: loadMovie (swf) scaling problem...
            RemyR Level 1
            Okay, first, let me say, I completely forgot to move the loading movieClip's registration mark to the top-left corner; when I did that, it stopped the wierd scaling when the objects were off-stage top and left.
            I then tried masking as you suggested, and it did work, sort of - the area where the mask covered the right and bottom still showed, at least the mask did (which surrounded, but was not on, the stage). The result was a little version of the loaded SWF, surrounded by a border right-and-bottom.
            That's when I realized that flash ignores the stage completely with loaded SWFs. Yeah, I know, I should have got that when I had to replace the background color with a rectangle on a bottom layer.
            It then struck me exactly what I did wrong - the function that resizes the SWF to match the loading movieClip's size was still looping (all it did was check to make sure the loaded SWF was completely downloaded, then size it), and when things went off stage, they were taken into account everytime. I setup a flag that indicates whether or not an image or SWF has been loaded and sized. That fixed it.
            That's what I get for writing actionscript at 3 in the morning.
            I'm not sure if this will still work for symbols that start off-stage right or bottom (the registration mark prevents them from showing left and top regardless of the resizing). A single starting blank frame should fix that, though.
            Thanks for your help - I was ready to give up and stick with static images.