ActionScript 2.0 :: How To Constraint Image Proportions
Nov 23, 2005
Im developing a full browser flash website for a photographer and I should make the pictures really big. Now my problem is that when you see the website in a smaller resolution than the one im using, images get too big. What i need is a function that resizes the image box according to the stage size, but I dont know how to constraint the image proportions. For instance I would make something that would do imageMc._width=Stage.width*0.8 so I could have the image with 80% of the screen size.... but how to make it proportional with height?url...
View 2 Replies
Similar Posts:
Jul 17, 2010
i placed a fullscreen background image in my website but when i scale my browser window it also scales unproportionaly (or distorted).
Code:
Stage.scaleMode = "noScale"
Stage.align = "TL";
bgTest._width = Stage.width
bgTest._height = Stage.height
[code]....
View 6 Replies
Mar 22, 2004
i have an image that follows my cursor when i click an 'on' button. But the image follows my cursor around the entire stage. What i want to do is have the image only follow my cursor when it is passed over a specific MC. So when the mouse is outside of the MC, it is a regular cursor, when it passed over the MC, it turns into the image without the cursor being visible.
View 7 Replies
Mar 25, 2010
How can I resize an image, but to keep the proportions between width and height?
View 2 Replies
Apr 15, 2012
I'm trying to improve a simple AS3 slingshot that is available at [URL] so that i can make it more realistic. I already changed it so that is possible to aim the ball in any direction, but now I'm trying to create a function that constraints the maximum pull of the slingshot to an elliptical area, preferably having the same two points of the slingshot as the ellipse two focus:
[Code]...
View 1 Replies
Oct 12, 2011
I'm doing liquid layouts, and resizing my images while constraining proportions. Here is the code I'm using:
Code:
image.y = (stage.stageHeight/2) - (image.height/2)
resizeMe(image, stage.stageWidth, stage.stageHeight);
//The resizing function
[Code].....
I want it to resize and totally centre itself in the middle of the screen. HOWEVER. I also want to nudge it down 100px, and THEN resize it. I'm having no luck with this though I can move it down 100 px, but then it resizes and positions itself as though it was still in the centre.
View 6 Replies
Sep 28, 2005
does anyone have an equation for resizing mc and constraining the prooprtions also.. through AS
View 6 Replies
Jul 24, 2007
use Flex which has a great constraint based layout system architecture by default, but in Flash CS3 there is no built in way to do this. To create intelligently resizing layouts, you have to manually resize each element on a stage resize event. This can create obscene amounts of code really fast, especially if you start to work in simple arithmetic to avoid hard coding in positions, such as "stageWidth-obj.x-obj.width" etc.
Is there any code library to do this for you built in AS3? I basically want something like this:
ActionScript Code:
var layout = new Layout();
layout.header_mc = 'left|right|top';
layout.left_mc = 'left|top|bottom';
[Code].....
View 9 Replies
Jan 11, 2004
I have an original flash site that has a preloader mc and it functions 100%.
[code]...
I take this preloader and dump it into a new site and it doesn't work... Now this new site is actually much larger than the original site and the swf for it is close to 2 MB.Is there a size constraint that makes using preloaders inefficient?I've tried making the preloader in another scene and still no go, maybe I should try the preloader and load the site with AS for loading an external swf? I've read a few post from the forum and I'm not sure I understand 'how' to get the preloader to match the % bytes of the externally loading swf...
View 2 Replies
Jul 28, 2010
I'm working on my portfolio site and would like to resize the background only like this site [URL]For resizing a flash movie, I tried this script
Quote:
Stage.align = "TL";
Stage.scaleMode = "noScale";
//size bg_mc to match stage size
[code]....
It succeeds resizing but is NOT in proportion
1. editing the script thus the picture resizes with contrain proportions?
2. I'd also like to have it centerized during resize.
View 5 Replies
Jul 19, 2009
My problem is that I want to scale my symbol in ONE specific direction. Up, down, left OR right. Flash automaticaly scales a symbol equaly to both sides, changes the x/y values of the opposite edge from the symbol, but I don`t want this.
I mean, I want to scale my symbols just like shapes. If I scale to the right, the left side stays on the same X/Y values.
I can`t do this on flash IDE nor in actionscript. I would like to know if there are any solution to both cases
I want this because in my movie clip I have a mask (a symbol made from a square) and I need it to scale upwards. But doing this by code makes it enlarge downwards equally screwing up my animation.
View 3 Replies
Aug 9, 2005
At the moment I am using _root.image.loadMovie(photo.jpg);to load a jpeg into a movieclip which results in the picture being loaded at its full size. Whats the best way to get it to fit to the "container" movieclips size.Also is there a way to get it to preserve its proportions so it doesn't stretch?
View 9 Replies
Sep 2, 2010
I am getting the following two errors:
1046: Type was not found or was not a compile-time constraint: GetSet.
1180: Call to a possibly undefined method GetSet.
I believe if 1046 is solved, 1180 will no longer be a problem. Here are the codes:
File: GetSet.FLA:
Code:
var myGetSet: GetSet = new GetSet();
myGetSet.publicAccess = "hello";
trace(myGetSet.publicAccess);
[code]...
Both these files are in the same folder. I dont understand why I am getting this error as the class 'GetSet' already exists.
View 2 Replies
Apr 13, 2011
I am developing an AS3 website (client's request) but have run into a little trouble. My template.swf contains a fixed Header/ Footer and is resized to fit the browser window. The middle content is resized when the browser is resized using:
[Code]
View 3 Replies
Apr 27, 2009
I'm trying to set up a dynamicstream for the first time but am getting these errors:1046: Type was not found or was not a compile time constraint: DynamicStream.1046: Type was not found or was not a compile time constraint: DynamicStreamItem.Do I need to import something in order to use the DynamicStream class?My script is:
import fl.video.*;
var nc:NetConnection = new NetConnection();nc.connect("rtmp://localhost/vod");
var ds:DynamicStream = new DynamicStream(nc);
[code].....
View 1 Replies
Sep 2, 2010
I am getting the following two errors:
1046: Type was not found or was not a compile-time constraint: GetSet.
1180: Call to a possibly undefined method GetSet.
I believe if 1046 is solved, 1180 will no longer be a problem. Here are the codes:
File: GetSet.FLA:
var myGetSet: GetSet = new GetSet();
myGetSet.publicAccess = "hello";
trace(myGetSet.publicAccess);
[code]....
Both these files are in the same folder. I dont understand why I am getting this error as the class 'GetSet' already exists.
View 2 Replies
Mar 18, 2011
I have an flv loaded externally. I've added it to a movieclip and want it to fill the stage as my background and scale proportionally. The proportions work fine and the movie seems to scale fine. My problem is the movie doesn't start right away. It shows blank until I resize the browser then it shows up fine.Here is the code:
Code: Select allimport flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;[code].............
View 1 Replies
Oct 19, 2009
Im trying to make a website in AS3 with a dynamic background-video that fills all the page in my browser and keeps the proportions even if you are resizing the browser like this:[url].....its almost working but i dont know what to do to force to keep the proportions of my movieClip and at the same, to fill 100% of my page .This is my code...I have a movieClip with the instance name: "bg".
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;[code]......
View 1 Replies
Feb 1, 2010
I'm trying to make a movieclip scale proportionally only if the item is being resize smaller than the current.Obviously I can use the ScaleX/Y values like so:
if (cont.scaleX < cont.scaleY ) { cont.scaleY = cont.scaleX; } else { cont.scaleX = cont.scaleY; }
I need to restrict/reset the scale proportions only in special case that the stageWidth/Height are smaller than the movieclip.
View 1 Replies
Oct 24, 2011
i want to rotate 3D an Image called img1 in Flex. I want to rotate it around y axis 180 degree. I can do this by using 3D effect already built in Flex but i want to do a bit more different. I want during rotating, there's another image called img2 appear on back of img1 (in default case, the image appear on the back is img1) and when rotating finish, the image will be img2.
View 2 Replies
Jun 6, 2011
I am working on an Image manipulation application which will be developed using Flash/ C#.Net. Is this possible to save the image manipulations (not the image) saved from Adobe Lightroom for a specific image & then merge these change sets with an image to make a new image using C#.Net?
Also, the application for image manipulation will be developed in the Flash/ Action Script. Please share some links as to how we can save the image manipulations for an image (not the image) so that it can be merged with an image later on.
View 1 Replies
Jan 25, 2012
I am changing image through flex every time i change it saved into server directory with same name(which i am referring to show). So when i refresh my page my browser didn't send new request to server since it's already in request.so didn't getting new image.Tip:- when i clear browser history it will come with new image
View 2 Replies
Nov 8, 2009
I have a Flash CS4 Professional version installed in my machine. Here is my problem.
1st - I'm importing an image to stage and set the width and height to match the image. (everything is good, no problem) 2nd - I am using the FLVPlayback components build-in from Flash CS4. It does load the video and everything. (everything seems good) 3rd - Publish the video to my local drive (everything seems good) 4th - I could play the video from my local pc and it loads fine and fast 5th - Upload everthing from my local folder to the Web server, it does display the background image but not the video. It has a white blank screen. What is going on? I copy the exact folder from local to server. What have I missed? How could I make the video to load?
View 1 Replies
Oct 14, 2009
I am trying to load a colour image and then it is changed to black and white image. Here I am using a mask. But it is not getting worked. The code that i am using for this purpose is attached following: import
[Code]...
View 7 Replies
Jun 3, 2011
I have a gallery where passing over the image a rectangle drops down showing the caption for the image. The informations are read from an XML file and some of my images don't have a caption, for those emails I want to avoid the tween.
[Code]...
View 2 Replies
Mar 23, 2010
I found examples in adobe site only to position the object where the mouse pointer is. But i have to place the image in the position of drag proxy image.
View 1 Replies
Mar 28, 2011
I have an image that doesn't fill the <mx:Image> tag because it's not the exact dimensions (it is too short) and I have maintainAspectRatio set to true:
<mx:Image id="theImage"
source="{data.photo_thumb}"
horizontalCenter="0"[code]....
The <mx:Image> tag has a fixed width and height (it's 100% of the tile size--this is in an ItemRenderer). How do I get the image to sit on the bottom of the <mx:Image> tag?
View 2 Replies
Aug 2, 2009
im messing with a movieclip symbol and i want to make a button, what'd i mean on Mouse over display/change this image in this X,Y cords or replace this image, something close to what buttonSymbol does but i want to make it using movieClip symbol...
and i have no idea how to do it.. i started like this:
[Code]....
View 0 Replies
Aug 17, 2009
I developing a site where on the homepage, there are about 6 images that rotate, but if you click on a sub link, a different image loads. But the problem is that, the first image has to cycle through before the second image loads. I want the second image to load immediately.
[Code]....
View 1 Replies
Nov 7, 2010
I'm trying to find out how to make a simple image gallery which changes image upon a mouse click on a button, when a button is pressed I want the image to slide in from the left into the viewable area and then when another image is selected I want the previous image that was viewed to remain in the screen and then the new image slide across over the top to replace the image.
I can get the images to slide across from the left upon a mouse click however I can't change the layer order so if image 6 is viewed and then I click to see image 1, the image will slide into place however it will be below image 6 so therefore not viewable.
I don't have an example of what I'm after but I hope my explanation was good enough, I've seen this been done in javascript but I have to use flash and am unable to replicate the effect I'm after
View 4 Replies