Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Resize LoadMovie Container, Not LoadMovie?



I've searched and searched but haven't found what I'm looking for.

I'm wanting to load different sized .swf into the same field and I want the field to adjust (preferably some smooth transitions for the size change) to fit the size of each different .swf loaded. I've seen it done on quite a few sites but I haven't been able to find a tutorial of any kind addressing this specifically. Can anyone help?

I'm keeping it simple, i.e. thumbnails with titles above or off to the side; click one; the field where the .swf will play adjusts itself; .swf loads and plays. When completed, user can click another thumbnail and the previous .swf will "unload" then the field adjusts for the new .swf and the new one loads. Follow me? Just any tutorial you guys may know of would be great.

Here's the closest example I could find... cool site too. http://www.pollenation.org



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 05-05-2004, 08:54 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

LoadMovie Container In Different MC?
Hi,

I am using the loadMovie function using the following code:


Code:
on (release) {
this.shirts_blank.loadMovie("shirts/solid_ss_green.swf");
}
however, the shirts_blank container is located inside a different movieclip on the stage. The hierarchy of the MC's in my movie are as follows:

Scene 1 > steps_mc > colour_selector

The button using the above code is located in the colour_selector MC but the shirts_blank MC is located in the steps_mc which is in the level above.

I know I have done this before, but i can not figure out how to modify the code to get the above script to load the swf in the shirts_blank container in the steps_mc?

I hope this all makes sense as i am staring to confuse myself??

Can anyone help?

thanks

Steve

LoadMovie() In Container
Hello...

I am all new to flash and wanted to try out some xml gallery stuff.
I have succeeded in getting the image-url from the xml file into an array called urls[]

Then I attach a movieclip for each picture called container where I want the images to be loaded into. But that fails. Can anybody tell me why?


Code:
var x:XML = new XML();
x.ignoreWhite = true;

var urls:Array = new Array();
var movie:Array = new Array();

var xPos = 150;
var yPos = 60;

x.onLoad = function() {
var photos:Array = this.firstChild.childNodes;
for(i=0;i<photos.length;i++) {
attachMovie("container", "new"+i, i, {_x:xPos, _y:yPos});
//increase the y and x postion each time
yPos += this["new"+i]._height+5;
xPos += this["new"+i]._width+5;

urls.push(photos[i].attributes.url);
this["new"+i].loadMovie(urls[i]);
}
}

x.load("portfolio.xml");

Sizing Container MC's When Using LoadMovie()
Hi all,

I am trying to load an external swf into a container MC in my main swf. I am loading the external MC in a container MC called "host".

My problem is I cannot get the external clip to show up properly. I know it is loaded because I hear the sounds.

I have tried making my host MC the same _width and _height as my external file; however, when I load the clip I don't know where it is?????????

any thoughts?

thanx in advance,

LoadMovie Into Container Or Into Level?
Can anyone explain why when I load my movie into a container_mc it never actually plays correctly, but when I load it just into a level it plays fine? Is there anyway around this? Loading my movie into a level works okay but it makes the movie more difficult to work with and seems like a weaker way of doing it.
Thanks

Loadmovie Into Container Question?
Hi there,

Thanks for looking at my post.

I have loaded an external swf into a container within my main movie and it works fine however I need a button in the loaded external swf that wil load and replace itself with a new external swf.

each time I try I end up loading the external swf to replace my main movie.


Cheers
Craig

Setting A Container To LoadMovie
I have tried creating a swf file with a button at bottom. Then created a shape 400px by 250px then converted to movieclip. I placed the movie clip on the scene at top with instance "container".

Now i created a seperate swf file with a scene size the same as the movie clip. made a short animation and exported.

Back to my first swf file i added to the button:

on (release) {
container.loadMovie("test2.swf");
}

Now that seems to work when i click the button, but it isnt loading it in the same place as the container instance??? why? its off to the right somewhere.

help please...

LoadMovie Not Loading Into Container?
Hey guys, hope everyone is doing great!

Quick question: I have to mc's on the stage, and each of them loads an external movieclip into it.

The thing is, when I simulate a download (by pressing cntrl+enter twice) the clips arent loading. I put them online as well, and it seems as if they publish fine locally, but not online??

If anyone can have a look, I will really appreciate it!

Thanks again...

(PS: Im attaching the files, they are really simple, if anyone wants to take a look...)

