kruza
November 24, 2002, 3:45am
1
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
system
November 24, 2002, 10:51am
2
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
system
November 26, 2002, 1:22am
3
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?
system
November 26, 2002, 1:25am
4
“specific” sized container
Well, other than your image size, Try _xscale and _yscale, be aware, this will scale your images by percents.
system
November 26, 2002, 2:35am
5
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
system
November 26, 2002, 2:39am
6
Okay, here:
container._width = 100
container._height = 100
Tell me how it goes!
yours,
h88
system
November 26, 2002, 2:49am
7
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 …
system
November 26, 2002, 2:51am
8
Can u zip up all your folder :q:Fla, images, etc. and attach it here?
system
November 26, 2002, 2:56am
9
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…
system
November 26, 2002, 3:03am
10
Okay, check the fla, and tell me how it goes, works fine here:
system
November 26, 2002, 3:24am
12
ok for some reason
_width & _height don’t work…but yscale & xscale do work…
system
November 26, 2002, 3:26am
13
Hmm, then ur reporting success, or u want it using _height and _width :q:
system
November 26, 2002, 3:31am
14
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 ?