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




Load External Swf With Resize?



I have external .swfs to load into my main movie page. you click on a thumbnail to call it in. can I use ActionScript to determine specifically where and what dimensions it will play on the main movie stage? the problem is I have certain movies that would take too much time and effort to rebuild at the dimensions I want. also some of them don't have the .fla for anyway. if you care to take a look
the site is --- http://www.ismism.net/new/

right now the .swf in the intercative section loads into a pop up.
soory if this is elementary. is the a way to publish a movie and change its dimensions? any help would be kindly appreciated. thanks



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 07-28-2005, 06:36 PM


View Complete Forum Thread with Replies

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

External Jpg Resize On Load
Im loading jpgs into empty mc on the stage and need to resize them to the size of the empty mc. What is the code for this and where would i place it?


ActionScript Code:
stop();



// constants
var PICPATH:String = "../images/";// folder with jpgs
var NPICS:Number = 7;// number of pictures to load
var PICX:Number = 0;// x loc of big picture
var PICY:Number = 0;// y loc
var THUMBHOLDERX:Number = 0;// x location of thumbnail holder movieclip
var THUMBHOLDERY:Number = 0;// y location

lastFrame = 1;


var totalloaded:Number = 0;// running tally of bytes loaded from all pics
var ipic:Number;// index into pictures array, used for loading
var loader:MovieClipLoader = new MovieClipLoader();// set up loader, an instance of MovieClipLoader
loader.addListener(this);// use the main timeline to listen to and respond to loader's broadcast events

/*********  DEFINE FUNCTIONS, INCLUDING INIT FOR MOVIE SETUP  **********/

// thumbnail click (onrelease) handler

function openPic() {
    pic_mc.loadMovie(PICPATH+picnames[this.i]+".swf");
}





/*******************************************************************************/

// assign event handlers (called when all jpgs are loaded)

function setupHandlers() {
    filetext = "all loaded";// don't need loading indicator any more
   
}



function onLoadInit(_mc:MovieClip) {
    // this gets done when the jpg is completely loaded:

    // now load the next one (if there are more) or set up handlers if done
    ipic++;
    //this["menu"+ipic].enabled = true;
    if (ipic == NPICS) {

        setupHandlers();
    } else {
        loader.loadClip(PICPATH+"pic"+ipic+".jpg","pics_mc.pic"+ipic+"_mc.pic_mc");


    }
}

// listener function to handle broadcast progress messages

function onLoadProgress() {
    var pctLoaded:Number = Math.floor(pics_mc["pic"+ipic+"_mc"].pic_mc.getBytesLoaded()/pics_mc["pic"+ipic+"_mc"].pic_mc.getBytesTotal()*100);
    var newFrame = int((pics_mc["pic"+ipic+"_mc"].pic_mc.getBytesLoaded()/pics_mc["pic"+ipic+"_mc"].pic_mc.getBytesTotal())*100);


    pics_mc["pic"+ipic+"_mc"].words.text = pctLoaded;

    //change button alpha according to loaded kb of swf
    this.pics_mc["pic"+ipic+"_mc"].fade_mc._alpha = 100-newFrame;


}


function init() {



    // make empty movieclips in thumbs_mc for each pic to go into
    for (var i:Number = 1; i<NPICS; i++) {
        this["menu"+(i+1)].gotoAndStop(1);
        this["menu"+(i+1)].onRollOver = foward;
        this["menu"+(i+1)].onRollOut = back;
        this["menu"+(i+1)]._alpha = 10;
        this["menu"+(i+1)].enabled = false;
    }

    // set the pointer to the first jpg in the array picnames
    ipic = 1;
    // start loading jpgs
    loader.loadClip(PICPATH+"pic"+ipic+".jpg","pics_mc.pic"+ipic+"_mc.pic_mc");


}






/*********  CALL THE INIT FUNCTION TO START THE MOVIE  *****************/
init();

Frame Resize On External Jpg Load
i am trying to dynamically resize a MC which acts as a frame for dynamically loaded jpgs (using loadMovie)...on a button press, the jpg is loaded and this function is fired, to resize the frame based on the new jpg's dimensions...i have having problems, the frame is not resizing to the proper sizes, and the the visibility of my MCs are not appearing...if anyone has some insight, i would appreciate it....


