ActionScript 3.0 :: Tween MovieClips - Proportional Scaling X And Y
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
Similar Posts:
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
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
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
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
Sep 1, 2010
It was supposed to be an easy code but i can't make it work until now.I want my intro texts to get scaled to a certain postion when clicked .So far this is what I have done,
var scaleTo:Number = 0.6;
var introTexts:Array = [...];
for(var i:int = 0;i<introTexts.length;i++){ introTexts[i].addEventListener(MouseEvent.CLICK, onintroClick);}
[code]....
Right now,this code doesn't do anything, I can trace out "click" but nothing happen. I tried out the first item from the array first to make sure the code is working. The x position I want is -15 and y is 300.
View 5 Replies
Mar 21, 2011
This is a ridiculously easy problem but I'm drawing a mental blank at how to do it so in advance I apologize for the simplicity. I'm trying to get a movie clip to rotate and scale automatically without being clicked. I would like it to gradually rotate by 90 degrees and scale by 150%, but I can't figure out how to get a motion tween to do it and am having to do it manually frame by frame. What is the code to do this?
View 5 Replies
Jul 3, 2009
starting a new AS 3 website and (dont hit me) i must admit this is the first AS 3 site i am doing - it's going rather well but i do have a question. I woudl like to create a class that will draw a simple box outline based on dimensions i pass it. But i want the actual drawing of the box to be tweened. So the lines would start out as 1px lines and then tween to be say 100 px wide by 100px high. I have played around with several tweens on both boxes and lines and nothing has worked to my satisfaction. Problem is the lines get fatter as the width scales out. I am thinking that perhaps the only way to do this is to actually draw lines with line to in some loop on onEnterFrame but have not succeeded. So if anyone has an example of this please do share it.
View 3 Replies
Sep 1, 2010
I want my intro texts to get scaled to a certain position when clicked. So far this is what I have done,
Code:
var scaleTo:Number = 0.6;
var introTexts:Array = [...];
for(var i:int = 0;i<introTexts.length;i++){
introTexts[i].addEventListener(MouseEvent.CLICK, onintroClick);
} function onintroClick(evt:MouseEvent):void {
[Code] .....
Right now,this code doesn't do anything, I can trace out "click" but nothing happen. I tried out the first item from the array first to make sure the code is working. The x position I want is -15 and y is 300. I just test out something, the code is working when I move it out from the function.
View 3 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
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
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
Jan 18, 2008
I have been hacking together two different tutorials to create a menu with changing images, and some animating text. Everything looks great, except the menuitems, which i try to resize dynamically depending on the menuitem-movieclip-contained dynamictext. When i resize this movieclip, the whole movieclip scales, and everything looks odd.
this is my first flash project on my own, so be nice :-)
fla file can be found at: [URL]
View 2 Replies
Jul 6, 2008
Click on a thumbnail and the corresponding image is preloaded BEFORE scaling and moving smoothly from the thumbnail position to a target position. (the thumbnail is actually the container for the loaded image, and therefore also moves to the target) I have got everything to work, except that the thumbnail moves whilst the image is still loading. This problem defeats the purpose of the gallery, and I'm starting to get blurry vision now!
I hope I have made everything clear, but since this is quite difficult to explain, I have attached the fla and images. *You will need to simulate download in flash for the current preloader to work. P.s. much of the script was (heavily) adapted from an fla I found somewhere, in which the images are arranged into a circle.
View 6 Replies
Jan 20, 2005
I am loading some thumbnails (jpgs) into some movieclips using loadmovie. Easy enough. I want to scale the movieclip to increase the size of the thumbnail on rollover. The problem is when I use loadmovie and load the external JPG it sets the the JPGs default registration point to (0,0) and when I scale the thumbnail it scales from the top left corner. I would like it to scale from the center. This is the code I am using:
onClipEvent (load) {
var thumb = "thumbtest.jpg";
loadMovie(thumb, thumb_loader);
thumb_loader._yscale = 70;
thumb_loader._xscale = 70;
} on (rollOver) {
thumb_loader._yscale = 100;
thumb_loader._xscale = 100;
} on (rollOut) {
thumb_loader._yscale = 70;
thumb_loader._xscale = 70;
}
Is there anyway to change the registration point so it scales from the center and not the top left?
View 1 Replies
Mar 7, 2011
[URL]. I just created this piece which is two clips embedded in another. I used UILoader to embed each video, and I have scaling = true. Why is it that when I tab back and forth, the maps look slightly different every time? Shouldn't they scale exactly the same way every instance?
View 9 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
Aug 24, 2011
I am trying to port a pure Flash/AS3 card game to Flex 4.5.
It works mostly well, but I'm missing few puzzle parts there:
I've created a custom component based on UIComponent representing a deck of cards (which are an array of Sprites or MovieClips):
In the original pure Flash/AS3 game I was using Tween for the 3 cards at the table - to show the game user, who has put which card (by sliding them towards playing table middle):
import fl.transitions.*;
import fl.transitions.easing.*;
public class Deck extends UIComponent {
[Code]....
However Flash Builder 4.5 doesn't seem to know fl.transitions.* packages at all?
Like I've written the rest (my custom Flex component, moving card-Sprites around, etc.) works well. Only the Tween lines had to be commented.
View 2 Replies
May 31, 2011
I think this solution should be simple but I think I am missing something about using event.target.name.I have multiple (over 30) MovieClip images on stage with alpha of zero and I would like to have them fade in on MouseEvent.CLICK while removing the current image showing. While I can code it to work for a single image I want to use this.target.name to have more efficient code.
[Code]...
View 3 Replies
Oct 15, 2010
I am fairly new to AS3 and I have a page on my site that navigates between 3 different movie clips using frame based navigation. I have action script on each of the 3 frames to move between the movie clips and that works just fine but i can't seem to get the tween to work on more than just one movie clip. Here's the code from the first frame:
Code:
Select all//load page
page2.addEventListener(MouseEvent.CLICK, clickSection);
function clickSection(evtObj:MouseEvent) {
//go to the frame clicked on...
gotoAndStop(evtObj.target.name);
//animate between pages
new Tween(page2_mc, "x", Regular.easeOut, 0,260,1, true);
new Tween(page1_mc, "x", Regular.easeOut, 0,260,1, true);
new Tween(page3_mc, "x", Regular.easeOut, 0,260,1, true);
}
Whatever movie clip I put in the first tween will animate but the other two won't.
View 4 Replies
Jun 2, 2010
I've just started on my first AS3 project and have already run into a problem. Can someone please tell me why the following code is not working correctly. What's NOT happening is that the mc that is passed to the scalethis function is NOT alpha'ing to 0 and I can't for the life of me understand why.
PHP Code:
package
{
[code]....
View 7 Replies
Nov 29, 2009
i want to random load some movieclips i made with a tween effect.i made this code but it's not working good, i get some errors, maybe u fixing this code or come with another
Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
[code].....
View 7 Replies
Jul 24, 2009
How can I use the Tween class to apply filters to movieClips?
i want to apply a DropShadow through a tween so that it applys smoothly. Actually i want it to apply on rollover and remove itself on rollout.
View 1 Replies
Mar 3, 2010
I am currently working on a map of the US that is interactive. My goal is to be able to mouse over the states and have them turn red and then a window with contact information will open at your mouse when clicked. I am running into a few problems. I dont know the process for creating a color tween for my movieclips. my solution was to make a copy of the states, color them red and place them behind the gray ones and attatch an event listener to all the states that lowers their alpha when moused over. thats not really the problem though. for my code that i have used to call in the window is as follows. I will use texas as an example.
[Code]...
View 5 Replies
Oct 30, 2010
I'm having some trouble with the attached file, I've tried lots of things but just can't seem to control the movie clip. On click on 'Detailing' from the landing page a new slide *slides onto the stage 'content3'. Within this I have added a separate graphic with a tween 'gr_detailcopytest'. I want it to start only when it lands within the main stage's masked area. I also want the tween to stop too after its played out. I have tried adding a stop action at the end of the tween but this stops the tween altogether - Furthermore, when I click on another menu item and go back to 'Detailing' I want the tween to start again.
View 6 Replies