Big Problem With Level, LoadMovie, Container
Hi,
I have 3 swf :

main.swf
menu.swf
data.swf

The main.swf contains menu.swf and data.swf.
In the main.swf :
loadMovieNum("data.swf", 4);
container.loadMovie("menu.swf", 11);

The data.swf is always over the menu.swf and I don't understand why?

I tried with 2 containers and 2 loadMovieNum but it doesn't work !!!

Any Idea

thanks

[F8] Complicated Loadmovie Container Issue
I'm new to this, I have a flash movie which I call interface.swf. which is basically layed out like this:

I can click on the buttons to load various flash movies into the movieclip named "moviecontainer" within the interface.swf. Everything works fine, I use the code:


PHP Code:




loadMovie("movies/100.swf", "/moviecontainer");







My problem arises when I try to load a movie which has actionscript referring to _root. For example, a movie I want to load has this:

PHP Code:




_root.onMouseDown = function ()






I figured I would have to do something like this to adapt the movie to the container:

PHP Code:




_root.moviecontainer.onMouseDown = function ()






but that doesn't work because its needs to be "/moviecontainer" not "moviecontainer"
Is there a way around this? Would I even be able to use mouse actions in a movie I loaded into another movieclip?
Any help would be much appreciated.

Problem With LoadMovie() Into A Container With Effect. Please Help
Hi,
I have seen some kind of a container effect made by bwh2. I'm trying to include a loadMovie() into this container. But it doesn't work.
Any help please?
Code for the container:

ActionScript Code:
onClipEvent(load){
        power=0; // off position to start
        speed=5; // speed of easing
        endW=50; // starting width
        endH=100; // starting height
}
onClipEvent(enterFrame){
        w = endW-this._width;
        this._width += w/speed;
        h = endH-this._height;
        this._height += h/speed;
}
And for the button to resize the container (and I want to include a loadMovie into and give the endW and endH):

ActionScript Code:
on(release){
        if(mc.power==0){ // if mc is "off"
                mc.endW=200;
                mc.endH=400;
                mc.power=1; // if it is pressed again, it will turn it "on"
        }
        else if(mc.power==1){ // if mc is "on"
                mc.endW=50;
                mc.endH=100;
                mc.power=0; // if it is pressed again, it will turn it "off"
        }
}

Button Issues With Loadmovie In Mc Container
I have a swf loading into a container movie clip. that swf has buttons, etc, but for some reason, the buttons in the main movie, beneath it, are still working, so that any navigation in the loaded swf doesnt work.

is there any way around this? like...onRelease (stop all _root button actions)

something like that...

Slideshow Not Playing When I Use The Loadmovie In Container
when i use Loadmovie in container my photo slideshow won't play but it play ok if i Loadmovie to Level can someone help me to make my slideshow play in a container.

thanks

LoadMovie Is Overlapping Other Movies To Be Played In It's Container
I have a set of mc buttons that load swf's into the main movie via an empty mc. If I click one and then another very quickly, they load on top of eachother and get stuck in a looping error. How do I control this?

Loadmovie Into A Container Specifing A Frame Label To Start
Hi,

After i look in kirupa foruns(and others) i found lots of information about how to load a movie into a container, making that the movie starts in a specific frame label. Most of them are vety different, i i would like to have you help to know the best way to do it.

I have 2 movies, the fist one "main.swf" contains the "container", the 2nd "teste.swf" contain the frames labeled like "F1", "F2" "F3" "F4" and "F5".

thanks to all

How To Resize MC When Loadmovie ?
Hi ,

How to resize MC when loadmovie .
The movie is loaded in _level2.

My code :

unloadMovieNum (2);
loadMovieNum ("ecran11.swf", 2);
if (max eq "non" or max eq non) {
_level1._visible = 1;
_level2._xscale = 100;
_level2._yscale = 100;
_level2._x = 0;
_level2._y = 0;
} else if (max eq "oui" or max eq oui) {
_level1._visible = 0;
_level2._xscale = 125;
_level2._yscale = 125;
_level2._x = -230;
_level2._y = -100;
}
stop ();

It work perfectly when it's running from a button action but
not when loading movie .
Can you help me ?

Thanks

Stephane )

How To Resize Loadmovie?
When I loadMovie how do I resize the movie to fit into a specific size and how do I position the Loaded movie to the centre of the screen?