Code:
function resizeTwo() {
this.onEnterFrame = function() {
this.holder._visible = false;
if (this.holder._width>0) {
if ((Math.abs(this.holder._width-(this.frame._width+20)))<=1) {
this.frame._width = this.holder._width+20;
this.frame._height = this.holder._height+20;
this.holder._visible = true;
delete (this.onEnterFrame);
} else {
this.frame._width -= (this.frame._width-this.holder._width)*.2;
this.frame._height -= (this.frame._height-this.holder._height)*.2;
}
}
};
}

Help Needed Load External Swf And Resize
Hi. I have a scroller with buttons inside to load a external swf. The problem is that the size of the external swf is 800 x 600, the size of the stage it self. Can someone help on the actionscript code for the buttons to load the external swf and resize it, and change is position at the same time ?

Thanks


samsam

How To Resize/load+unload External Swf's In A Movieclip
Hello everyone, I've got an assignment due this week in my college flash class and I can't seem to get the kind of help that I'm looking for from my teacher. In all honesty she doesn't even know a lot of the basics about as3 yet anyway...

Any help would be greatly appreciated and I'm really not sure where to turn from here. I've spent the past 2 days trying to figure out different ways to do this to no avail so I figured I would start looking for personal assistance. =) If you need the .fla files or anything listed here let me know, I will upload anything necessary to assist you in understanding my predicament.

Here is my problem:

I'm trying to load different .swf files into a blank movieclip and some of them are the default 550x400 where some of them are not. I want them all to load into a single "master" swf file but it doesn't seem to be working properly because I have them set up as different sizes and sometimes a few of my files show up outside of the scene size i have set up on the external .swf files.

If you take a look here you will see what I mean:

http://webspace.westwood.edu/shelbyk...st/master.html

As of right now they are not loading into a movieclip, but rather on top of a different "intro.swf" file. From the research I've done online though, I've found that if I want to re-size where the .swf's are loading so that they stay within specific dimensions it's probably best to load them into a movieclip.

What I need:
Basically I want the external swf files that I'm loading into the "master" swf file to load in the original dimensions and be aligned centered on the scene. Also I need the swf's to unload when you pick a different button and view a different external swf file. The reason I need this is because there is music and sounds that play on some of the external swf files so they need to reset upon a new button click. If there is a way to re-size the swf files to the dimensions I need upon each button click that would be great.

Here is the technical info:
.fla size specifications:
"Kunz_combined.swf" 550w 400h
"Shelby_Kunz_snd.swf" 550w 400h
"Kunz_spy.swf" 550w 400h
"Kunz_potatohead.swf" 750w 600h
"Kunz_Sig.swf" 765w 220h
"Kunz_Flower.swf" 400w 700h

Current "master.fla" actionscript

ActionScript Code:
var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("intro.swf"));
addChild(myLoader);

function loadSWF1(event:MouseEvent):void {
    myLoader.load(new URLRequest("Kunz_potatohead.swf"));
    addChild(myLoader);
}
car_btn.addEventListener(MouseEvent.CLICK, loadSWF1);

function loadSWF2(event:MouseEvent):void {
    myLoader.load(new URLRequest("Kunz_Flower.swf"));
    addChild(myLoader);
}
flower_btn.addEventListener(MouseEvent.CLICK, loadSWF2);

function loadSWF3(event:MouseEvent):void {
    myLoader.load(new URLRequest("Kunz_Sig.swf"));
    addChild(myLoader);
}
letter_btn.addEventListener(MouseEvent.CLICK, loadSWF3);

function loadSWF4(event:MouseEvent):void {
    myLoader.load(new URLRequest("Kunz_combined.swf"));
    addChild(myLoader);
}
mario_btn.addEventListener(MouseEvent.CLICK, loadSWF4);

function loadSWF5(event:MouseEvent):void {
    myLoader.load(new URLRequest("Kunz_spy.swf"));
    addChild(myLoader);
}
scope_btn.addEventListener(MouseEvent.CLICK, loadSWF5);

function loadSWF6(event:MouseEvent):void {
    myLoader.load(new URLRequest("Shelby_Kunz_snd.swf"));
    addChild(myLoader);
}
slide_btn.addEventListener(MouseEvent.CLICK, loadSWF6);

Load External JPGs, Dynamically Resize Box...
I have seen this done quite often, but am not sure how it's done. I'd like to create an XML based photo gallery and have them placed in a box with a 1pt frame. When the images load in, if they are a different size, I would like to see the frame tween to the new size.

I kind of have it working, but it's not very pretty compared to the others I have seen. Anyone have an easy solution to this?

Thanks!

[F8] Dynamically Load SWFs And After Load, Resize
Hi there

So as a further step of my simple flash eBook i need to scale my dynamically laded SWFs(They are large converted pdf pages). So far, after i have loaded the 2 first pages i correct the x and yscale property of my containers(i have 2(holderOne and holderTwo), each displaying one page) and that works.

But, if i define a ._width and ._height to my 2 containers(now holding page1 and 2) they both just disappear from my stage. My trace tells me that they are loaded correctly, but they are not there.

Here's the onLoadComplete function in which i specify the size of my containers:


Quote:




preload.onLoadComplete = function(targetMC) {
holderOne._visible = true;
holderTwo._visible = true;
holderOne._xscale = 75;
holderTwo._xscale = 75;
holderOne._yscale = 60;
holderTwo._yscale = 60;
bar._visible = false;
pText._visible = false;
trace(targetMC+" finished");
};






As mentioned the above works, but if i use the ._height and ._width properties (400x500 on each page) on holderOne and holderTwo it does not (or maybe it does but my pages disappear).

Anyone who has a clue about what's happening?

Thx in advance

Resize .swf On Load
I'm loading several already-developed .swf files into a single "container" file that has buttons so that the end user can switch back and forth between the loaded .swfs.
All this is working just fine with one exception: one of the .swf files was developed with a much larger stage than the others, so I need to size it down on load so that it will fit in the same space as the others. Is there any way to do that? (Re-developing the whole thing in a smaller size is not an option within the time-frame that we have.)
TIA for any suggestions...
Carolyn

Resize On Load?
Hi all,

I have a movieclip which I am resizing, but I can't seem to get the clip to resize on load. It only resizes once I actually resize the browser.


Code:
onClipEvent (load)
{
content_mc.container_mc._width = Math.max(Stage.width, 600);
content_mc.container_mc._yscale = content_mc.container_mc._xscale;
}
onClipEvent (enterFrame)
{
content_mc.container_mc._width = Math.max(Stage.width, 600);
content_mc.container_mc._yscale = content_mc.container_mc._xscale;
}
I've also used a stagelistener with no luck.
Any ideas?
thanks a bunch

Resize MC On .swf Load
I am wanting to make a gallery, and instead of the container mc just jumping to change size to fit the loaded contents, I am wanting it to scale tween between the two sizes.

e.g. a .swf that is 200x200 to a .swf that is 300x600

Currently I'm using the following code to load in my external.swf
s

ActionScript Code:
on (press) {_root.createEmptyMovieClip("blank_mc",100 );with (_root.blank_mc){_x=10;_y=200;}loadMovie("xxx.swf", _root.blank_mc);}


whats the easiest way to do this?

Thanks for your time,

-ollie

Load Auto Resize
Hi Everybody,

can someone help me to create image gallery, which can automatically change size according to loaded external swf?
Sample: http://www.twinphotographie.com

I've been trying it many times according to the tutorials,
but without any succes.

Thank you for any help.

Load Jpg And Resize The Movieclip ?
I need to do a script for my new 3D portofolio, i would like to dinamically load jpgs into a nice window/movie (with a loading, draggable, that you can close, with swapdepths etc...).

This is what i've come with at the moment, it's probably badly written and doesn't really work the way i want :


ActionScript:--------------------------------------------------------//load my jpg
clipwindow_mc.createEmptyMovieClip("holder_mc", 1);

button1.onPress = function() {
loadMovie("test.jpg", clipwindow_mc.holder_mc);

clipwindow_mc.clipfond_mc.onEnterFrame = function() {
this._width += (clipwindow_mc.holder_mc._width - this._width)/3;
this._height += (clipwindow_mc.holder_mc._height - this._height)/3;
};

};

//drag movie
clipwindow_mc.onPress = function() {
setProperty("clipwindow_mc", _alpha, "40");
this.swapDepths(1);
this.startDrag(false);
this._parent.onMouseMove = function() {
updateAfterEvent();
};
};
clipwindow_mc.onRelease = function() {
setProperty("clipwindow_mc", _alpha, "100");
stopDrag();
this._parent.onMouseMove = undefined;
};


---------------------------------------------------------------------


Anybody has a clue how to do this ? or does anyone know a link to such a problem ? Thanks


and i have found those links that could help but don't exactly answer my need : http://actionscript-toolbox.com/samplemx_loadjpg.php and http://www-level3.experts-exchange.c..._20681560.html



(By the way, as you can guess i'm bad in actionscript, i'm more into 3D : stuff i gave to Flashkit : http://www.flashkit.com/movies/3D/Ha...dex.php?chk=no and http://www.flashkit.com/movies/3D/Th...8555/index.php )

Resize Box Then Load Image
I'm trying to make an effect like the image-transition on http://www.schmidtfoto.de/ but I am about to give up.

I am resizing the box using onEnterFrame but I can't get the script to load the image when the resizing is done.

Does anyone know of a tutorial on a similar effect?

Resize Image On Load
I'm loading some jpg files and need to know if I can resize the images when I load them? For instance, if the image is 320X240 can I resize it to 180X120? I want to scale the image and make it a thumbnail. Thank you for the help.

AS3 Load & Resize JPG - Can U Improve This?
Can anyone help me with a better solution for loading a jpg dynamically, and resizing it to fit into a set location / size?

I'm currently using this:


Code:
var pictLdr:Loader = new Loader();
var pictURL:String = image[c];
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
imageMC.addChild(pictLdr);
imageMC.width = 150;
imageMC.scaleY = imageMC.scaleX;
trouble is.. on the initial load the JPG appears at full size, then all others after that are at 150px width and correctly scaled. not so great.

image[c] is the image URL taken from an array.

I'm TOTALLY freaked out about how different AS3 is.. I thought I'd better get into it though. LOVE the XML stuff it does though.

Any help would be SOOOO appreciated!

Thanks in advance gang!

Load And Resize A SWF Inside A MC
Hi,

I'm using AS2 to load an SWF inside an MC. The MC measures 800x600, while the SWF (which can vary in size) measures in this case 14x60, even though, looking at it, it seems to be about half the size of the hosting MC. This makes me think that the dimension scales are different. I'm loading the SWF using MovieClipLoader and I'd like to resize it so that it fits as proportionally snug as possible within the MC. How can I do this? If I try to resize the SWF to the MC's dimensions, it become way too large and goes off screen. If instead I try to rescale the hosting MC to fit around the SWF, the SWF itself rescales as well. I'm going nuts! How can accomplish this?

Thank you,

Tatiana

Resize Box, Load Image
now I've seen image galleries that have a box resize, load an image via fade in with the click of a thumbnail, but is there a way to do it where there are no thumbnails? Basically I'm looking for a ongoing movie where a

1) box sizes(border) itself
2) fades-in an image into an emptyMC
3) waits 5-10 seconds
4) fades out the image
5) box resizes itself
6) fades-in an image into the same emptyMC
7) goes through the same process with about twenty images

I don't want any thumbnails or user interaction, just the visual of a nice gallery with the process above.

Any thoughts on how to do this/tutorials/FLA's?

Thanks in advance everyone.

Load .swf And Resize Not Working
Earlier this year i posted a thread about the famous old load image and resize problem. Scotty came up trumps as usual and managed to solve my problem.

http://www.kirupa.com/forum/showthread.php?t=86939://

This works fine with jpgs, but i want to load .swf's instead of images. Being as naive as i am i thought i would be able to swap the jpgs for .swf's. However when i do this it breaks it. I have 2 buttons and two .swf's. It loads the first .swf fine, i click button 2 and it loads that fine aswell, but when i click button 1 or 2 again nothing happens?!?

Can anyone advise me what i need to do?

Thanks

Matt

Load And Resize Not Working With .swf's
Earlier this year i posted a thread about the famous old load image and resize problem. Scotty came up trumps as usual and managed to solve my problem.

http://www.kirupa.com/forum/showthread.php?t=86939://

