ActionScript 2.0 :: Restricting Image Size On LoadMovie?
Jan 30, 2009
I am using loadMovie to load an image that a user has uploaded. If I have the loadMovie target as a movie clip of size 300x300 and the user loads an image of size 600x600 it does not restrict and scale that image down to fit within the 300x300 box.
Is there anyway to restrict this? Like setting the properties of the uploaded image to fit within the movieclip?
Another issue is that I am using the following code to edit the size of the preview pane (according to a users input):
ActionScript Code:
setProperty(_root.dimension_preview, _width, Number(_global.dimension_width));
setProperty(_root.dimension_preview, _height, Number(_global.dimension_height));
Now when I load an image into this it actually magnifies it by the amount the user entered, is there anyway to prevent it doing this?
If it is easier, I can upload the bits and pieces.
View 0 Replies
Similar Posts:
Mar 6, 2009
My problem is that my final .swf is embedded onto an html page and stretches for the entire width of the users screen. This means that if they have a particularly high resolution, the width of the .swf file stretches significantly beyond the initial stage settings. I'm okay with this, as I really need the .swf to fill the width of the screen.
However, it means that the cursor is able to be pointed more than 100% left or right of the stage, causing the panning image to move further left or right than it should.
What I need to know is how to get around this. I'm assuming I could set a boundary at the left and right of the stage where the code wouldn't be active?
Here's my code:
Code:
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1);
constrainedMove(fg_mc, 4, 1);
[Code].....
View 13 Replies
Dec 14, 2009
I know that the image panning has been done to death on these forums, but I was curious if anyone had an AS3 version Krilnon code
from this post titled: AS 2: Restricting cursor area in Interactive Image Pan
here is what Krilnon posted to use in AS 2
import flash.geom.Rectangle;
this.onMouseMove = function() {
constrainedMove(bg_mc, 4, 1, new Rectangle(0, 0, Stage.width / 2, Stage.height));
};
[Code]......
View 5 Replies
Feb 11, 2009
I have this problem: in my swf on frame 100 is a code:
Code:
loadMovie("second.swf", _root.clip1);
I have mc with isntance name: clip1 The movie second.swf loads into the position of clip1 but it's originally very big and I want it to make it smaller so it will fit to my site, if possible i would also like it not to be resizeable (so when someone will have smaller browser window it wouldnt move)
View 4 Replies
Jan 15, 2011
Now i'm at a frame inside has a button. once i click it will load a swf file
flashmov.onRelease = function(){ flash_mc.loadMovie("animation.swf");}
but i have problem which is my animation.swf is way too big (800x550)and my flash_mc doesn't have anything inside..I want to resize to 480x330. How can i do it?
View 7 Replies
Jun 3, 2011
I have loaded a .swf into my main timeline, but it's quite large. I am trying to get it to fit in the constraints of my current movie. I have read that by putting it into a movie clip, it will constrain to that dimension. How do I accomplish this?
View 3 Replies
May 19, 2010
I have loaded jpegs into instances on my stage using loadMovie()See here:However the pictures (which have a greater height than the instance) in the thumbnail buttons extrude further than the height of the targeted instance (because the jpeg size is larger) but I want it to crop to the size of the targeted instance.Is it normal for the jpeg to fill the stage from the position of your instance, independent of the instance size it is targeted for?
View 3 Replies
Jan 15, 2011
I'm at a frame inside has a button. once i click it will load a swf file[code]...
View 1 Replies
May 7, 2008
We have used loadMovie to load some small SWF files on a home page we have made. The swf files are in different sizes and we need to be able to set the size. How do we do this? We hoped the problem was solved with the following code, but this code only sets the size of the variable "minRamme", the contents are still to big, resulting in only a part of the swf file being visible. Anyway the following code ignored the onRelease command, so the swf file started playing at once. How come?
knapp.onRelease = Function(); {
minRamme = this.createEmptyMovieClip("clip",0);
minRamme.loadMovie("ann kristin.swf");
[Code]....
View 8 Replies
Aug 11, 2009
i'm at a frame inside has a button. once i click it will load a swf file flashmov.onRelease = function(){flash_mc.loadMovie("animation.swf");}but i have problem which is my animation.swf is way too big (800x550)and my flash_mc doesn't have anything inside.I want to resize to 480x330.
View 5 Replies
Nov 7, 2005
I am loading swf A into a mc within swf B.
loadMovie(dir/A.swf,target_mc);
How do I constrain the width of A so it is its' normal size? It wants to span the width of swf B. I tried adding "_width=470" but my syntax is not right and/or working. I am using Pro 8.
View 14 Replies
May 14, 2009
I have some external .swf's of different dimensions. I'd like to know if there is a way to load an external swf to the stage and force it to fit to 100% the size of the stage it is loading into?Also, is there a way to handle the antialiasing of the scaled clip to ensure smoothness / clarity. The swf's contain both vector and jpg's and when scaled down appear jaggy.
View 2 Replies
Oct 20, 2009
I'm loading a .png image with loadMovie() and I need to center the image (for later dragging). I know flash has some issues with loading stuff, but I really need to get the movieclip's width. If someone knows how to get over this and get the movieclip's width
This is a part of a more complex app, so that's why I won't paste any code.
View 3 Replies
Apr 6, 2011
I have three images and I want change the images size based on the scene size (default size is 1024x768). After each image has completely loaded I call bindableUtils.setter to set width/height when scene size changes but I don't know how to make a pointer or something like that. I'm using a public var img, but it only works with the last complete image.
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
[code].......
View 2 Replies
Feb 28, 2011
I've done quite a bit of digging but it's surprisingly difficult to find informed answers to these questions. I'm making a Flash game with a friend; as far as we can tell, the code is fine, but there are some serious framerate problems that seem entirely related to the graphics.
Is there a performance difference between Movieclips as JPGs and PNGs? Most of our graphics are imported as PNGs because they have transparent sections, but I don't know whether there is a performance difference between setting image compression to JPG or PNG within Flash itselfDoes turning on "Smoothing" for an image affect performance?Obviously larger graphics have more of a performance hit, but is there any benefit to splitting a large image into pieces? Example, changing a 2000*1000 background into two 1000*1000 pieces? One thing is most of our graphics are as much as twice the size in the library as they are displayed onscreen, then scaled in the code. We had wanted to make the game still look good when zoomed in/fullscreened but that doesn't seem practical so I'm planning on resizing all of the image files to their final size in the game and removing the scaling code. Hopefully that's the major part of the problem.
View 2 Replies
Jul 14, 2009
I have this for loop where I am circling through an array. I have swf's for each of the numbers like dropTarget_1.swf, etc. For whatever reason I can't seen to get this loaded into my holder.
When I hard code it then it works.
[Code]....
View 2 Replies
Jul 31, 2010
I'm trying to load an image and center it within a movie clip already on the stage.
function loadImage(){ image_mc.loadMovie("fullImage/"+imageNum+".jpg"); image_mc._x= Stage.width/2 - image_mc._width; image_mc._y= Stage.height/2 - image_mc._width;}
I know it's something simple and there are forums dedicated to this topic but I can't seem to view the code examples that the helpers are using.
View 3 Replies
Jun 24, 2004
What I am trying to do is simply load the images location using a string.Here is my Code.
Code:
//Load Images
image1 = "image.jpeg"
[code].....
View 2 Replies
Dec 18, 2009
Ok I have so many images for every html page. So what I want to do, instead of typing
pic.loadMovie("image1.jpg","_level2");
pic.loadMovie("image2.jpg","_level2");
I just want to call a variable like
PHP Code:
pic.loadMovie("loadImage","_level2");
Is it possible so that in HTML, ill just replace loadIMage with the real image1.jpg???
View 4 Replies
Jul 7, 2009
I have a movie clip called "play_btn". The timeline has 2 labels, "paused" & "playing" ... paused contains a movie clip called "playButton" and playing contains a movie clip called "pauseButton". playButton & pauseButton contain images of a pause button and a play button.I am trying to replace the playButton image using:
loadMovie("play.png", play_btn.playButton);
This works when the swf is first loaded but then if I do:
playBTN.gotoAndStop("paused");
playBTN.gotoAndStop("playing");
The original play image is back.Why, surely loadMovie should be overwriting the original image?
View 2 Replies
Dec 12, 2011
I'm creating a DVD with an image gallery, everything local. But the thing is my loaded images appears within flash, and not outside when I execute the swf. The path of the image is inside an array (from an xml file). If I write the path of my trace(array[x][x]), the image outside flash is shown. But when I write:
loadMovie(array[x][x].toString()) or loadMovie(array[x][x])
It doesn't...
I did a trace of array[x][x] and it shows me the exact path to the image..
Code:
_root.obra_mc.containerImg_mc.loadMovie("images/Patrimonio/Ceramica/"+(obras[0][1]).toString());
View 1 Replies
May 18, 2008
This is probably a beaten subject but even after reading many post a couldn't understand how to go about it.After doing the following:
PHP Code:
this.crateEmptyMovieClip("myMC",this.getNextHighestDepth());myMC.loadMovie("image.jpg");
-would it be possible to set the _x and _y of image.jpg relative to myMC?You see moving myMC and then loading the picture into it will not me because myMC is to be scaled and manipulated, so its axis must be in the center of the loaded image.
View 8 Replies
Aug 16, 2004
Does anyone know how this is made ? "LoadMovie Image Transition Effect"[URL]
View 1 Replies
Feb 16, 2009
I've got an image being changed based on a variable, and although the variable part and the actual image change is correct, the new image is coming up to the right and down from where the holder image was.
View 6 Replies
Jun 2, 2009
i am trying to write an image gallery using the loadMovie comand, loading jpegs into a blank movie clip the thing is, all the tutorials seem based around issuing the loadMovie command as you press a button to actually view that particular picture what I am trying to achieve is to have maybe the 1st and 2nd image of the gallery included in the flash movie and these load up and show instantly but whilst the viewer is looking at these the swf is busy preloading all the other images in the background. The idea being that images are loaded faster than the navigation that takes place so when the user clicks on the 3rd image it is already loaded and displays instantly and so on and so forth question is, how do i achieve this ? Do i still use loadMovie but have one script at the 1st frame that loads say all 20 images each into a different empty movie clip ?
View 7 Replies
Sep 10, 2009
I use attachMovie() to create a new instance of a movieclip, then I use loadMovie() to load an external PNG image into the new movieclip. That is working fine.
I want to be able to detect when the image has finished loading into the movie clip container. I need to detect this because I want to check the image width and height.
If I check the width and height right after I call loadMovie() it is returning the default placeholder size, instead of the new loaded image size. It obviously has not finished loading when I check it there.
View 1 Replies
Sep 10, 2009
I use attachMovie() to create a new instance of a movieclip, then I use loadMovie() to load an external PNG image into the new movieclip. That is working fine.I want to be able to detect when the image has finished loading into the movie clip container. I need to detect this because I want to check the image width and height.If I check the width and height right after I call loadMovie() it is returning the default placeholder size, instead of the new loaded image size. It obviously has not finished loading when I check it there.I am using ActionScript 2.0 but I can use 3.0.
View 1 Replies
Sep 10, 2009
I use attachMovie() to create a new instance of a movieclip, then I use loadMovie() to load an external PNG image into the new movieclip. That is working fine.
I want to be able to detect when the image has finished loading into the movie clip container. I need to detect this because I want to check the image width and height.
If I check the width and height right after I call loadMovie() it is returning the default placeholder size, instead of the new loaded image size. It obviously has not finished loading when I check it there.
View 3 Replies
Dec 6, 2009
Is there a way I can set a cookie or only allow an IP address to edit my XML with my SWF file only once a day?
View 1 Replies
Mar 7, 2010
I have a situation where my main SWF file loads many external SWF files. However, those external SWF files are just sitting in the public folder of the web server. Is it possible to restrict the SWF visibility to only my main SWF file (the one that loads the external SWFs). In the current state, any user who knows where to look can just type in the URL and get to the SWFs, not to mention rogue bots that don't follow robots.txt.The reason for this is very simple. Users user a username/password to log into the main Flash application and the main Flash application in turn loads the SWF files and ONLY then they are available to the user. Also, depending on who the logged in user is, some SWF files are restricted and not loaded.
View 2 Replies