Please show me th code too as I am very new to actionscript.

Thank you!!

LoadMovie Without Resize
Hi there! Hope you can help me!

I have a container.swf which is 500*250.
I want to load a clip.swf (400*100) into container.swf and center
it on the main stage.
Everytime the clip.swf is loaded container.swf shrinks to 400*100.

How do I prevent the container from doing so?
Is it important on which level I load the clips?
Do frame rates affect eachother if they differ?

Loadmovie Resize Swf
hi there, I read through all the posting related to loadmovie resize but doesn't seem like I find the answer, so here is my question for you guys:

I try to load an external swf in my flash program. The effect I want to accomplish is to fit the external swf into my movie clip container with auto resize. Say, my movie clip container has width=200 and height=100. Now, if the external swf has width=200 and height=200, after the loadmovie, I want to see the external swf fits into the movie clip container with width=100 and height=100 (resize with ratio preserved according to the container's max width or height).

I can't use xscale or yscale to pre-adjust the external swf because I don't know the dimension of the swfs until load time. I tried to set _width and _height of the movie clip to my container's dimension after the movieload statement, but the swf doesn't even show up. I trace it, and those two numbers always show up zero. I am using Flash MX Professional 2004. Am I doing something wrong here? Please help

Loadmovie Resize Swf
hi there, I read through all the posting related to loadmovie resize but doesn't seem like I find the answer, so here is my question for you guys:

I try to load an external swf in my flash program. The effect I want to accomplish is to fit the external swf into my movie clip container with auto resize. Say, my movie clip container has width=200 and height=100. Now, if the external swf has width=200 and height=200, after the loadmovie, I want to see the external swf fits into the movie clip container with width=100 and height=100 (resize with ratio preserved according to the container's max width or height).

I can't use xscale or yscale to pre-adjust the external swf because I don't know the dimension of the swfs until load time. I tried to set _width and _height of the movie clip to my container's dimension after the movieload statement, but the swf doesn't even show up. I trace it, and those two numbers always show up zero. I am using Flash MX Professional 2004. Am I doing something wrong here? Please help

Loadmovie Resize Swf
hi there, I read through all the posting related to loadmovie resize but doesn't seem like I find the answer, so here is my question for you guys:

I try to load an external swf in my flash program. The effect I want to accomplish is to fit the external swf into my movie clip container with auto resize. Say, my movie clip container has width=200 and height=100. Now, if the external swf has width=200 and height=200, after the loadmovie, I want to see the external swf fits into the movie clip container with width=100 and height=100 (resize with ratio preserved according to the container's max width or height).

I can't use xscale or yscale to pre-adjust the external swf because I don't know the dimension of the swfs until load time. I tried to set _width and _height of the movie clip to my container's dimension after the movieload statement, but the swf doesn't even show up. I trace it, and those two numbers always show up zero. I am using Flash MX Professional 2004. Am I doing something wrong here? Please help

LoadMovie And Resize
I have this action

_root.container.loadMovie("picture.jpg");

what should I do in flash to resize the picture.jpg if it is bigger than 300x300 (this is the dimmension I want)

Resize A Loadmovie Swf
I need to resize a swf that is being called (loadmovie) into a stage. Can I set the size of a called .swf file with actionscript? I know how to use the FS command for the stage Flash. But the called swf does not go full size when I do that.
Know what I mean?
J

Resize With LoadMovie
I have a button that is a thumbnail. When I click on it, I want it to load the full size swf into it, basically resizing what was the thumbnail button. Can anyone help me with this?

Thanks.

Resize With LoadMovie
I have a button that is a thumbnail. When I click on it, I want it to load the full size swf into it, basically resizing what was the thumbnail button. Can anyone help me with this?

Thanks.

LoadMovie, Image, Resize
hello folks,

here's what I want to do. Load in an image, then, once it's loaded resize it to a certain width and height in case it exceeds the maximum size.

I did the obvious, load in the image, then in the next frame :

if(imageholder._width > 328){
imageholder._width = 328
}
if(imageholder._height > 328){
imageholder._height = 328
}

nothing happens, when I trace those two values, they come out as zero, does the image have yet another instance I know nothing about and cannot influence, I DON'T think so. So that's it. I need YOUR help to move on in this Flash Remoting project of mine...

V

Can LoadMovie Resize An External .swf ?
I'm trying to control the size of an external .swf (make it bigger) and instead I feel like I'm just making up my own syntax. This doesn't work, but I don't know how to make it work ... or, even if it's possible?

The clip it's loading into is empty, BTW, and it's 1280 X 1024.


onClipEvent(load) {
loadMovie("Dec_5.swf",1);
Dec_5._width = 1280
Dec_5._height = 1024
}


Can it be done? I can't resize Dec_5.swf without breaking about a thousand things reliant on the x and y scripts ...

Thanks for any imput.

Eileen

Resize Images In LoadMovie
I'm using Flash CS3 and i'm trying to make a banner using ActionScript 2.0 and the end player should be readable by flashplayer8.

What i've done so far is import dynamic images inte my banner, so depending on a php file different pictures will show in the banner. My problem is that these images are bigger than i want them to be.
I need to downscale them to fit exactly 95px wide and 80px high.

I've defined these mesures in the mobile clip but they still show up to big.

Can anyone help? here is my code:


PHP Code:




images = new LoadVars();
images.sendAndLoad("flash_read.php", images, "GET");
images.onLoad = load_image;

function load_image() {
    bild01.loadMovie(this.image1);
    bild02.loadMovie(this.image2);
    bild03.loadMovie(this.image3);
    bild04.loadMovie(this.image4);
    bild05.loadMovie(this.image4);
    bild06.loadMovie(this.image5);
}

Resize The Pic Loaded By LoadMovie();
I use loadMovie(); to load a picture, which is from the same directory as the SWF file. and I'm puzzled by how to resize the pic.
AS there.


ActionScript Code:
// in the frame.
// pic_1 is the instance name of an mc.
loadMovie("pic_1.jpg", pic_1);

Any help will do.

Resize LoadMovie Field, Not .swf?
I've searched and searched but haven't found what I'm looking for.

I'm wanting to load different sized .swf into the same field and I want the field to adjust (preferably some smooth transitions for the size change) to fit the size of each different .swf loaded. I've seen it done on quite a few sites but I haven't been able to find a tutorial of any kind addressing this specifically. Can anyone help?

I'm keeping it simple, i.e. thumbnails with titles above or off to the side; click one; the field where the .swf will play adjusts itself; .swf loads and plays. When completed, user can click another thumbnail and the previous .swf will "unload" then the field adjusts for the new .swf and the new one loads. Follow me? Just any tutorial you guys may know of would be great.

Here's the closest example I could find... cool site too. http://www.pollenation.org

LoadMovie Resize Issue...
Hey, I have a flash which load's a still image using loadMovie, it worked fine until today.

Suddenly it decided to start resizing images for no apparent reason.

the actionscript is : _root.pImg.loadMovie(xml.firstChild.childNodes.att ributes.img);

the image size is 320x240, and the pImg movieclip is 320x240. any idea's as to why it would resize and how to stop it ?

Resize LoadMovie Field, Not .swf?
I've searched and searched but haven't found what I'm looking for.

I'm wanting to load different sized .swf into the same field and I want the field to adjust (preferably some smooth transitions for the size change) to fit the size of each different .swf loaded. I've seen it done on quite a few sites but I haven't been able to find a tutorial of any kind addressing this specifically. Can anyone help?

I'm keeping it simple, i.e. thumbnails with titles above or off to the side; click one; the field where the .swf will play adjusts itself; .swf loads and plays. When completed, user can click another thumbnail and the previous .swf will "unload" then the field adjusts for the new .swf and the new one loads. Follow me? Just any tutorial you guys may know of would be great.

Here's the closest example I could find... cool site too. http://www.pollenation.org

How Can I Resize An External Swf Via Loadmovie
help

i am loading a swf into a mc like this, but i need to resize the dee.swf
is it possible and how??

thanks


on (release) {
loadMovie("dee.swf", "blankhost");
}

Cant Resize Movie Cli With Loadmovie?
Hi , Iv got a problem with loading an external swf file into my main project. I created a movieclip called 'Anime', placed it ont he stage and then i use the command:

Anime.loadMovie("NMS_Show1.swf");

i can re-position the clip using the commands:

Anime._x = 360;
Anime._y = 200;

but when i try to resize it, with the ffg code it doesnt work!!!

Anime._width /= 1.5;
Anime._height /= 1.5;

Iv tried placing the code in the 'onclipevent' and iv still got no luck!!!

I would appreciate any insights/help around this guys..


Cheers.

Help Needed On LoadMovie And Resize Image
I find that when using LoadMovie function in FLASH MX, it can not automatically fit the loaded jpeg into movieclip's size. I need to find a way to use action script to process these jpegs with different size to fit into the movieclip before using LoadMovie function. Can anyone help me with some ideas? Or LoadMovie function can do that?

Can't Resize Images Loaded Via LoadMovie()
How do I resize an image loaded using loadMovie()?

I have the following code:


Code:
this.createEmptyMovieClip("holder", 1);
holder.createEmptyMovieClip("img",1);
holder.img.loadMovie("images/311003/1.jpg");
holder.img.onEnterFrame=function(){
if (this.getBytesLoaded() == this.getBytesTotal()) {
this._x = 100;
this._y = 100;
this._visible = false;
trace (this._visible);
// this._width = 50;
delete this.onEnterFrame;
}
}
Here I have a container MovieClip called holder. Inside I have another MovieClip called img, which I load an image into.

The code above will move the image to the proper x/y location. That works.

The visibile property doesn't work. According to the trace (this._visible) function, the property is setting to false correctly; but the image is visible. If I set the holder movieClip to _visible=false, the image will indeed become invisible. So I found a work-around for that.

But if I uncomment the // this._width = 50 line, the image disappears completely. Resizing the holder movieClip doesn't help.

Any help would be greatly, greatly appreciated. I'm ready to throw my computer out the window.

Best,

Jason

Resize Stage Bigger To Fit LoadMovie?
Hi,

I have a file called "index.swf" which has dimension 800(w) x 600(h). It has a navigation bar and also an empty clip (contentclip) that has size 800 x 500. In dreamweaver I have defined the dimension of index.swf as its default dimension 800 x 600. It works fine when I try to load small clips into contentclip such as 800 x 400. But I have one clip that is of size 800 x 1000, which even exceeds the size of the whole flash file defined in the javascript code on index.html . Is there anyway to extend index.swf's dimension to 800 x 1000, without sizing the components inside it so I can load the big clip in its original dimension? I am sorry if this sound confusing...

Would really appreciate a solution! thanks :)

Simple "LoadMovie Into Container" Question...
Hey guys, hope everyone is doing well...
This is really simple to answer, I'm sure, I just can't find any quick and easy answers for this. Also, Im not sure about the terminology...

I have a main flash movie, with a square mc called "container" 150px x 150px

When this loads, i just want another external .swf file (the same dimensions, called "block") to load into "container" mc, without the need to click on a button first...

Thats it...nothing else fancy...

This is the code I have on "container" :


Code:
onClipEvent (load) {
container.loadMovie("block.swf");
}
Can anyone help?

How To Loadmovie The Place Iwant? I Have Loadmovie But It Just Take All The Screen
i load a swf and it just take all the space
and my buttoms and others are all been covered
here is how i do it

onClipEvent (enterFrame) {
ifFrameLoaded (1) {
loadMovieNum ("first.swf", 0);
}
}


i put this in the layer called middle where i have put a instance of a w700 h270 movieclip so i can try to loadmovie the same size of it but it just failed
did i miss anything else? i know i did
please tell me~~~~~~~~~~~~~~~~~~~~~

Container.loadMovie ("image"+_root.variable+".swf") Doesn't Work, Help
what i'm trying to do is dynamically load a movie based on the name of a variable called "whichPic". the swf calling for the movie is nested inside another movie that has loaded it. the variable is defined in the _root movie. for whatever reason i can't get this to work. here is what i have right now:

container.loadMovie("image"+_root.whichPic+".swf") ;

it keeps trying to load a movie called "image.swf" instead of "image1.swf" or "image2.swf", etc. the variable is there but i just can't access it for some reason. i assume i'm just writing the actionscrpt incorrectly, nesting movies always throws me for a loop. thanks!

LoadMovie Target Vs. LoadMovie Level
can someone please explain to me why when I load an external movie as a target, the action scripting in the loadedmovie doesn't work.
But if i load the movie into a level it works fine. I want to load into a target beacuse I want it positioned in a specific co-ordinate.

thanks

LoadMovie Calling MC With LoadMovie Problem
I am loading a movie clip into a target MC on my timeline and it works fine, but the movie clip that I'm loading in is also using loadMovie to load a movie into a MC on it's own timeline. For some reason, the MC that is getting loaded doesn't load the MC it is calling on it's own timeline. It works fine when I test it out on it's own, but as soon as I load it in using the first MC, the loaded MC doesn't call the movie clip it's supposed to load.

Any suggestions?

-k

(I said "load" way too many times!)

LoadMovie/loadMovie From Loaded Movie?
I know I know .. messed up heading .. but ..

I have a button that loads a swf into an empty mc (sliderContainerMC)

(release) {
_root.sliderContainerMC.loadMovie("http://www.justinsteiger.com/flash/anims/sliderOpen.swf");
}

That works as advertised. The difficulty comes when I tell the button on that swf to load a new swf into the same MC (sliderClose.swf). Since the swf in the MC (sliderOpen.swf) isn't the same swf (loading into a MC in justinsflashsite.swf) do I need to change the path? Say to include something telling it to load the swf into the parent swf?

Eventually the swf that's called into the empty MC is going to have buttons that are supposed to call up other swf's that load in other empty MC's around the site. HELP?!

Thanks,
Justin
http://www.justinsteiger.com/flash/justinsflashsite.fla (Is the parent swf)

Loadmovie Inside Loadmovie Problem?
Hi,

I have a main movie which use's the loadmovie function to load up an external SWF. But then inside that SWF there is another loadmovie function to load another external SWF into that.

But the problem is that when the first movie is loaded all of its loadmovie commands are disabled.

Is there something i could do to rectify this?

Thanks,
T

Local Loadmovie Ok / Online Loadmovie Bad
I'm at my wit's end with this one. I have an swf that's loading fine locally but refuses to be loaded online. Here's the script. It's in the first frame of the root mc ....
code:
_root.createEmptyMovieClip("slideshow", this.getNextHighestDepth());
_root.slideshow.createEmptyMovieClip("container_mc ", 0);
slideshow_btn.onRelease = function() {
this._visible = 0;
this.gotoAndStop(1);
_root.slideshow.container_mc.loadMovie("temp.swf") ;
};


Loads no problem locally. Nothing when I upload it. I have lockroot set to true in the same frame as the above script. I also tried a simple test with ....
code:
_root.slideshow.loadMovie("temp.swf");

.... in a simple mc containing only a 'slideshow' mc. Works if I access the URL directly, doesn't if I put it in an html page. What mistake could I be making?

thanks
mark

[F8] Need To Change A Variable In A LoadMovie Mc While In Another LoadMovie Mc
So I have a shell mc that has 2 mc's loaded into it with loadMovie (let's call them project1 and project2). While I'm in project1...how do I change a variable in project2 to be true instead of false?

I thought I could do it like this (in Project1...):
myBtn.onPress = function()
{
_parent.dropZone_project2.myVar = false;
}

Nothing seems to be working. Any insight would be greatly appreciated.

Loadmovie Over Prev Loadmovie And Positioning Jpg
Hello, a little question and i have the feeling i am very close.

i use loadmovie to load an image into an movieclip.
that movieclip goes to the position x and y of the movieclip - the loaded image width/2

my problem is that when i load a new image the position is not correct.

my code:
--------------------------------------------------------------------------------------------------------------------
function nextImage1()
{
if (p < total - 1)
{
++p;
if (loaded == filesize)
{
trace(p);
trace("x van inst0"+litlimg_instance.ltlimgmc_instance0._x);
trace("y van inst0"+litlimg_instance.ltlimgmc_instance0._y);
litlimg_instance.ltlimgmc_instance0._alpha = 0;
litlimg_instance.ltlimgmc_instance0.holder.loadMovie(image[p], 1);

var maxWidth = 250;
var maxHeight = 200;

var myWidth = litlimg_instance.ltlimgmc_instance0._width;
var myHeight = litlimg_instance.ltlimgmc_instance0._height;
// Calculate percentage by which image will need to change to fit
if (myWidth > maxWidth){
var xscalePercent = (myWidth*100)/maxWidth;
}
if (myHeight > maxHeight){
var yscalePercent = (myHeight*100)/maxHeight;
}
// Multiply both height and width by the bigger percentage
if (xscalePercent>yscalePercent) {
litlimg_instance.ltlimgmc_instance0._width /= (xscalePercent/100);
litlimg_instance.ltlimgmc_instance0._height /= (xscalePercent/100);
} else {
litlimg_instance.ltlimgmc_instance0._width /= (yscalePercent/100);
litlimg_instance.ltlimgmc_instance0._height /= (yscalePercent/100);
}
var test=litlimg_instance._x-(litlimg_instance.ltlimgmc_instance0._width/2);
trace("width img:"+litlimg_instance.ltlimgmc_instance0._width);
trace("width:2 :"+litlimg_instance.ltlimgmc_instance0._width/2);
trace("x position must be:"+test);
trace("x position is:"+litlimg_instance.ltlimgmc_instance0._x);
trace("----------------------------------------------------");

litlimg_instance.ltlimgmc_instance0._x=litlimg_instance._x-(litlimg_instance.ltlimgmc_instance0._width/2);
litlimg_instance.ltlimgmc_instance0._y=litlimg_instance._y-(litlimg_instance.ltlimgmc_instance0._height/2);
slideshow();
} // end if
} // end if
} // End of the function


function slideshow()
{
function pause_slideshow()
{
clearInterval(myInterval);
if (p == total - 1)
{
p = 0;
firstImage1();
}
else
{
nextImage1();
} // end else if
} // End of the function
myInterval = setInterval(pause_slideshow, 4000);
} // End of the function

p = 0;
--------------------------------------------------------------------------------------------------------------------

what i do is i have an array with the image links.
on a interval i load an image. and if p has reached the number of loaded images i start over again.

i traced the following while testing a bunch of images:
-------

1
x van inst0-125
y van inst0-93.55
width img:250
width:2 :125
x position must be:-125
x position is:-125
----------------------------------------------------
2
x van inst0-125
y van inst0-93.55
width img:258.05
width :2 :129.025
x position must be:-129.025
x position is:-125
----------------------------------------------------
3
x van inst0-129
y van inst0-93.55
width img:140.3
width :2 :70.15
x position must be:-70.15
x position is:-129
----------------------------------------------------
4
x van inst0-70.15
y van inst0-93.55
width img:243.2
width :2 :121.6
x position must be:-121.6
x position is:-70.15
----------------------------------------------------
1
x van inst0-125
y van inst0-93.55
width img:250
width :2 :125
x position must be:-125
x position is:-125
----------------------------------------------------

It looks like he takes the position of the prev image or something like that.

Please some help here.

Greetz. Jacob

Ps: this was some code i posted.. i would like to know how you put it into such a nice code block on the forum so it becomes more readable.

Set LoadMovie Time, UnloadMovie, LoadMovie
in that order-

Put simply-
can anyone guide me to any resources that would explain how to do this?

1. Load 2 swf's into empty mc's (this part is already done)
2. Have those 2 swf's be on the stage for 3 seconds.
3. Unload those 2 swf's.
4. Then load a completely new swf once those have been unloaded.

Load A SWF And Resize The Container
First of all, sorry about my english

Well, I have a hairy case here: I need to load from a menu different SWF's (same width/different heights). What I need after this: resize the height of the container box (a movieclip).

Some help? Some light? I have how to explain better all the stuff and post some AS too

Tutorials and all the help are welcome

[]'s
Eduardo

Resize Loaded Image To The Size Of The Constantly Resized Container
Hi all!
Here's my problem:
I have a function that redraws the container clip every frame. While the function is running I need to download an image inside the container and to resize the image to the size of the container. The particular problem is that if the picture is bigger than the container, when it'll be downloaded the size of the container will be the same that of the picture.
Here's a simplified code:

Code:
var MCL:MovieClipLoader = new MovieClipLoader();
var MCLL:Object = {};
MCLL.onLoadComplete = function(mc:MovieClip){
/*
When this is called, the mc's width and height are 0
*/
}
MCL.addListener(MCLL);
var container:MovieClip = _root.createEmptyMovieClip("container", 0);
container.h=5;
container.w=5;
_root.onEnterFrame = function(){
container.clear();
container.beginFill(0, 100);
container.moveTo(0, 0);
container.lineTo(container.w, 0);
container.lineTo(container.w, container.h);
container.lineTo(0, container.h);
container.lineTo(0, 0);
container.endFill();
container.w+=5;
container.h+=5;
}
MCL.loadClip(container, "image.jpg");
Thank you for any help.

Copyright © 2005-08 www.BigResource.com, All rights reserved