This works fine with jpgs, but i want to load .swf's instead of images. Being as naive as i am i thought i would be able to swap the jpgs for .swf's. However when i do this it breaks it. I have 2 buttons and two .swf's. It loads the first .swf fine, i click button 2 and it loads that fine aswell, but when i click button 1 or 2 again nothing happens?!?

Can anyone advise me what i need to do?

Thanks

Matt

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 Box, Load Image
now I've seen image galleries that have a box resize, load an image via fade in with the click of a thumbnail, but is there a way to do it where there are no thumbnails? Basically I'm looking for a ongoing movie where a

1) box sizes(border) itself
2) fades-in an image into an emptyMC
3) waits 5-10 seconds
4) fades out the image
5) box resizes itself
6) fades-in an image into the same emptyMC
7) goes through the same process with about twenty images

I don't want any thumbnails or user interaction, just the visual of a nice gallery with the process above.

Any thoughts on how to do this/tutorials/FLA's?

Thanks in advance everyone.

Resize Load Movie
Hi,

I understand that with loadMovie('myclip', level); I am able to load an external swf file and play it on an existing flash file.

I need to resize the external clip that I load. Can anybody guide me regarding this?

Load Website From MC To Resize...?
Is it all possible to load a MC, which is your whole website, and have that movie clip with a script that had it automaticall resize to the viewers monitor?

Thanks so much

External Swf Resize
here's another one...

is it possible to resize an external swf using a command, say the active page is 400x400 and the external swf is 500x500, is there a command that will shrink it to fit?

Resize An External JPG
Hello! I have a JPG which is loaded in an empty movie clip, my client will have to upload other jpg overwriting this one, and the JPGs will be of different sizes, is it possible to create a script that allows the external JPG to resize at a specific size? for example: if the client uplaod a JPG of 600x400 can it become smaller automatically to the size I set? I hope I was clear thanks!

Resize External Swf
Hello, I've got a game (swf file) which I added to my web page (done with Flashmx). The game is way to big to fit properly in it.
Can I resize it?

I created an empty movie clip and a play button on the same level with the action on(release)[_root.game.loadmovie("xxx.swf")]

How To Resize An External Swf?
Is it possible to do the following:

Load an external swf into a movie clip but have that external movie resized by 50% using actionScipt?

See, I have a few external swfs at 720x576 but I want to load them in a movie clip which is half the size and therefore want the external swf to scale itself to fit that movieclip and play as normal.

Thanks in advance
vic

How Can/do I Resize External Swf?
i load an external swf into a movie clip.... now i want to resize the external swf.... issit possible..? cos this external movie clip is actually a jpg converted into swf using php... but now i want to manipulate this swf within my main swf which calls it using the mc_inst_name.loadMovie() function...

Resize External .SWF In A .FLA
Hi,

I need to load an external .swf (600pixels by 600pixels) into a .fla but I need shrink the size of the .swf to 200pixels by 200pixels.

Can someone help.

I created an empty shell movieclip using menu called my_shell and then added the following code to a frame:

loadMovie ("my_movie.swf", "my_shell");

This loads the .swf but at full size 600pixels by 600pixels.

How do I force the .swf to be loaded and resized down to 200pixels by 200pixels?

Thanks

How Can/do I Resize External Swf?
i load an external swf into a movie clip.... now i want to resize the external swf.... issit possible..? cos this external movie clip is actually a jpg converted into swf using php... but now i want to manipulate this swf within my main swf which calls it using the mc_inst_name.loadMovie() function...

Dynamically Load And Resize .swf Images.
Hi,

I'm needing to dynamically load in .swf images from folder on my server.

Once loaded, they need to be resized automatically so they look the same size as the mc I loaded them into.

Any ideas on how to accomplish this?

Thanks,

Load Movie Target Resize - Please Help
Hi, I am designing an inteface for loading and playing external SWF (video) files. Most of these exetrnal SWF are PAL resolution Quicktime movies scaled and encoded at 25% using Swideo (ie 180x144 pixels). So, I designed a player interface incorporating a target MC of this size. When I load a SWF of the afore mentioned size it maps nicely into this space. However I also have a few smaller SWF which load from the upper left corner which I would like to scale up (after loading) to fit the interface. Despite my best attempts I can only acheive this by placing the appropriate _height and _width commands into a looping portion of my code - which has just got to be an unneccessary playback overhead. Am I doing something wrong ? I realise that the size of the MC target is not inheireted by the external SWF but surely it should be a simple matter of issuing a command (once) to scale it back up ? Help !

