[FMX] Loading a .swf into a square container from a button thats within a movie

I would like to know how to load a .swf into a square container
from a button thats within a movie (button on a sliding menu)

Could someone please post the scripting needed for the button + any others…
let the container be named “container1” & .swf to be named “sunny.swf”

thanks

Check this tutorial:

http://www.kirupa.com/developer/mx/loading.asp

and about the button script, add this code into ur _root (main) timeline:

myButton.onRelease = function(){
//Insert the script from the tutorial here
}

Yoiurs,
h88

ok i worked it out and now i have the .SWF loaded but i would like it to load into a “specific” sized container.
How to i define this in the code for the conatiner?

“specific” sized container

Well, other than your image size, Try _xscale and _yscale, be aware, this will scale your images by percents.

so i can’t determine the actual size of the .SWF when loaded?

because eventually i would like to load some projects of mine into a .SWF gallery much like a photo gallery

Okay, here:

container._width = 100
container._height = 100

Tell me how it goes!

yours,
h88

i thought it was something like that…

but i inserted that code and no go…

when i click the button it doesn’t edit| LOAD …

Can u zip up all your folder :q:Fla, images, etc. and attach it here?

i can’t upload at the moment…but i will do later…

for the moment this is what i have in frame 1 scene 1

[COLOR=blue]MyButton.onPress = function () {
_root.createEmptyMovieClip(“container”, 1);
loadMovie(“sunnyvale.swf”, “container”);
container._width = 402 ;
container._height = 402 ;
container._x = 507 ;
container._y = 11 ;[/COLOR]

and obviously a button called “MyButton” on one of the other frames…

Okay, check the fla, and tell me how it goes, works fine here: :slight_smile:

sorry, attachment:

ok for some reason

_width & _height don’t work…but yscale & xscale do work…

Hmm, then ur reporting success, or u want it using _height and _width :q:

yeh i want the _width & _height setup…

otherwise it works with x&yscale…but not to the desired effect…

maybe i will have to try something different ?