IDE :: Proportional Scaling MovieClips Relative To Stage?
Jan 30, 2009
how to proportionally scale multiple movieClips relative to the stage size.
I understand movieclip placement relative to the stage, and I have been using a code to scale MovieClips as a fullscreen background (also proportionally)
But
I can not figure out for the life of me how to scale other movieclips in relation
to the stage size.
for example I have a background_mc that proportionally scales with the stage
to fill without distortion.
HOW do I then place another MC say center aligned (I know how to do that) that will scale with the background without distortion?
Ideally I would like to place several MC's on my stage all scaling in proportion with the stage yet independently.
I have not been able to find any documentation on this. lots of tutorials on backgrounds and color fills and the like but nothing on proportional scaling of independent mc's
this is the code I use for my background_mc (can it be modified or should it be thrown out the window to achieve independent scaling?)
Code:
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
[Code]....
View 7 Replies
Similar Posts:
Jan 30, 2009
I need some assistance on how to proportionally scale multiple movieClips relative to the stage size. I understand movieclip placement relative to the stage, and I have been using a code to scale MovieClips as a fullscreen background (also proportionally) But I can not figure out for the life of me how to scale other movieclips in relation to the stage size. for example I have a background_mc that proportionally scales with the stage to fill without distortion.
HOW do I then place another MC say center aligned (I know how to do that) that will scale with the background without distortion? Ideally I would like to place several MC's on my stage all scaling in proportion with the stage yet independently. I have not been able to find any documentation on this. lots of tutorials on backgrounds and color fills and the like but nothing on proportional scaling of independent mc's this is the code I use for my background_mc (can it be modified or should it be thrown out the window to achieve independent scaling?)
[Code]....
View 2 Replies
Jan 28, 2011
I'm currently using the Tween-class to tween my movieclips (just the basics as x-position, etc.). But I'm struggling to tween scaleX and scaleY as the tween does not seem to take care of the centerpoint of the movieclip. I want the movieclip to scale proportional and not just from left to right.
View 3 Replies
May 6, 2010
I know but basically I want to place some images on the stage and I want every image, whether big or small, portrait or landscape, to be scaled to about a quarter of the stage size.
I have tried coding this myself and even tried many suggestions found on the web, but they all seem to do the same thing. The code either sizes every image to be equal in width and varying height, or scale every image to be equal in height with varying width.
Say you have some images all the same size, but some in landscape orientation and some in portrait orientation. Most of the code I found for "proportional scaling" would scale the landscape images okay, but make the portrait images the same height as the others, so they looked alot smaller. Or the reverse was true.
example:image.width = stage.stageWidth;image.height = stage.stageHeight;
( image.scaleX < image.scaleY ) ? image.scaleY = image.scaleX : image.scaleX = image.scaleY;
This makes all the images fit on the stage all right, but they all have the same width. reversing the equality amkes all teh heights the same.
If two images did not have the same width before they are scaled down, they should not have the smae width afterwards in my opinion.
Sometimes I get some code that seems to work, then I change the stage size to check it and all the images did not scale to 1/4 of the stage new size when the FLA was run.
View 4 Replies
Feb 23, 2011
i am looking for class or something to proportional outside scaling of stage and all included objects (internal or external).I know SWFfit and LiquidStage. I have got many problems with integrating SFWfit to my code (resizing is not affected to included objects). LiquidStage seems to be ok but it`s not freeware . I am looking for free possibilities to do it.I am trying to connect that with GAIA framework.
View 3 Replies
Jan 8, 2012
All though I can scale down the size of my objects and can shift them to their correct positions when scaling. I cannot shift them to the correct relative positions, relative to the screen centre.
Code:
level=1; //starting scale level
public function scaleOut(level:int) // scale to a level 1-4{
for (var r = 0; r < Main.ballArray.length; ++r){
// scale radius
Main.ballArray[r].bRadius *= (oldLevel / level);
[Code] .....
View 8 Replies
Nov 17, 2010
I have been following the instructions posted here on how to achieve proportional image scaling: http:[url].....I want to have one image background for one frame, and then another image background on another frame... so when the viewer goes to different parts of the site the scalable background image changes.I copy and pasted the AS3 code into the actions section for the frame:
//set stage for FBF
//set stage for FBF
stage.align = "TL";[code].....
It gave me a duplicate function error.So I changed all the variables 'pic' to something else... for example,'pic1'.Still didn't work. Then I changed 'sizeListener' to 'sizeListener1', still didn't work.Then I changed'scaleProportional' to'scaleProportional1' and it kind of worked, but keeps giving me the error that 'scaleProportional1' but still keeps giving me errors.how I can implement multiple instances of this scalable background script on multiple pictures without conflicts?
View 2 Replies
Jan 19, 2010
I have a Movieclip containing five images in a row. I have seven images inside a mc next to eachother like a T (Five across and three down) with one image being the center image. The images are under a mask an then the images tween on the X and Y but obviously only the masked part of the image is visible. The mask is 1280x649 and I was wondering how to proportionally scale only the masked area to full screen. I have the following code which works perfectly on a single image inside a mc but how do I do now?
Code:
stage.align = "TL";
stage.scaleMode = "noScale";
var picHeight = pic.height / pic.width;
var picWidth = pic.width / pic.height;
[Code] .....
View 7 Replies
Mar 12, 2011
I am using the following code to fill the browser window with an image and scale it up or down....works great. I would like to proportionately scale a mc but not have it initially fill the screen. It would start centered in the window at a initial size but then scale up as the browser window opens but not scale back down below it's original starting size.
this is the code for the full screen:
port1Height = new Object ();
port1Height = port1._height / port1._width;
port1Width = new Object ();
port1Width = port1._width / port1._height;
[code]....
View 0 Replies
Jan 27, 2012
I have the following code from FW to scale my background image while keeping proportion, however how do I change/fade into other pictures using Pic as my MC?
Code:
//set stage for FBF
//set stage for FBF
stage.align = "TL";
[code].....
View 9 Replies
Feb 11, 2010
I'm creating a simple liquid flash site layout with one MC that does not scale and remains at a constant position, and one mc that should stretch to fit either the height or width (whichever's larger) of the stage, but scale proportionally. [code]...
View 3 Replies
Jun 30, 2007
how do I code stage resize with scaling movieclips? I can do stage resize and position/scale movieclips relative to stage size..but i don't how to have a scalable movieclip retain its scale relative to stage size. how do I code this? for example, i have a movieclip originally 50px wide, and the stage 100px wide..when i click the mc, it scales up to 80px wide. and when I resize the stage to 50px,(50% of stage size) i want the mc to scale to 40px too(50% of mc size).. and when I click it again to restore to it's original size, i want it to scale to 25px(50% of original size). then finally when i scale the stage back to 100px, the mc again is 50px wide.
View 2 Replies
Mar 3, 2011
in flash AS1,2 you just input this code Stage.scaleMode="noScale";
on a frame of the main stage to prevent scaling of movieclips on fullscreen.I tried the same thing in AS3 and its not working for me. so my question is how would i apply this in AS3?
View 8 Replies
Feb 20, 2004
I have a dragable movie clip that on release I want to scale, depending on the mouse position, the further the mouse up the screen (y) then the smaller the clip scales on release.
View 6 Replies
Mar 11, 2008
I've search through all the threads with "scaling" and "resizing" and can't find the solution.
Basically I have a GUI element on a gallery that I don't want to scale, while the rest of the page is free to resize/scale.
I think I need to add a listener of some sort to the stage, but I'm not sure how to do this.
View 2 Replies
Aug 25, 2011
I am adding MovieClips in columns and rows according to the main container with static width and heightnow if user wants to enter for more rows and columnsHow I should change the Moviclips size that can adjust within main container ( Blue Box as in image )Image 1 : I am adding small white movieClips with default width and heightImage 2 : its required , small movieClips resized according to main container, when Rows and Cloumns are increased
View 4 Replies
May 16, 2010
I am creating a film strip of thumbnails and am dynamically creating the thumbnails from an xml file. All this works great. The issue becomes the fact that I need for the filmstrip to resize when the window is resized and add or remove the number of the thumbnails as necessary. In order to calculate where the last thumbnail should be, I'm using the following code to calculate the x position:
PHP Code:
var lastX = rightArrow.x - (thumbWidth + 10);
where rightArrow is actually filmstrip.filmnav.rightArrow. I get the correct answer - but when I add the thumbnail to the movieclip filmstrip.panelscontainer.thumbcontainer, it's actually on top of the rightArrow. Clicking on both of them to see where Flash thinks the X is will show that Flash this the X of the thumbnail is at 607 and flash thinks the X of the thumbnail is 731, which is as it should be -- so why is the thumbnail so far to the right?The first thumbnail should always be x=10 and that is working fine and I'm currently not trying to layout the other thumbnails because they were all screwed up with a similar problem.
View 2 Replies
Nov 21, 2011
How to position Objects in flash so that they stay like 10px from left no matter the size of flash movie. Something like in flex.
And how to embed Flash movie in HTML so that it all worked correctly?
View 2 Replies
Oct 19, 2011
I'm writing a web based flash app that's written entirely in AS3. I have objects on the screen as part of a GUI. I would like the user to be able to resize the window, or make it full screen. I would like everything to auto-scale with the resize, but also remain in the same relative position on the stage.
View 1 Replies
Feb 1, 2010
In AS3, how can you access a relative variable within a specific movieclip on the stage?I have a test file that changes the variable "myVar" in one of the displayobject movieclips drawn on the stage. I want to simply trace the current value of this displayobject's myVar for additional purposes.In AS2, you would achieve this by calling the instance name and then the variable contained within.Assuming 3 movieclips existed on the stage named Container1, Container2 and Cotainer3trace(_root.myContainer2.myVar);// returns Hello which is value of variable "myVar" within the movieclip instance named "Container2".How would you do this in AS3?[code]
View 6 Replies
Mar 9, 2010
I would like to position relatively a scroller in my application like below.When I scale the image, I resize the scroller...
<s:Scroller width="50%" height="50%" >
<s:Group>
<mx:Image
[code].....
View 2 Replies
Oct 27, 2009
I have a movieclip thats inside another movieclip..lets call them mc1 and mc2..
the problem is that I want to get the position of mc2 relative to the stage...and not to mc1..is there any simple way to do this?
View 1 Replies
Aug 10, 2011
way to position an array containing movie clips relative to the stage? Here's what I was trying...
import flash.display.MovieClip;
var one:MovieClip = new One();
addChild(one);
[code].....
View 5 Replies
Sep 15, 2010
I'm loading an external SWF file, which become a MovieClip, using Loader(). That part is working fine. I then need to scale the MovieClip to match the stage, so that when I set the width and height of the movie doing the loading in SWFobject, the MovieClip will scale too.
For example, the SWF being loaded may be 320x240, but we decide later that we want it to be 640x480 on the page. We can just change the width and height in the javascript call to SWFobject, and it should scale everything. To top it off, I'll need an AS2 version too because we might need to load AS2 SWFs.
[Code]...
View 3 Replies
Jul 8, 2009
I am building a project where I have 15 'islands' inside one big 'ocean' movie clip. I created navigation buttons so you can explore the Ocean movie clip and look around the islands. my problem comes when i want to 'zoom into an island'
So basically on the stage i have a movie clip called- Ocean_mc, and inside it are 15 movie clips, one of them (for this example) is a movie clip called GreenIsland_mc.
when a user clicks the GreenIsland_mc it needs to expand and place itself centre stage, then when clicked again in needs to colaps back to where it came from. The problem is that when GreenIsland_mc expands it needs to expand to coordinates relative to the stage, but when I shrink it back again it need to find the original coordinates relative to its place inside the Ocean_mc movie clip.
[Code]...
View 1 Replies
Mar 1, 2011
I'm developing my first flash app. I'm trying to use classes because they'll be very important in my future app. I created a simple movieclip with a star. However, instead of putting it directly on the stage, I'm calling it from library, using the addChild method to place the star in the stage. To do that, I simple right click over the movieclip icon->properties->check export to action script->and I give a name to the class (for example: myMC)
Then, inside the class I wrote:
package {
import flash.display.*;
import flash.events.*;
public class myMC extends MovieClip {
var star:myMC=new myMC();
public function myMC() {
[Code] .....
As I am placing the two variables origin_x and origin_y inside the constructor, I'm expecting to get 250 and 200 respectively. After drop the star, I want to send it to it's original place, and that's why I need to keep this values. And here's the problem, origin_x and origin_y are both ZERO, instead of 250 and 200... The value is not relative to stage. I managed a little bit and I found this post : [URL]. Unfortunately I tried to replace by the suggested code, but both values remain zero. An interesting thing, is that if I put the star directly in the stage instead of calling it from the library as I am doing, I get correct values in origin_x and origin_y.
View 1 Replies
Aug 5, 2011
I have a Flash file for an xml driven menu. There is the document Class, called Main. There is also a Navigation class. In the Navigation class, I position the location of main buttons and sub menu buttons for the menu. I want to position the buttons in the Navigation class relative to the stage. Currently, they are just fixed at certain positions (like 20); To do this, I have read that because this is not happening in the document class.
I must add an event listener to the constructor that listens for the added to stage event. I am not sure how to do this, as when I try and add an event listener for added to stage in the Navigation class nothing happens, (or all menu items diaspear). How to position movie clips relative to the stage (i.e. stage.stageWidth - 50) from a class that is not document class? How to do so in the document class, too.
View 2 Replies
May 17, 2011
If I have a rectangle on the stage, how do I find its top left tip (x,y) and the bottom right tip (x,y) in relation to the stage?
View 2 Replies
Dec 26, 2010
exactly as the title says, or is there a way to call up its original x,y coordinates like box_MC.originalX or something?
View 5 Replies
Nov 21, 2008
Is it possible to have a movieclip in FlashCS4 that can be scaled by the user once the file has been posted on the web? Scaled by dragging the corner of a loader or something?
View 1 Replies