Script Problem (load Jpg And Resize )
please take a look at my fla.

I have a button that loads an external file (jpg) into a movie and resizes it to 15%. on click it displays 100%, but I cannot make the button behind it to take the size of the pic.. so when clicked (the picure) to resize again to 15%

thanx

XML Image Load, Frame Resize
check this out...:

http://www.schmidtfoto.de/

i am wondering how they get the frame to resize based on the next image while it is "loading"...my guess: preload the first 3 images and cache them...also push the dimensions of each image to an array...then once you get into the site, each loading you see, is actually preloading a future photo...this enable the frame box to resize to the correct size before the "loading" is done....

what do you think, am i on track...?

Popup Auto Resize Upon Load
Hi all,
I'm working on a project that contains lots of photos with different widths/heights. When a thumbnail image within flash (which is a button) is pressed the popup will open a detailed image inside it. The popup should resize to the size of the photo loaded within it.

Any scripts/tuts out there to do this?

Cheers.

100% Works On Resize But Not On Initial Load?
Hey everyone. This issue has been beat to death, and normally I've got it down, but I'm having a problem with a new site I'm working on.


I've got two elements that stay one on the left and one on the right at all times no matter what height/width. They also resize height-wise to fit height, but don't resize-width, just adjust space.

It all works just fine, but only after resizing the window. On loading it still shows it at 800x600.

I also know that it's in Flash, not on the HTML end because it happens in the flash preview as well.

Here's the code I have:

Code:
Stage.scaleMode = "noScale";
Stage.align = "c";

var HPositioner:Number = (Math.round((Stage.width - 800) / 2));
var VPositioner:Number = (Math.round((Stage.height - 600) / 2));

function HPositionCubes () {
if (Stage.width >= 801) {
var HPositioner:Number = (Math.round((Stage.width - 800) /2));
setProperty(femaleBody, _x, 0 - HPositioner);
setProperty(maleBody, _x, (800 + HPositioner) - 319);
} else {
setProperty(femaleBody, _x, 0);
setProperty(maleBody, _x, 800 - 319);
}
}

function VPositionCubes () {
if (Stage.height >= 601) {
var VPositioner:Number = (Math.round((Stage.height - 600) /2));
setProperty(femaleBody, _y, 0 - VPositioner);
setProperty(maleBody, _y, 0 - VPositioner);
setProperty(bg, _y, 0- VPositioner);
} else {
setProperty(femaleBody, _y, 0);
setProperty(maleBody, _y, 0);
setProperty(bg, _y, 0);
}
}

maleBody._height = Stage.height;
femaleBody._height = Stage.height;
HPositionCubes();
VPositionCubes();
setProperty(bg, _width, Stage.width);
setProperty(bg, _height, Stage.height);

var resizeListener:Object = new Object();
Stage.addListener(resizeListener);
resizeListener.onResize = function () {
setProperty(femaleBody, _height, Stage.height);
setProperty(maleBody, _height, Stage.height);
setProperty(bg, _height, Stage.height);
setProperty(bg, _width, Stage.width);
HPositionCubes();
VPositionCubes();
}
This is driving me nuts. Any help would be greatly appreciated.

Resize Window On Frame Load
Ok... Probly a simple one. Im not thta keen on using javascript in a flash file to control the browser.

I have a flash movie that loads in a window and using javascript, the window opens 745x497 and centered. that works fine. I wanted to know if there is a way to that when frame 1 of scene 2 loads if therer is a way I could get the window to resize to 745x480.

Thanks in advance.
Tek

Load External SWF1, Then Load External SWF2
I'm trying to load two different swfs, one after the other. After the first swf is loaded into it's own container (containerA) and is displayed to the viewer, I want to load the second SWF into its container (containerB) which will end up on top of the first SWF (the first SWF acts as a background layer).

Here is my code:
Code:


var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);

myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
   loadText._visible = true;
   var preloadPercent:Number = Math.round((loadedBytes/totalBytes) * 100);
   loadText.text = preloadPercent + "%";
};

myListener.onLoadComplete = function(target_mc:MovieClip) {
   loadText._visible = false;
}
//load in first swf
myMCL.loadClip("sand.swf", "loadBackground");


