ActionScript 2.0 :: Using Scale Function On MovieClip?
Jan 18, 2004
I am using the folowing as on a movie clip to scale it:
[AS]onClipEvent(load){
targe_width = _width;
targe_height = _height;
}onClipEvent(enterFrame){
_width = _width += (targe_width - _width)/3.6
_height = _height += (targe_height - _height)/3.6
}[/AS]
This as works fine but I have 30 clips that I want to apply it too. How can I turn this into a function i.e
[AS]function scale(targe_width, targe_height);
[/AS]
So on each clip I can invoke the function by calling something like
[AS] scale(50, 50); [/AS]
View 1 Replies
Similar Posts:
Apr 13, 2004
I i'm trying to make a scale function to control the _width of 2 or more movie clips. But the _width from the different clips is never the same. Is that possible with one function or do I have to make a seperate function for every clip?
View 9 Replies
Aug 6, 2010
I have some movie clips that when moused over, become visible. When clicked the clips are clicked on they tween to center-stage and zoom to fill the extent of my stage. One the zoom completes, I'd like the mouse over effect and function to no longer be active. I've been trying this by just making the mc invisible at scaleX>1. This does not do the trick...
if (allthings.NEZOOM.scaleX>1{
allthings.NEZOOM.alpha=0
}
The function that is running the MOUSE_OVER is called NEOVER and looks like this
function NEOVER(e:MouseEvent):void{
TweenLite.to(allview.allthings.NEZOOM, .5, {autoAlpha:.5,overwrite:true});
TweenLite.to(allview.allthings.NETXT, .5, {autoAlpha:.85,overwrite:true});}
Is there a way I could make NEOVER inactive after once I click on the NEZOOM movielip? The click event looks like this
[Code] .....
View 8 Replies
Jan 31, 2010
does anyone know a code which would let you drag and drop objects and also be able to scale them at the same time.
View 0 Replies
Feb 5, 2009
I have a re-size function on this website im working on for my BG to scale, my content to stay centered, and my nav bar to always stay top right. I need some sort of if statement saying if my navagation is 200px from the left it needs to stop moving. I hope that makes since.
[Code]...
View 2 Replies
Apr 22, 2010
I am trying to find the code to have my mc scale from 0 to 1 in AS3 on enterFrame.Unfortunately, I have researched and have found every solution but the one I need.
View 8 Replies
Jun 20, 2009
Is there a way to set the swf to scale apart from one MovieClip? I have a bitmap pattern which i dont want to change!
View 1 Replies
Jun 20, 2009
Is there a way to set the swf to scale apart from one MovieClip? I have a bitmap pattern which i dont want to change.
View 1 Replies
Jan 28, 2010
I'm trying to build a styled, rounded button movieclip that I can reuse/resize. So inside a movieclip, I have two layers:
Layer 1: A border, which is a shape - a rounded rectangle (or actually the stroke of a rounded-rect).
Layer 2: A nested movieclip which contains a shape for the face of the button. I have added filters to this nested movieclip to give it a beveled-type look - typical rounded button stuff.
So, I've tried applying scale-9 to the parent movieclip: in this case the border scales fine, but the face (with the filters) does not. So, then I tried applying scale-9 to both the parent and the nested face movieclip,I want to be able have the button self contained as a clip which I can pull from the library, drop on the stage, and scale without distortion - and so far, as mentioned,I can't figure out how the get the nested face, the one with the filters applied, to scale appropriately.
View 1 Replies
Aug 27, 2008
I tried to scale a MovieClip with the Tween class, using:
xsTween = new
Tween(main_mc,"scaleX",None.easeNone,1,2,2,true);
ysTween = new
[code]......
View 1 Replies
Jun 25, 2009
I want when the user click and dragg (Mouse_DOWN) the rotate button, the image will be rotatedAlso, when the user click and drag the scale button, the image will be scaled.Here is my code, but it dosen't work as I need:
btn_rotate.addEventListener(MouseEvent.MOUSE_MOVE, on_btn_rotate_down);
btn_rotate.addEventListener(MouseEvent.MOUSE_UP, on_btn_rotate_up);
function on_btn_rotate_down(e:MouseEvent):void
[code].....
View 2 Replies
May 5, 2011
I'm trying to change the y-scale or x-scale of a movieclip. I've tried a few tutorials but they're always talking about "elem._yscale".. However it's no longer supported by AS5.
View 2 Replies
Jun 26, 2009
I have 2 movieclips (btn_rotate, btn_scale) that are attached to a movieclip (view_mc) that holds an image.
These 2 movieclips are used to rotate and scale the Other movieclip as in the attached picture
I want when the user click and dragg the btn_rotate, btn_scale, the view_mc will be rotated and scaled respectively, in smooth way.
But I can't achieve that.
Here is my code which is wrong:
ActionScript Code:
btn_rotate.addEventListener(MouseEvent.MOUSE_DOWN, on_btn_rotate_down);
btn_rotate.addEventListener(MouseEvent.MOUSE_UP, on_btn_rotate_up);
function on_btn_rotate_down(e:MouseEvent):void
[Code].....
View 1 Replies
Mar 30, 2011
I have created a 3D product view page with a scrub bar that spins the object via 32 images taken of the object all the way around.
I would now like to add a zoom and pan function of some kind as well. Anyone have any suggestions or FLA files with this sort of thing? The 3D spin images are inside a movieclip, so I basically need a "+" and "-" button to scale the images up, and then be able to drag the movieclip around the stage too.
View 3 Replies
Aug 24, 2011
This is a test I'm doing, where I have movieclips inside my movieclip holder that scale up as I hover over and scale down when I'm no longer hovering. Here is the code for that:
ActionScript Code:
import flash.events.MouseEvent;
import flash.display.MovieClip;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.Event;
[Code] .....
This works great. The only problem I'm having is that if you hover over each of the items quick enough, they don't scale back down.
View 3 Replies
Jan 18, 2010
I have x amount of MCs arranged vertically with the distance between each being the same. When I roll over any of them the X & Y scale increases for that particular MC with a tween and on roll out they decrease to the MC's original size. Here comes the sticky bit...how can I maintain the distance between each when the scale of an individual MC is increased/decreased? I have attached a basic swf to show you what I mean. (Only the middle MC is active).
View 6 Replies
Sep 12, 2008
I'm looking for a solution to scale (gradually scaling) the movieclip on mouseover and return to previous state on mouseout. Any movieclip prototypes available for that
View 2 Replies
Nov 7, 2008
I have a movie clip which I want to scale up on a key press and then when the key press is not pressed I want it to scale back down. simple right? but I cant do it? Once I have that sorted out I would like to take it one stage further by making this work: If a key is pressed and let go the movie clip scale up and then finishes. if the key is pressed and held then the movie clip scales up slowly but once the key is released the clip reverse back to frame one.
The file can be found here : [URL]
View 2 Replies
Aug 3, 2010
If I wanted to get the global position of a movieclip inside another movieclip I just have to use localToGlobal. Is there anything similar I can use for _xscale and _yscale?If I have a movieclip which is scaled inside another movieclip which is scaled, how can I tell what the combination of those scales effectively become?
View 5 Replies
Apr 14, 2009
I'm using transform.matrix3D and transform.perspectiveProjection.get the scale effect, or z factor of a MovieClip?
var distanceRatio:Number = viewerDistance / (viewerDistance + z);
View 5 Replies
May 11, 2010
My_mc is a MovieClip. I want to scale My_mc on click event.
View 8 Replies
Nov 11, 2009
I have a movie clip object with a width of 306 and height of 194. I need to change the dimensions of the movie clip and still have the x and y scale set at 100. Currently when I change the movie clip width to 352.8, the x scale increases to 115.3%. I have to have the scale reset to 100% after I've adjusted the movie clip's width. Is there a way to do this in CS3? (this is all in design mode, not run time). Do I need to delete the movie clip and recreate it?
View 2 Replies
Sep 17, 2009
I am currently working on a website for a studio based in Sydney and have been developing (very basic actionscripting 2.0...) it for the last week or so, and up until now I haven't had a problem.
The site layout is simple and is essential 10 blocks stacked next to each other 5 on the bottom and 5 on the top. Each block is a button that highlights when a user rolls the mouse over.I have created the button animation as a movieClip which is being controlled by a Button symbol with actionscript on the button symbol:
[Code]...
View 0 Replies
Oct 18, 2009
In flash if I change scale of parent movieclip, scale of all child inside the parent was changed too. Now I look for the best way to fix child scale while parent scale is changing. I mean the way with minimum listener and cpu usage. In my project I have a map (as parent) and many icons on map (as childs). map has zoom in and zoom out button and pan while dragging.
View 2 Replies
Jan 19, 2010
I have a movieclip (tester) that I am locating on the stage via the following code:
ActionScript Code:
setStage();
var stageListener:Object = new Object();
Stage.addListener(stageListener);
stageListener.onResize = function() {
setStage();
};
[Code] .....
What I want to have happen is have it start in the defined location but when you drag the browser window open the "tester" movieclip scales up in size but stays centered on those cooridinates - basically as the window gets bigger I want it to stay in the same place but get bigger and be able to control ( by percentage) how big the movie clip grows as the window opens.
View 2 Replies
Sep 14, 2009
I'm trying to create this drag and drop sequence where the "temperature_small" movie clip is dragged and dropped onto a spot on the stage. I've got the drag and drop part of the ActionScript ready, but the trouble comes when I want to re-size the movieclip to make it smaller, I keep getting the error code:
[Code]...
View 4 Replies
Feb 2, 2011
[URL]while in "portfolio" section, if you resize, the content go to the left.I know WHY it does it : while in a MC, an external movieclip lose his stagesize to compress into the movieclip, if resize, it use the size of ALL the content in the SWF to resize. the external fla stage is 1600 x 680, but the content goes out of the stage to the right to make an 1760 x 680 size.to make it LOAD at the right place and right size, i've got a layer with a MC (externalStageSize) in the external SWF that is the size of the Stage, while on frame 1, only this MC(externalStageSize) is active, so when loaded, the _level0 flash can position and scale the external SWF.
BUT, while active content is on, any live resize does not go well..I tried to "connect" the scaling with (externalStageSize) BUT once loaded the size does not change.I wanted to use the math : "new width" = ("allcontent".width / externalStageSize._width)/Stage.width but _level0.ContentMC.externalStageSize._width return the value it have in the flash... like, even if rescale, it will say "1600" is there a way to counter this ? before you ask : AS3 was out of the question because the person who will maintain the site is not that advanced.
some script used when resize :
ContenuMC : the movieclip in witch external swf is loaded
Code:
function setContent() {
// content dimensions
ContenuMC._width = Stage.width;
[code]....
View 1 Replies
Jan 11, 2004
I'm trying to scale and move a clip through action script. And the end result is working - the clip ends up the size and position I want it to. The problem is the clip starts the scale action before the move position action. It seems to move to an arbitrary coordinate before starting the x and y move action. I'd like the move and scale actions to happen simultaneously.
Here's the code:
scaleAmt = 25;
((mainclip._x -= scaleAmt*1.71) and (mainclip._y -= scaleAmt++));
if ((mainclip._x<=-2880) and (mainclip._y<=-1680)) {
gotoAndPlay("e5_onStop");
} ((mainclip._xscale += scaleAmt++) and (mainclip._yscale += scaleAmt++));
if (mainclip._xscale>=500) {
mainclip._xscale = 500;
mainclip._yscale = 500;
}
I get the feeling I should put this into a for loop, but I'm not sure how to do it.
View 1 Replies
Sep 14, 2010
I have 4 movieClips on stage named text1, text2 etc. When I RollOver any one of them I have a tween which changes their xscale and yscale. So basically when you rollover they get bigger and when you rollout they go back to 100 scale.
What I want to be able to do is make it so that if I hover over item 3 then item 4's x position is shifted according to the scale of item 3. I ALSO want to be able to move items 1 and 2 to the left to account for the new scale. I can do this but only by moving things to the right, I cannot understand how to make items to the left of that selected update their x position to account for the scale.
the code I'm using is:
[Code].....
The onEnterFrame function is working but only shifting the x position of items that are on the right of that currently selected - it doesn't scale the selected item and shift things left and right accordingly.
View 4 Replies
Oct 2, 2010
I have a movieclip (mstone) depicting a signpost, which is within another movieclip (graphic1). I am trying to scale mstone to increase by about 44%, and it needs to move along the screen in such as manner that it is moving towards the user. Some how the scale and the x,y coordinates I am providing don't seem to reflect the same way as it normally would, when I see the website live.
Is there a smooth way to move the clip, without specifying particular x,y co-ordinates?? I am using the _xscale, _yscale, _x and _y properties. Not producing the desired effect.
View 5 Replies