This content has been marked as final. Show 17 replies
you're loading the swf into a child movieclip of MC?
To give you an example, I have a MC with a picture frame. I want to load an SWF that contains a photo and I want to resize either the picture frame or the photo so that they match size. Therefore, to answer your question, I'm loading the SWF directly into the MC.
that didn't answer my question.
i understand you have a movieclip (with instance name, say MC) that contains a picture frame (either a shape or object).
is MC the target of your loadMovie() or loadClip() statement or is a child movieclip of MC, for example MC.targetMC, the target of your loadMovie() or loadClip() statement.
if you don't understand what you're doing, you can post your load code and specify the location of your frame.
Here is the code:
so, the "frame" is in _root.pict, correct?
if so, you should make it a movieclip (with instance name, say frame_mc) with upper left registration point, position it (or position container) so the frame is offset to the left and over container and assign its (target_mc._parent.frame_mc) _width and _height to be the target_mc's _width and _height + 2*the respective offset.
I tried it but it doesn't seem to work. Maybe I didn't quite understand what you said. I still didn't add the offset, I just wanted to see if it more or less worked, but unfortunately, the SWF file becomes HUGE, much more than the frame. Could you provide a sample code? Here's my code:
you didn't try anything close to what i suggested.
make sure you convert your frame to a movieclip and give it instance name frame_mc inside _root.pict. you can then try:
mcListener.onLoadInit = function(target_mc:MovieClip)
target_mc._parent.frame_mc = target_mc._width;
target_mc._parent.frame_mc = target_mc._height
I did exactly as you said (I think), but the inner MC is still scaling too much with respect to the frame MC that contains it. Here is the code once again:
what's "the inner MC"? is that the _root.pict.container? if so, it will resize based on whatever you load into it.
and there's no code scaling anything other than the frame_mc, that i've suggested.
That's where I get confused. How would you go about rescaling a SWF that you load inside a MC?
you scale the target movieclip, AFTER loading is complete and the target is initialized (ie, in your onLoadInit() method ), to scale the swf.
Thant's what I did as you can see from the code I attached, but it's not working...
you're confused and lack some basic understanding.
let's try this again.
what do you want to scale? the loaded swf to fit the frame you have or the frame to fit the loaded swf? or both to do something else?
To make things simple, I'd like to take an existing SWF (the picture) and load it into a FIXED SIZED MC (the frame) and I'd like to rescale the SWF so that it fits perfectly into the frame.
By all means, I know that what you said should work and I admit my inexperience with AS2, but somehow the SWF's I'm loading in, have scales that are totally different with respect to my Stage. I even tried loading the SWF directly onto the stage and then I loaded the frame separately onto the stage and tried to resize it to the SWF's _width and _height. The frame became a tiny dot on the screen, while the SWF filled half of my Stage.
Thanks again for your help.
you're not going to load the swf into a FIXED SIZED MC because that's not going to work.
create a movieclip on your main timeline and give it an instance name of frame. it will contain two child movieclips.
one of the child movieclips is your frame. give it instance name frame_mc. make sure it has registration point at its upper left and position it and size it just the way you want within frame.
the other movieclip will be an empty movieclip named target_mc that you'll position exactly where you want the upper left of your swf to appear. ie, that will be to the right and below the upper left of the frameMC.
Unfortunately, it didn't work. I think it's somehow linked to the SWF's inner scaling to which I have no access. I opted for the good ol' getURL and opened the picture up in a new window. Thanks for all your help!