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
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-02-2003, 01:50 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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.
Can't Resize Images Loaded From MovieClipLoader
I've got a gallery that loads images in using MovieClipLoader. Unfortunately once the images are loaded they don't seem to want to be resized.
I've added an empty MC to the stage for each one and loaded the image in, then I try to resize it to fit the screen. Tracing the size after the onLoadComplete event returns 0 and changing the size makes the clips disappear from the screen.
Anyne have any ideas why?
Loaded Images Resize In Flash Not When Uploaded
HI
I'm loading images from an XML file and some are large, so when they are loaded I resize them, which works great from flash. But for some reason when I uploaded it the image loads at full size
Can anyone suggest why?
ActionScript Code:
var imageLoader:Loader = new Loader();
function loadImage():void {
imageLoader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
imageLoader.load(new URLRequest(masterList [currentImage] [0] ) );
addChild(imageLoader);
}
function onImageLoaded(evt:Event) {
evt.target.content.height=masterList [currentImage] [4];
evt.target.content.width=masterList [currentImage] [5];
evt.target.content.y = ((stage.height - 30) - masterList [currentImage] [4])/2;
evt.target.content.x = (stage.width - masterList [currentImage] [5])/2;
evt.target.content.smoothing = true;
currentImage++;
loadImage();
}
[F8] Images Loaded With LoadMovie() Disappear After A While
well ... when I load images with loadMovie() function, at first they appear fine, and after a while, some of them (randomly I guess) dissapear and randomly reappear after a while.
This does not occur in Internet Explorer 6, but unfortunately occurs in Firefox 3 and Opera 9.5
I have a second problem too. When a new image is uploaded, even if I click on refresh button, new images don't appear. If I clear the cache, they appear fine.
Basically, I use PHP and MySQL combined with flash. I keep the path and filename of the images in the database, and in php I echo an XML which flash handles and adds the path and filenames of the images in an array. The array elements are used as argument for loadMovie().
Masking Images I've Loaded With The LoadMovie Command
Hello everybody,
I have a small problem with masking images that I've loaded in using the loadMovie command. My small problem is that it won't work! I've tried getting it to load *.jpgs and *.swfs, but it doesn't seem to want to work.
The problem is that i don't want to import a whole load of images and publish them as part of the swf, as there could possibly be a huge amount of images involved.
To try and get there quicker, I'll rule out some obvious suggestions that I've already tried and failed at;
- naming all the instances and linking them properly
- placing the movieclip that the image loads into inside another movieclip
Any help at all would be great!
Thanks - Dan
Masking Images I've Loaded With The LoadMovie Command
Hello everybody,
I have a small problem with masking images that I've loaded in using the loadMovie command. My small problem is that it won't work! I've tried getting it to load *.jpgs and *.swfs, but it doesn't seem to want to work.
The problem is that i don't want to import a whole load of images and publish them as part of the swf, as there could possibly be a huge amount of images involved.
To try and get there quicker, I'll rule out some obvious suggestions that I've already tried and failed at;
- naming all the instances and linking them properly
- placing the movieclip that the image loads into inside another movieclip
Any help at all would be great!
Thanks - Dan
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
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.
Resize Images
Help, pls:
How can i resize uploaded image?
Code:
_root.createEmptyMovieClip('images',_root.getNextHighestDepth());
var loader:MovieClipLoader = new MovieClipLoader();
var loads:Object = new Object();
loads.onLoadComplete = function(target_mc:MovieClip)
{
trace (target_mc._width);
target_mc._width = 200;
trace (target_mc._width);
}
loader.addListener(loads);
loader.loadClip('test.jpg',_root.images);
stop();
Trace result:
Code:
0
0
why image not resize?
Resize Images
Im creating an XML/FLash slideshow.
Some slides are larger than the space and some are way too small.
When linking from an XML file to images how do i determine the size of the images and then resize them accordingly so that it maximises the space available. For example a landscape image needs to be resized until it meets the maximum width allowed and the height would of course increase/decrease accordingly and of course the opposite for a portrait shot.
function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
slideText = newSlideNode.firstChild.nodeValue;
loadMovie(imagePath, targetClip);
targetClip._x=0;
targetClip._y=0;
so im looking for somethig to put at the end of this to resize targetClip appropriately. Please please please help me
Resize Images..
im making a photo gallery and using the code from the tutorial
http://www.kirupa.com/developer/mx20...otogallery.htm
but this doesnt resize the images as they are loaded or once they are loaded.
im really new to flash and AS (less then a week) i was wondering if someone could push me in the right direction to a tutorial that has this in it or the snippit of code (i imagine its one or 2 lines)
i need to get a AS book..
Resize Images
Hi all,
Does anyone know how I could go about resizing images as they are loaded into a movie with loadMovie()? This is for a photo gallery that I am making. When you click on the thumbnail of the picture, a frame fades in and a larger version of that picture is loaded onto that frame. Most of my pictures are quite a bit larger then the "large" frame, so I would like the ability to resize the images as they are loaded. I don't want to actaully change the size of the image, as I have another button that displays the fullsize picture in a blank html page, but resize them into the frame.
Thank you for your help.
SWF That You Can Resize Images In...
Wondering if anybody knows how or can steer me to a tutorial on the following:
I want to make a Flash .swf that you can resize an image using handles most probably in proportion...
Thanking all,
Zane Cosgrove
How Do I Resize Images....?
how do i resize images without losing quality????... i've been "tracing bitmap" but that makes the application run really really slow.
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 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
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.
Checking If A Movie Loaded With LoadMovie Loaded Succesfuly
Hi,
I have a movie called main. I want to load into a movieClip that sits in main an .swf.
To do it i use a
pictureClip.loadMovie("PR001.swf");
My question is: is there a way that the main movie can know that PR001.swf was not loaded?
Thanks fo the help.
Skipping Missing Images For Dynamically Loaded Images?
Hey all,
I'm creating a image viewer for a photography studio.
I have it dynamically load the images. I'm using a text file to tell flash how many pics there are, the starting number, and the prefix and suffix for the file name ie. Ahp1234.jpg. Im using a simple counter when a person clicks on the "next" button it will add an increment to the starting number. My problem is photography studios often throw out images that didn't come out right, so there is a jump in numbers, and hence I get an error when trying to load an image that isn't there. I was wondering if there was a way to tell if an image has loaded properly using loadMovie. Or perhaps a better method than what I'm using?
I tried
square = new loadMovie;
square.load (_root.Filename);
square.onload = function (success){
if (success) {
//coding
}else{
counter++
}
}
If any one has any insight I would appreciate it.
Thanks.
Resize Images In Actionscript
right... i have created a sort of catalogue slide show where flash calls upon a XML document to display pictures from a folder called images on the CD.
the problem is i want the images in the folder to be resized to fit my window in flash where they are displayed. i have been looking on forums for ages and found one example on were-here.com but it went right over my head!!!
can anyone here help me?
Thanks
John
Resize Images Dynamically
All i'm attempting to do is set a laoded file to match the size of a empty_mc located into - on the stage. Of course I alredy tried setting properties to a second clip empty_mc2.
What happens is, the movie loads & resize but, resize is either to small or to large. At any rate, the loaded clip is not matching the size of the clip properties i had assigned. I could manuall y adjust the clip to make it fit, but I'm trying to resize the images dynamically.
Thak You
function fimage(){
//empty_mc coordinates
xpos= empty_mc._x;
ypos= empty_mc._y;
//loadmovie & position to coor
loadMovie("images/image1.jpg","empty_mc");
_root.empty_mc._x=xpos+1;//115set to scale and position to ghost clip on stage
_root.empty_mc._y=ypos-1;
//scale to fit empty_mc min image size
//get size
xheight=empty_mc._height;
xwidth=empty_mc._width;
//seto size
empty_mc._height = xheight; trace(xheight);
empty_mc._width = xwidth; trace(xwidth);
//end size
}
How To Upload And Resize Images
I'd like to create a small flash app the allows users to upload images and the flash script will resize the image.
Any suggestions?
Dynamic Resize Images
The tutorial posted here is great...but does anyone have a clue how I can resize the loaded images...I am referring to the picture gallery on Kirupa's tutorials.
I cannot see why all the pictures I load are nog fitting in the emptymovie cell and I would LOVE to hear from a real flash god what the problem is. I read through the threads but noone really seems to have the definate script.
Can anyone help me out? I am really going crazy about this...
Resize Imported Images
Can't figure this out.
Is it possible to anyway resize an image after it has been loaded into a moviClip through loadmovie ?
Can't get the code to work. Say somepicture.jpg is a 800 x 600 jpg.
Ex.
loadMovie("somepicture.jpg",MCfoo);
MCfoo._width=100;
MCfoo.height=100;
Problem In Resize Images[HD]
hi friends i need help in flash 8 cs1.0/2.0
i have one flash presentation which is contain dynamic data,, ow problem is that i load many dynamic images from XML file, now their is some file which is very high resolution like 1200X1250 and some the images are 3888X1280 res.. now i have make that images in thumbnail at this type of high res.. image is not set properly in format of 200X200 so what i do!! i try so many code but images are crouped. so what i do!!???
my requirement is i give any type of high res.. images it must be fit into 200X200 format, without any crop!!!
if u have any advice or code or reference link pls tell me!! it's urgent!!!
thnx in adv...
Dynamic Resize Images
The tutorial posted here is great...but does anyone have a clue how I can resize the loaded images...I am referring to the picture gallery on Kirupa's tutorials.
I cannot see why all the pictures I load are nog fitting in the emptymovie cell and I would LOVE to hear from a real flash god what the problem is. I read through the threads but noone really seems to have the definate script.
Can anyone help me out? I am really going crazy about this...
Resize Dynamic Images
hey all. im looking for a script that will resize dynamic images while still maintaining aspect ratio.
can anyone help me out?
thanks
Resize Images Before Upload
hello,
I am creating an upload tool for an image gallery. The swf uploads the files with filereference to a php files which resizes the images. But when the images are larger than 600kb it fails, php runs out of memory and I can't edit the php.ini file on the server.
So my solution is to resize the images before uploading them, this saves also bandwidth.
But there is only one problem, I don't know how I can do this. Is there someone who can help me?
Kristof
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?
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 :)
Resize Loaded Swf
hi,
i am loading lots of swfs into a movie container.. is it possible to resize every swf to the same size?
cheers,
G
Resize Loaded Swf
hi,
i am loading lots of swfs into a movie container.. is it possible to resize every swf to the same size?
cheers,
G
Resize Loaded Jpg
hi guys. I'm using a loader to load a jpg. After it's loaded, I want to resize it. Problem is, when I go to resize it, I get a runtime error saying:
Code:
SecurityError: Error #2122: Security sandbox violation: LoaderInfo.content: http://address_omitted_here.swf cannot access http://address_omitted_here.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.
at flash.display::LoaderInfo/get content()
at viewer_fla::MainTimeline/initHandler()
Here's the code I was using to load it:
Code:
function initHandler(e:Event):void {
e.target.loader.x = 0; e.target.loader.y = 0;
if (e.target.content.width > e.target.content.height) {
e.target.content.width = Global.STAGE_WIDTH;
e.target.content.scaleY = e.target.content.scaleX;
e.target.loader.y += (Global.STAGE_HEIGHT - e.target.content.height)/2;
} else if (e.target.content.height >= e.target.content.width) {
e.target.content.height = Global.STAGE_HEIGHT;
e.target.content.scaleX = e.target.content.scaleY;
e.target.loader.x += (Global.STAGE_WIDTH - e.target.content.width)/2;
}
Global.picsLoaded++;
}
for (i=1; i<=Global.NUMPICS; i++)
{
loader = new Loader();
loader.load(new URLRequest(this["p"+i]));
//loader.load(new URLRequest("p"+i+".jpg"));
loader.contentLoaderInfo.addEventListener(Event.INIT, initHandler);
clip.getChildByName("pic"+i).addChild(loader);
clip.getChildByName("pic"+i).alpha = 0;
}
I can load the pictures fine, it's just when I try to resize them with
Code:
e.target.content
that I get the error. How else can I resize the pictures?
Remove Loaded Movie After New LoadMovie Has Been Loaded
i need to unload a movie once the new loadMovie is fully loaded because once i click on my button to do so, my current loaded movie goes away & the screen is white until the new loaded movie is loaded. (i hope that made sense)
|