ActionScript 3.0 :: Resizing And Constraining Proportions?

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


Similar Posts:


ActionScript 2.0 :: Resizing MC Fit Screen In Proportions (fla Attached)?

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

ActionScript 3.0 :: Auto Resize Flash - Keeps The Proportions Even If You Are Resizing The Browser ?

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

ActionScript 2.0 :: MC Resize And Constrain Proportions?

Sep 28, 2005

does anyone have an equation for resizing mc and constraining the prooprtions also.. through AS

View 6 Replies

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

ActionScript 3.0 :: Constraining 4 .SWF's On Site

Jul 15, 2009

I've got a problem with containing properly the .swf on my (main menu) site. Because the external .SWF's got a parralax effect it overlaps the swf above also the .swf is not nicely stretched out. This is the effect on my site that I want www.seniorict.com but as you look at the zip/fla(menu test) you see the complete file and how the effects are not working well.

[code]...

View 1 Replies

ActionScript 3.0 :: Constraining 4 .SWF's On Site?

Apr 8, 2011

I've got a problem with containing properly the .swf on my (main menu) site. Because the external .SWF's got a parralax effect it overlaps the swf above also the .swf is not nicely stretched out. This is the effect on my site that I want www.seniorict.com but as you look at the zip/fla(menu test) you see the complete file and how the effects are not working well.

code is

PHP Code:

stop();
var swfs:Array = new Array("home", "kandidaten", "opdrachtgevers", "contact");
var loaders:Array = new Array();

[code]....

View 2 Replies

ActionScript 3.0 :: Tweening Size Without Locked Proportions?

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

ActionScript 2.0 :: Fitting Images And Maybe Preserving Proportions

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

Constraining Custom Mouse Pointer

Aug 16, 2010

I am using the following code on the main timeline

Mouse.hide();
target.onMouseMove = function() {
this._x = _xmouse;

[Code]....

And on the movie clip (target) that i am using for the custom pointer, i've put

onClipEvent (load) {
startDrag(true);
}

How can i constrain the pointer to an area of lets say 800x600 ?

View 2 Replies

ActionScript 2.0 :: Constraining A Movement To A Rotate?

May 5, 2006

I am interested in rotating an object around a central pivot point, on command from two buttons (a + button, and a - button).

This file would essencially be a clock hand, or dot representing the hand, being rotated either clockwise or counter clockwise manually by a plus and minus button.

Things I am unclear about:

1) what forms of syntax, variables, etc, would I need to accomplish this task? I am unclear about the proper protocol for setting up this movement.

2) I have a specific background graphic that all this will be happing on top of, how do I find the desired pivot point coordinates (i am assuming the pivot point is defined by an x and y) in relation to my background graphic?

View 1 Replies

ActionScript 2.0 :: Constraining Movement >function_move?

Jun 12, 2009

