Set X And Yscale?
Hello,
I know how to use the below code to set the x and y scale, but I want the change to happen slowly not all at once.
setProperty ("_root.Main.NewsLetterMC", _xscale, 150); setProperty ("_root.Main.NewsLetterMC", _yscale, 150);
I have tryed this:
But it does not seem to work very well.
startx = 1000; moved = 150 setProperty ("_root.Main.NewsLetterMC", _xscale, startx+(moved/14)); setProperty ("_root.Main.NewsLetterMC", _yscale, startx+(moved/14));
Please help Thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 02-11-2002, 03:18 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
YScale
This might be a stupid question, i'm not sure, but here goes. I have a rectangle that is 20 pixels high and 600 wide. Now when I push a button I want that rectangle's height to animate to a different height, depending on which button was pushed. For example press button 1 and the yScale grows from 20 to 250 pixels, button 2 and it grows from the previous 250 to 400. I got it so it changes the height but I want to know how I can make it animate through scripting from the current height to the new height determined by the button pressed. I hope I made this clear enough and not to confusing. Thanks for help everyone. I love you all. Haha.
YScale
This might be a stupid question, i'm not sure, but here goes. I have a rectangle that is 20 pixels high and 600 wide. Now when I push a button I want that rectangle's height to animate to a different height, depending on which button was pushed. For example press button 1 and the yScale grows from 20 to 250 pixels, button 2 and it grows from the previous 250 to 400. I got it so it changes the height but I want to know how I can make it animate through scripting from the current height to the new height determined by the button pressed. I hope I made this clear enough and not to confusing. Thanks for help everyone. I love you all. Haha.
Xscale / Yscale Help
Ok,
now I've got this walking figure....which follows the mouse on a delay and switchs it animation direction depending on the angle of the mouse...i.e. 180 is animates walking up..
now I've been playing around with the xscale...but can't seem to get it to work...or find any fla samples of scaling the xscale...basicallly the further the user drags the figure up the page..the smaller he gets..and vice versa...
any ideas?
anyone..
Xscale And Yscale
Hi, I'm trying to use xscale and yscale to zoom in on a mc.
Like this:
class Imagezoom extends MovieClip
{
function Imagezoom ()
{
onMouseDown = zoomClip;
onMouseUp = zoomStop;
}
function zoomClip ()
{
this.onEnterFrame = function ()
{
this._xscale++;
this._yscale++;
};
}
function zoomStop ()
{
this.onEnterFrame = undefined;
}
}
Problem is that it's like the mc that I zoom in on is moving its x and y coordinat when beeing scaled, - so its not ONLY zooming but also moving.
How do I compensate for this?
Kind regards
Godowsky
Is There A MAX Xscale , Yscale Value ?
is there a max xscale yscale value in flash? I have a BitmapData attached to a MovieClip. So when zooming I scale the the movieclip and when I reach approx 1200 I cannot see the Bitmap any more ??
thanks
cheers
firdosh
Xscale And Yscale?
I'm new to actionscripting, so any help would be appreciated...
I've got 5 seperate mc's which I want to increase in size (x and y scale) by 20% one at a time, so I want one mc to increase in size by 20%, pause for one second, then decrease to it's original size, then the next mc increases in size, pauses for one second then decreases... then once they've all done this to loop it over so after the fifth mc has animated it goes back to the first mc to animate again?
Does this make sense?
Thanks.
Yscale Problem
I have a movie clip that is meant to scale up at the same speed as a seperate clip now is there a way to easily do this?
on(press){
var dest_position = 100;
var dest_scale = 977;
var easeAmountlink = 11;
var easeAmountpink =22;
onEnterFrame = function() {
_root.links._y += (dest_position-_root.links._y)/easeAmountlink;
if(_root.pink._yscale<957){
_root.pink._yscale+=(dest_scale-_root.links._yscale)/(easeAmountpink/0.8);
trace(_root.pink._yscale);
trace(_root.links._y);
}
}
is the script Im using it should work but I can see why it doesnt Ive tried hacking at it now and Im making the code messy can any one help please
Xscale And Yscale
in the code below how to add yscale value?
Code:
var myTween:Tween = new Tween(_root.mc_bg, "_xscale", mx.transitions.easing.Regular.easeOut, _root.mc_bg._xscale, 100, 0.1, true);
Bug With Xscale & Yscale
Last edited by scrizz : 2005-07-12 at 13:57.
I've been working on a rapid prototype of a simple zoom and pan application for a client. I've got everything working in it but I have an annoying little bug that I cannot track in the file that causes the scaled image to zoom to its max zoom level when the reset button in triggered.
This only happens when the zoom button is used to zoom the image to its max prior to reseting the image...
I've tried several work aroounds with no luck. Any suggestions?
ActionScript Code:
// Object presets
firstFloor_btn.enabled = false;
resetFpPosition_btn._visible = false;
zoomIn_btn.enabled = true;
zoomOut_btn.enabled = false;
viewFloorPlan_btn._visible = false;
images_mc._visible = false;
instructionCopy_txt.text = "Click and hold to drag floorplan";
//
var fpXscale = floorPlan_mc._xscale=100;
var fpYscale = floorPlan_mc._yscale=100;
var fpXpos = floorPlan_mc._x;
var fpYpos = floorPlan_mc._y;
//
floorPlan_mc.onPress = function() {
this.startDrag();
};
//
floorPlan_mc.onRelease = function() {
resetFpPosition_btn._visible = true;
this.stopDrag();
};
// Fixes Drag bug
floorPlan_mc.onDragOut = function() {
resetFpPosition_btn._visible = true;
this.stopDrag();
};
//
viewImages_btn.onRelease = function() {
floorPlan_mc._visible = false;
zoomIn_btn._visible = false;
zoomOut_btn._visible = false;
resetFpPosition_btn._visible = false;
viewFloorPlan_btn._visible = true;
images_mc._visible = true;
instructionCopy_txt.text = "Click on thumbnail to view larger image";
this._visible = false;
};
//
viewFloorPlan_btn.onRelease = function() {
floorPlan_mc._visible = true;
zoomIn_btn._visible = true;
zoomOut_btn._visible = true;
resetFpPosition_btn._visible = true;
viewFloorPlan_btn._visible = false;
images_mc._visible = false;
instructionCopy_txt.text = "Click and hold to drag floorplan";
viewImages_btn._visible = true;
this._visible = false;
};
//
resetFpPosition_btn.onRelease = function() {
zoomOut_btn.enabled = false;
this._visible = false;
floorPlan_mc._xscale = fpXscale;
floorPlan_mc._yscale = fpYscale;
floorPlan_mc._x = fpXpos;
floorPlan_mc._y = fpYpos;
};
//
zoomIn_btn.onPress = function() {
floorPlan_mc.onEnterFrame = function() {
if (this._xscale<=300 && this._yscale<=300) {
resetFpPosition_btn._visible = true;
this._xscale += 5;
this._yscale += 5;
} else {
zoomIn_btn.enabled = false;
zoomOut_btn.enabled = true;
}
};
};
//
zoomIn_btn.onRelease = function() {
floorPlan_mc.onEnterFrame = function() {
zoomOut_btn.enabled = true;
this._xscale += 0;
this._yscale += 0;
};
};
// Fixes Drag bug
zoomIn_btn.onDragOut = function() {
floorPlan_mc.onEnterFrame = function() {
zoomOut_btn.enabled = true;
this._xscale += 0;
this._yscale += 0;
};
};
//
zoomOut_btn.onPress = function() {
floorPlan_mc.onEnterFrame = function() {
if (this._xscale>=101 && this._yscale>=101) {
this._xscale -= 5;
this._yscale -= 5;
} else {
zoomIn_btn.enabled = true;
zoomOut_btn.enabled = false;
}
};
};
//
zoomOut_btn.onRelease = function() {
floorPlan_mc.onEnterFrame = function() {
zoomIn_btn.enabled = true;
this._xscale -= 0;
this._yscale -= 0;
};
};
// Fixes Drag bug
zoomOut_btn.onDragOut = function() {
floorPlan_mc.onEnterFrame = function() {
zoomIn_btn.enabled = true;
this._xscale -= 0;
this._yscale -= 0;
};
};
As I said this is only a prototype so the code is very simple, nothing is dynamic at this point. The code needs to be optimized and refined but it works for the prototype (proof of concept) stage just fine.
View working sample here
Note: The working sample has been updated with my short term fix (see entrees listed below) and does not demonstrate the bug any longer.
Thanks in advance for any suggestions.
Yscale A MC Into The Distance A 3D Figure
function scaleAndResize () {
maximum = 300;
minimum = 100;
ySpace = (maximum-minimum);
setProperty (_root.figure, _yscale, (ySpace/100 *_root.figure._y);
}
I don't know....
Basically I wish to create y space between 100 and 300 pixels...which when rolled passed reduces the scale of the figure attached to the mouse between 50% and 100%
any ideas anyone?
Xscale Yscale Tweek
i've created a movie clip to hide the cursor, but I want this new cursor to get smaller as it travels from left to right on the screen. so my code so far is thus..
on clipevent (mousemove)
this._xscale=_root._xmouse
this._yscale=_root._xmouse
it works..yet I cannot control the size of the cursor movie.
I gets much to big on the left side and evaporates on the right. Does anyone know code that can control this function?
I've fiddled with
this._xscale=_root._xmouse-_root._ymouse*.8...
a friend's code, but to know avail.
kudos.
d.
Xscale And Yscale Problem Again
I have a picture in a mc.
If I click the picture my picture moves so that the place I clicked no is the center.
But I also want my image to xscale and ysclae (zoom), at the same time, - how do I do this?
regards
Godowsky
Quirk For Negative X/yscale?
Just noticed that using a negative scale value for _xscale or _yscale yields a reflection in that coordinate (e.g. _xscale=-100 flips the mc right to left). Although this should be a magnitude value and I don't see anything amongst my AS definitions, is this 'feature' well recognized? Of course then the question is can I then depend upon this behavior for all versions...
Xscale & Yscale Question
Hey there, I'm quite new to Flash and Actionscript, as I'm sure my crappy code will show you
I'm trying to make a map with zooming and panning functions, I just started on the zooming. What I've understood is that I'll need two nested movieclips, and that I'll use the outermost to zoom - by scaling it.
I've tried to use some tweens to make the zooming look okay, and thats fine.
However, when I use the - button to zoom out, the movieclip resizes not to the original size, but to some other dimension - check out the .fla to see what I mean. I think this happens because I resize the movieclip on the stage, because if I dont resize the clip after drawing it on stage, it scales correctly when zooming out.
How can I make the clip zoom correctly no matter what I've made the dimensions of the clip on the stage?
Thanks
_xscale And Yscale Problems
anyone knows how to make the AS code from this site, at the collections
section. http://www.viviennewestwood.com
I know that you need to know the localization of the mc and use the _Xscale and the _yscale, but how!!!!
thanks
Changing The .yscale With Actionscript, But With Movement?
Hello,
I am trying to use the code below to change the .yscale of a movie. I used the same code with success, but I was changeing the _y location. It would act as a tween a movie it into location and then slow down before it stoped. I am not able to duplicate the same function with the .yscale
_root.targetyScale = 400
starty = 100
moved = _root.targetyScale-100;
setProperty (_root.BackBox, _yscale , starty+(moved/8));
Can any one tell me what I am doing wrong and give me a hand with the code.
Thanks!!!!!!!!!!!
Yscale Of Mc Based On Mouse Coordinates?
What I have is a bolt of electricity to rotates around a fixed position to point towards the mouse, what I need to do is have it scale so that it always meets the end of the mouse pointer. How would I do this?
HELP: Xscale, Yscale Question (flash 5)
hello, im making a game with a large map, which is a movie clip, where you use the up and down arrow keys to zoom in and out of this large map. The problem is the zooming. im using x and y scale, and the zoom works fine if the movie clip is perfectly centered on the stage, but if it is scrolled over some, then it automaticle zooms toward the center, making it difficult to focus on parts of the map that are to the side. my question is, is there a way to make it zoom with the up down keys, but the zoom would be toward the center of the stage, instead of the movie clip, so you wouldnt get that pull toward the center?
Thanks!
XScale, YScale: Tricky Question:
Hello,
I am scaling two mc's. They start off at 100%, and when one is clicked, it blows up to 200%, while the unclicked one shrinks to 50%.
I need to be able to swapdepths of the clips, as they overlap when they're blown up (which i want). How can I say with actionscript" when mc1 is at 100% or greater, put it on top, and put mc2 on bottom. When mc2 is at 100% or greater, put it on top and mc 1 on bottom.
Here is what I have so far:
if (_level0.moveNav_xscale <= 101) {
_level0.mainNav.swapDepths();
} else if (_level0.moveNav_xscale >= 100){
_level0.mainNav.swapDepths();
}else{
//nothing
}
Thank you in advance,
Stage.height And Yscale Not Working Together?
Hi, I'm using a scalable SWF that will stretch for browser windows and I'm attempting to get a movieclip to stretch verticaly accordingly, using the following code:
mymovieclip._yscale = Stage.height;
However, it doesn't work. I tried tracing Stage.height and it worked, so why isn't it working with the yscale function?
Xscale And Yscale / Jpeg Quality
Hey all,
I am building up a simple zoom in zoom out on an externally loaded picture.
When I load the picture without applying any ._xscale and ._yscale to it, the resolution is fine but when I use the ._xscale and .yscale to the movieclip it is in, it blurs the image.
I don't get it.
I am posting bits of the code in case you are curious.
Thanks for your help.
Fabrice
//gets the info for choosing the right pix
mepixVar = new LoadVars();
mepixVar.load("indic.txt");
//loads
mepixVar.onLoad = function() {
z = mepixVar.pixRef;
this.pathToPics = "";
loadMovie(this.pathToPics+z, _root.photo.loader.recip);
_root.photo.loader.recip._quality = "BEST";
};
//code for zoom in and out
slider.onEnterFrame = function() {
x = ((slider.cursor._x)-40)*(0.66)+50;
_root.photo._xscale = x;
_root.photo._yscale = x;
};
stop();
Yscale Of Mc Based On Mouse Coordinates?
What I have is a bolt of electricity that rotates around a fixed position to point towards the mouse, what I need to do is have it scale so that it always meets the end of the mouse pointer. How would I do this?
Dynamic Textbox --- Xscale/yscale Question
Hi,
Basically I have a bunch of dynamic textboxes that import text, but some are much smaller than others, and I want to treat them differently.
Can I make a statement like:
Code:
if (_xscale.textboxname < 25 OR _yscale.textboxname < 25) {
import big text;
} else {
import small text;
}
Any help would be greatly appreciated.
Thanks
How Can I Retain The XScale, YScale, Height And Width Values.
Can you suggest a solution to the following problem:
I have a movie clip - instance '_root.box'.
I am using sliders to change the xScale, yScale (consequently, the height
and width ) of '_root.box', both uniformly as well as non-uniformly , using
ActionScript. I am also using a slider to set the rotation of '_root.box'.
Ideally, I want the user to resize a square into a rectangle and rotate it
by some degrees, come back and resize it again if he wants. I want to
maintain the xScale and yScale values even after the rotation, and start the
resizing from that point, which currently is not happening, .
I checked out
http://www.macromedia.com/support/fl...shrinking.htm. , but
its not solving my problem.
I am working on Flash 5/Windows 95.
I am sorry if I have dragged it long. I am just trying to explain the
problem as clearly as possible.
Thanks a lot in advance
Vinod Sharma
vinod@vsplash.com
Adjusting Xscale And Yscale Makes Jpegs Looking Crappy?
Hello...
I am doing some dynamic adjustments of _xscale and _yscale of images to create a zooming in effect... However, it looks really crappy instead of smoothly zooming in... if you pay attention to the straight lines it appears like it's moving around like waving or something... weird...
Here's the URL: http://edge.anchorwave.com/Simple.html
And here's my code for the slow zooming in effect:
PHP Code:
onClipEvent(enterFrame) {
this._alpha += _root.alpha_incr;
this._xscale += _root.scale_incr;
this._yscale += _root.scale_incr;
}
The images are dynamically loaded in using loadMovie (would that make a difference?) and also the SWF is published at 100% JPEG quality. So I don't really know. The original quality of the images are pretty high too... just take a look at some of them here:
http://edge.anchorwave.com/edge01.jpg
http://edge.anchorwave.com/edge02.jpg
http://edge.anchorwave.com/edge03.jpg
http://edge.anchorwave.com/edge04.jpg
http://edge.anchorwave.com/edge05.jpg
(etc.)
Any ideas? Thanks...
~j.
|