It makes sense to me to use an if statement, indicating "if sand.swf is loaded completely, the go ahead and load in movie.swf". But I everything that I have attempted fails. Can someone point me in the right direction as to how I can load in the second movie after the first one has been successfully loaded in.

Perhaps it's a matter of loading them at the same time, then displaying one after the other? I don't know.

Need help!
- popkes01

How Do I Position And Resize External Swf ?
Hello,

I know how to load a .swf with the

loadMovie("test.swf", "targetMC");

which will load the external swf into the targeted MC.
But how do you position and re-size the loaded external swf's?
I know that the loaded swf will be in the top left of the MC.
But is there any actionscripting that can position and re-size a loaded external swf?

Automatic Resize Of External JPG?
Hello! I have a JPG which is loaded in an empty movie clip, my client will have to upload other jpg overwriting this one, and the JPGs will be of different sizes, is it possible to create a script that allows the external JPG to resize to a specific size I set? for example: if the client uplaod a JPG of 600x400 can it become smaller automatically to the size of the bevel in which it will be contained? I hope I was clear, if this is possible, could you please post the exact code I have to use? thanks!

Dynamic Resize For External Swf
Okay, so this is what I've got

http://www.dbry.com/test/indexx.html

When the movie loads it says

Code:
onClipEvent (load) {
_root.createEmptyMovieClip("containerMC", 0);
_root.containerMC._x = 32;
_root.containerMC._y = 32;
_root.containerMC.loadMovie("news.swf");
}
and this is what the moving visable movie clip is doing


Code:
onClipEvent (enterFrame) {
speed = 3;
this._width += (_root.containerMC._width/2-this._width/2)/speed;
this._height += (_root.containerMC._height/2-this._height/2)/speed;
}
but whenever I click a button to load a new swf, the visable movies dimentions go to 0x0 assumingly b/c the containerMC is dissappearing for a monent? Well what I want is have the visable clip keep its dimentions when a button's clicked and somehow preload the new swf, than when its loaded, resize to fit it [which ive done] so it doesnt have so much crazy movement.

any direction i should go would help alot. thanks guys.

<B>Auto Resize External XML JPG</B>
Hi I am creating a Photo Gallery with XML in Flash MX 2004 Pro. It all works great except for images that are smaller than the emptyMC specified parameters of 300px X 300px. If you have vertical or odd-shaped images they load in the upper left corner which indicates something about registration. If the jpg's are loading dynamically via XML, then is registration even an issue?

My question is two-fold:

Does the auto-center and/or auto-resize code need to be in the XML file or in Flash AS?

Where does the code go and what do I need to specify?

Thanks in advance

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

HELP Resize An External .swf Once Loaded Into An MC?
Hi all (again), je,je...

Well, now my problem is that I want to load an external .swf with "loadMovie", and I do something like this:

advertisement_holder.loadMovie("advertisement.swf" );

I do it fine, but IŽd like to resize the loaded swf in order to fit a space inside the movie.

Thank you in advance Regards!

Resize External Image
I created a script that creates a custom rollover animation using custom parameters. The user calls the following function to load an external image and add a resulting link.

RolloverImage("test.jpg", "test.htm");

The javascript creates the swf and passes the arguments through FlashVars. This works perfectly fine.

We are able to resize the stage by setting the swf attributes upon creation (via html). But if we try to resize either the stage or the clip that holds the image, the screen is blank.

I believe it has to do with the loader code.


ActionScript Code:
var loader:Loader = new Loader();

if (rolloverImage != null) {
    // Load image
    loader.load(new URLRequest(rolloverImage));
    imageClip.addChild(loader);
}

The loader and the imageClip both result in a width and height of 0, but the image is rendered correctly on screen. If I try to resize the imageClip, then it disappears.

Is there an appropriate way to resize the external image?

Loading External Jpg And Resize
Hello, I want to know how can I load external jpgs into a "frame" and depending on the size of the jpg resize this "frame" as you can see here:

http://www.terra.es/personal8/933170888

Thanks in advance.

Can You Resize External Movies?
Here is exaclt what Im doing;

I have a movie clip that acts as a button on the stage. When you rollover the movieclip, it displays a video. That is the video was created as a seperate file.
So, I have to use the loadMovie command to display the video. I originally created the video at 172 x 52 resolution, so it can fit "behind" the movie clip that acts as a button.

So basically when you rollover it the video starts playing.

The problem is this;

I rollver and the external movie is loaded and starts playing except for the fact that the width of the external movie is stretched out..I dont get it. Is there a way I can load the .swf file in and then resize it? I am calling the movie in by using a empty movie clip. So the empty movie clip sits on the stage and on rollover the .swf is loaded in to display on rollover of the mc_button I have. If anyone wants an example of what is going on, please let me know I will post something here as example.

Thanks alot in advance, I am stumped at the moment!

External Image Resize Help
I am trying to load an external image into a movie clip that is already on the Stage and size it to the movie clips size. The movie clip name is member_gallery with the width of 360 and the height of 251. One of the images i am trying to load into it is 1024 * 768. I would also like to load other images of different sizes into the same movie clip and they all change to 360 * 251 when loaded.

here is what i have been messing with :

PHP Code:



onClipEvent(load){var container2:MovieClip = createEmptyMovieClip("container2", getNextHighestDepth());var mcLoader2:MovieClipLoader = new MovieClipLoader();mcLoader2.addListener(this);mcLoader2.loadClip("http://www.gothics-r-us.com/chat/images/gru.jpg", container2);trace(this._width);trace(container2._xscale);    container2._xscale = this._width / 10;    container2._yscale = this._height / 10;    //container2._height = 251;} 




Please help! i am new to this.

External Xml Gallery + Bg Resize
Hi all,

I'm trying to load an external xml gallery using bg resize method but the gallery won't load properly untill I resize myself the stage or I minimize/maximise while using a browser. The picture lags!! When I tested the xml structure alone it loads fine.
Does anyone know how to make this work??


-------------------------------------------------------------------------------------
Here's my codes:

this is for "bgGradient_mc"

Stage.scaleMode = "noscale";
Stage.align = "TL";

var HorizPos = Math.round((Stage.width - bgGradient_mc._width) / 2);
var VertPos = Math.round((Stage.height - bgGradient_mc._height) / 2);

setProperty(bgGradient_mc, _width, Stage.width);
setProperty(bgGradient_mc, _height, Stage.height);

setMenuHorizontal();

var stageListener = new Object();
Stage.addListener(stageListener);

stageListener.onResize = function() {

setProperty(bgGradient_mc, _width, Stage.width);
setProperty(bgGradient_mc, _height, Stage.height);
setMenuHorizontal();

};

function setMenuHorizontal() {
var HorizPos = Math.round((Stage.width - bgGradient_mc._width) / 2);
var VertPos = Math.round((Stage.height - bgGradient_mc._height) / 2);
menuleftmc.menumc._alpha = 68;
menurightmc.menumc._alpha = 0;
setProperty(menuleftmc, _x, 0);
setProperty(menuleftmc, _y, 0);
setProperty(menuleftmc.menumc, _width, Stage.width);
//setProperty(menurightmc, _x, Stage.width - menurightmc._width); ou encore
setProperty(menurightmc, _x, (Stage.width + HorizPos) - menurightmc._width);
setProperty(menurightmc, _y, 0);
setProperty(copyrightmc, _x, Stage.width - 280);
setProperty(copyrightmc, _y, Stage.height - 30) ;
}



This is a submc of (bgGradient_mc) : "bgmc"


var monXML = new XML();
var chemin = "xml/";

monXML.ignoreWhite = true;
monXML.onLoad = extraireGallery;
monXML.load(chemin+"bg_photos.xml");


function extraireGallery(succes) {

var xmlNoeud = this.firstChild;
var tab_image = [];
var nb_total = xmlNoeud.childNodes.length;

if(succes) {
for(i=0;i<nb_total;i++) {
tab_image[i] = xmlNoeud.childNodes[i].childNodes[0].firstChild.nodeValue;
}
bgmc.loadMovie(tab_image[0]);
} else {
trace("File is found...");
}
}


and XML file structure:

<?xml version="1.0" encoding="iso-8859-1"?>
<background>
<landscape>
<images>http://www.kirupa.com/developer/mx2004/pg/kresge.jpg</images>
</landscape>
</background>

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