I have a split screen view with a large image above and a smaller image underneath.There is a zoom window over the smaller image that when dragged around shows the larger image above it being moved at the same time (just that it's bigger uptop)

anyways I can't seem to constrain the movement of the smaller movie clip ... right now you can just click and drag it all over the place ... and I'll like for it to stay dragable only over top of the smaller image...and here is the code in the root.

// The base_mag_factor is the correlation of the small picture to the big picture...
_root.base_mag_factor = 5;
// The mag_factor will change as scaling occurs
_root.mag_factor = _root.base_mag_factor;

[code].....

View 1 Replies

ActionScript 3.0 :: Resize Containers Content But Constrain Proportions

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

Actionscript 3.0 :: Resize An Image But To Keep The Proportions Between Width And Height?

Mar 25, 2010

How can I resize an image, but to keep the proportions between width and height?

View 2 Replies

Flash :: Constraining/clipping Symbol Boundaries In CS5?

Sep 27, 2010

I want to create a MovieClip symbol of a certain width and height, but with content that extends outside its boundaries, with the option to have the external content be clipped/hidden or visible.

In Flex, the solution would be to create a group with .clipAndEnableScrolling = true.

Is there a way to do this in Flash CS5, or will the symbol always resolve to the size of its contents?

View 2 Replies

Actionscript 3 :: Constraining Number Of Children In A ViewStack ?

Mar 7, 2012

I have the following code to create a ViewStack which is used as a dataprovider for a TabBar:

<s:TabBar id="objectTab" dataProvider="{vs_objects}"/>
<mx:ViewStack id="vs_objects" width="100%" />

I want to constrain the number of children the ViewStack to avvoid the tabs going out of the screen when the user opens many tabs without closing any. I attempt to do this by removing the oldest element in the ViewStack when the user opens a new tab and the size of the ViewStack is above 9.

private function openTab(object:Object): void {
//Create a new NavigatorContent(form) and add it to the ViewStack[code].........

The image below illustrates my problem, where the dark grey color illustrates the selected Tab. There should only be one selected tab, which works perfectly fine with both the child selection approaches above, when i don't remove a child before selecting a new. When i remove a child and then open a new Tab, the new Tab does not get selected properly, it only gets "painted" in the selected color. In This case Tab 40 is still shown when i open Tab 41 (exceeding 9 tabs). The result of this issue is that Tab 41 is not rendered completely.

UPDATE: The problem was my AS3 code inside the childrens NavigatorContent's that caused the application to behave this way. The solution was using the callLater method:Doric's

code example:

protected function openTab():void
{
var form:Container = new Container();[code]............

View 1 Replies

ActionScript 2.0 :: Constraining StartDrag() To Diagonal Line?

Apr 23, 2008

I'm working on a volume slider for a type of jukebox and what I'm using is an actual drawing that is on an angle, therefore the volume slider and handle aren't in a straight horizontal line.I've done the basic code to keep the handle within the distance of my slider "line" (left to right), but what I have obviously just constrains it to a rectangle.

on(press){
this.startDrag(false,0,0,32,9);
}
on(release){
this.stopDrag();
}

The slider and handle are both at actual size, that's why it's only 32 pixels wide that I need it to go across and 9 pixels down. I do realize that for what I want, it's much more involved than this simple startDrag code with 4 sets of numbers in it.I'm including the source file in Flash 8/Actionscript 2.0.

View 3 Replies

IDE :: Constraining 'startDrag' To A Non Vert Or Horiz Line

Jun 29, 2009

I need to know if there is any way to constrain the mouse movements on a startDrag to a line that is not going vertically or horizontally. I'm sure I'll need to use some trig functions, and that's fine, I just haven't been able to find this done anywhere else.

View 4 Replies

ActionScript 2.0 :: Constraining StartDrag() To Trapezoid Shape?

Dec 30, 2011

how can i constrain the dragging of my movieClip inside the shape of a trapezoid? here's the code..

Code:
pamato.onPress = function()
{
startDrag(this, false, 1000, 270, 130, 605);[code]....

when i test the movie.. its a rectangle..

View 9 Replies

Actionscript 3.0 :: Proportions Work Fine But Movie Doesn't Start?

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

ActionScript 3.0 :: Constraining Mouse Cursor When Scrubbing Video?

Jun 21, 2011

Basically, I have a custom "scrub bar" graphic in which the user can drag a slider forward or backward in time to scrub/seek to a certain point in an external F4V.I have my slider constrained by a rectangle of 1 pixel in height. But when I click with mouse to scrub, my mouse cursor tends to move off of the slider graphic, causing problems with my MOUSE_UP event. (It can't trigger when my mouse is not over the target object).Is there a way like "new Rectangle(32,713,944.1)" to keep the mouse from moving in the Y-axis as the user drags the slider left and right to scrub video?

View 3 Replies

ActionScript 3.0 :: Constraining Full Browser Flash Site?

Jan 18, 2009

I'm making a fluid full browser flash site, and things are coming together nicely, but at some point, if the stage size gets too small (such as if someone is using a 800x600 resolution), things just don't look right. Things get all smooshed together and cause for a cluttered mess. To solve this, I put constraints on my stageResize function so the stage would only shrink down to a desired size. This worked great for the flash file, but I can't get the browser to add scroll bars are this point. I figured I would need a JavaScript file that would size the browser (or the div that contains the swf) and then constrain it as needed, but after digging around a few sites that perform the way I would like mine to, I am not seeing any such JavaScript files.
Example: [URL]

View 14 Replies

Flash :: Restrict/reset The Scale Proportions Only In Special Case That The StageWidth/Height Are Smaller Than The Movieclip?

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

Actionscript 3 :: Resizing A Sprite Without Resizing Its BitmapFill (or Its Contents For That Matter)?

Nov 1, 2010

I am not simply trying to contain things and have the container resize without the contents resizing. I would just use a simple MovieClip for that.. My main focus is on the use of BitmapFill. I'm trying to make a repeating background image for a container; thus far I'm able to draw my BitmapFill sprite to the size I want. (Which is the stage's height) but when the stage is resized, I want to re-size my container but have my containers BitmapFill crop or add more as the window is resized bigger or smaller. Allow me to illustrate what I mean:

I've got a simple rectangle sprite that fills with a bitmap from the library and a simple resize handler function that detects when the window has been resized.what I would like to do is have my rectangle resize to the height of the stage.stageHeight maintaining its bitmap fill, but not resizing the bitmap fill or any children within the sprite.

From what I've read, this is a little tricky because the sprite resizes in relation to what it contains.. or.. something like that.. I really don't know any more.. I saw one example where a person extended the sprite class but I don't know why or how..

in my library there is an image called 'pattern' and my code looks like this:

stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.addEventListener(Event.RESIZE, resizeHandler, false, 0, true);

[code]....

View 2 Replies

ActionScript 3.0 :: Smooth Resizing As Opposed Going In And Resizing Every File Manually?

Sep 11, 2009

I'm loading a few pngs/jpgs externally so they can be swapped out occasionally, and the issue I'm running into is when they are shrunk they become fairly choppy. Is there a way to have flash re-render them, or do something to smooth the resizing as opposed to going in and resizing every file manually myself?

View 1 Replies

ActionScript 3.0 :: Resizing A Sprite Without Resizing Its Auto-fill?

Nov 2, 2010

I've got a little problem with BitmapFill, I'm trying to use a sprite as a container for various things and i would like it to have a filled pattern background. my problem is that i want it to resize the sprite to the height of the window but not have the background fill resize, and add more / crop as the window size is changed. to illustrate what i mean, please view the diagram attached to this post .

I have an image in my library called 'pattern' and my code is as follows:

ActionScript Code:
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;

[Code].....

View 2 Replies

ActionScript 1/2 :: Resizing From Xml?

Mar 7, 2010

I'm loading in external images from XML, but they are coming in way too big; i have resized the actual images to the size i want them yet they still come in huge

function drawItem() {
coverImage.loadMovie(mediaFolder + currentNode.childNodes[2].firstChild);
coverImage.width = 600;

[code]....

View 1 Replies

IDE :: Browser Resizing The Swf?

Jan 23, 2009

I have a stage of 600x400 and in the publish settings I chose this same width and height (with pixels dimension, and scale: No Scale).And when I load the swf in a browser:

[URL]

It resizes the swf stage size.(I know this because I have a value which is positioned according to the stage width/height, and also because if I choose an opaque windowless I can see that it is bigger than I want it to be)Am I loading the .swf wrong?

View 2 Replies

IDE :: CS5 Banner Resizing?

Nov 11, 2011

I have made 1 Flash banner 728x90, the next one has smaller dimensions (468x60) but the proportions are the same so, I duplicated the document, grabbed the movie clip containing the animation and used the transform tool to make it the correct size.Some of the images need replacing as resizing didn't treat them well. But since I am trying to add them to the resized movie clip they appear too small.

View 2 Replies

ActionScript 2.0 :: How To Stop Resizing

Nov 26, 2009

My name is Robbie Lee and I make flash games for a living and recently I've encountered an issue that I was hoping one of you could help me with.In some of my games I use sprites made from jpg, gif or bitmap ect. which look nice when viewed at the correct size (550x400) but when I release the games webmasters often post them at incorrect sizes which causes the pixel based images to distort or look ugly which reflects poorly on my talents.

I want to know if there is anyway that I can code it so that the swf cannot be resized and always displays at 550x400 even if it's put in a window that is larger then that.I use ActionScript 2 and Adobe Flash CS3 Professional.[URL]

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved