Xscale + 1
how would you code this for a button
on(release){ mc_blank._yscale = current size + 1 until size is 100; }
thanks e
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-22-2006, 04:10 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Xscale From L-R?
I've read this tutorial:
http://www.flashkit.com/tutorials/Ac...-689/more3.php
it contains a script-line:
this._xscale = ((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
The problem is when the move is being loaded, the fillbar is scaled from the center to both left and right, not from the left to the right. How do I make it scale from L->R?
Thanks
Xscale
Hi,
I hope somebody can help me...
i am "zooming" a movieclip using another
with a continous feedback.One with
_xscale--/_yscale-- and one eith a "++".
I would like to stop _yscale by 100%
of the movieclip. Does anyone have a "if-clause" dealing with the right parameters? thanx
Xscale?
Hey guys, just a quick easy question. I was playing around w/ some code i made and these 2 objects were supposed to line up where x = like 130000 but they were pretty far off. I looked at the debug and the values were within one but then i realized the x scale was like 99 and change. When i moved it to 100 they lined up. So is there a reason the x scale changed or what? like what is flash doing because i know i didnt tell it to change the scale.
thanks,
Dave
Xscale ...maybe?
Hi,
what I wanna do is something like you can see in the GIF attached.
How can I do that? I don't know much about AS...someone suggested me to use xscale conditions...but how?
do you know any tutorial about it?
Or can you help me in any other way?
Thanks a lot.
Ciao
A.
Xscale Code
hi,
i'm loading an .swf into an empty movie clip and then trying to resize it. it's not working, the .swf is loading but it isn't resizing. does anyone see anything wrong with this code?
loadMovieNum ("test.swf",3);
if(_level3.getBytesLoaded(4) == _level3.getBytesTotal(4)){
_level3._xscale = 50;
_level3._yscale = 50;
}
stop ();
thanks
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
[F8] Question With Xscale
I only started using flash a week ago, so im still really nooby. I made a preloader and figured out how to use xscale to make the loading bar move as you set it to bytesloaded/bytestotal.
Now lets say I wanted to make a similiar bar/picture move in the same fashion using xscale. How do I do that when I dont have the percentage to set it to like bytesloaded/bytestotal? I just want the bar to move progressivly farther till it reaches full size, but clueless how to do differently then the preloader.
Thanks a head of time.
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.
Xscale Issue
i ran into this thingamajing i don't understand y it happens. i have a movieclip on stage called "claro". then i duplicate it, and when i scale the duplicated Mc, both mc's scale, how come?
ActionScript Code:
i = 1;
duplicateMovieClip("claro", "claro" add i, i + 1);
setProperty("claro" add i, _y, 400);
["claro" add i]_xscale -= 50;
Xscale Problem
I've just got a simple mc on stage of a rectangle.
I want the clip to go from its full width, then scale down to nothing and stop.
ActionScript Code:
onClipEvent(enterFrame) {this._xscale-=5;}
The above code starts what I want, but I don't want it to continue into the negative.(if that makes sense)
So I came up with this but its not working:
ActionScript Code:
onClipEvent(load){ origWidth = this._width}onClipEvent(enterFrame) { if(origWidth>=126) { this._xscale-=5; }else if (origWidth<=0) { delete this.onEnterFrame; }}
I'm probably making this more complicated than it should be.
Oh, and '126' is the actual width of the clip in the properties inspector.
Thanks
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);
Xscale AS3 Problem
Hi!
Im getting started with AS3 and id like to tween a scale property from a Movieclip called "bluebar"
This is my code
import fl.transitions.*;
import fl.transitions.easing.*;
var largeur:uint = stage.stageWidth;
var hauteur:uint = stage.stageHeight;
var barrebleu:bluebar = new bluebar();
barrebleu.y = hauteur/2;
barrebleu.x = -500;
barrebleu.scaleX = 1;
barrebleu.scaleY = 1;
addChild(barrebleu)
new Tween(barrebleu, "_yscale", Strong.easeOut, barrebleu._yscale, 400,25);
This code doesnt work... seems to be in AS2
But this code work but it is not fluid
new Tween(barrebleu, "height", Strong.easeOut, barrebleu.height, 400,25);
someone would have the answer please!
Thanks
Xscale Problem
I've just got a simple mc on stage of a rectangle.
I want the clip to go from its full width, then scale down to nothing and stop.
ActionScript Code:
onClipEvent(enterFrame) {this._xscale-=5;}
The above code starts what I want, but I don't want it to continue into the negative.(if that makes sense)
So I came up with this but its not working:
ActionScript Code:
onClipEvent(load){ origWidth = this._width}onClipEvent(enterFrame) { if(origWidth>=126) { this._xscale-=5; }else if (origWidth<=0) { delete this.onEnterFrame; }}
I'm probably making this more complicated than it should be.
Oh, and '126' is the actual width of the clip in the properties inspector.
Thanks
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.
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.
Problem With Xscale Properties, Please Help
part of my assignment is to replace the mouse pointer with a movieclip. Ive done this. I have a problem, however. My movie clip is supposed to flip when the mouse is moving from left to right, or vice versa, so that it points in the direction of the movement. It is suggested that this can be accomplished by changing the xscale property of the MC, but my code does not seem to do what I want it to - the best I have accomplished is simply changing the pointer into a very very thin one, not flipping it.
Code:
onClipEvent (enterFrame) {
startDrag (this, true);
Mouse.hide();
if (this._x < _root.lastXPosition) {
this._xscale = -35; }
else if (this._x > _root.lastXPosition) {
this._xscale = 35; }
_root.lastXPosition = this._x; }
This is my code on the MC representing the pointer. Any help would be greatly appreciated as this is due tonight at 10!
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
Set Property/xscale = Animation
Hi,
I'm controlling the width of a rectangular bar on the main timeline via set_property/xscale. When the user enters a number and hits a button, it changes the percentage/length of the bar.
What I want to do is have the change gradually animate rather than instantly change.
Can anyone explain if this is possible and some pointers as to how I would do it?
thanks!
Menu Follow + Xscale
Im searching for a navigation like in this site:
http://www.euroafrica.com.pl/index1.php
Ive have one already but it doesnt scale it just follows.
Thanks guys!
Control Xscale Of Movies
Does anyone know how I can control the _xscale of a movieclip based on a value from an xml file.
I am creating a project for a fundraiser and I want to display the total for the event in a graphical format. Basically when you enter the site the bar will get a value from the loaded xml file and scale accordingly. So if my goal range is from 0-100 and the value that is loaded is 50, my bar will scale to the half way point.
I've got alot of this done but am still having some problems with using the value from the xml file. I included my files in case anyone wanted to take a look. thanks in advance.
Xscale Should Reset To Timeline Value
I'm animating a movieclip circle during my preloader by setting it's xscale and yscale values to match the percent loaded. OK and fine. However, when the percentage hits 99 and my playhead jumps out of the preloader loop, I want my circle to grow larger based on the motion tween I've set up on the timeline. But the circle stays the same size and ignores the scale values I entered for the motion tween.
How do I get it to recognize the motion tween scaling? If I never set xscale and yscale via actionscript, this is not a problem.
-aaron
Xscale Flip Problems.
Alright, I got this game with a whole bunch of guys walking back and forth randomly. I want them to face the way they are walking so I used something like this:
Code:
if (direction == 0) {
_xscale = 100
//face right
}else if (direction == 1) {
_xscale = -100
//face left
}else{
//stand still
}
Now the problem is the guys often think 100 xscale is facing left, not right. And they walk backwards. This only happens sometimes, which is strange. I'll test the movie and it will work fine, but if I try it over and over the guys eventually choose to walk backwards.
Can I flip these guys without Xscale, or am I doing this wrong?
[F8] XScale And Masks Trouble
I am trying to make the shield indicator and motion tracker from Halo 2, and the shield part of it is giving me trouble.
When the health goes down (gave it variable _root.healtht), it shrinks the xscale of the indicator that is a mask. But instead of just going from full to empty on the left, it squishes the image instead of shifting it.
Could someone please help me fix this?
Set Xscale Property From A Txt File
Hello... I am trying to set the width/xscale of an MC from the value of a variable in a txt file but it just isn't working!? Here's my code:
In my txt file I have:
ActionScript Code:
&fullone=38.95
&fulltwo=38.15
&fullthree=23.45
&fullfour=19.32
&fullfive=56.49
&fullsix=81.97
&fullseven=16.55
&fulleight=50.46
&fullnine=24.8
&fullten=12.62
&fulleleven=4.62
In my fla on a keyframeI have:
ActionScript Code:
loadVariablesNum("camp_info.txt", 0);
fulloneMC._xscale = fullone;
fulltwoMC._xscale = fulltwo;
fullthreeMC._xscale = fullthree;
fullfourMC._xscale = fullfour;
fullfiveMC._xscale = fullfive;
fullsixMC._xscale = fullsix;
fullsevenMC._xscale = fullseven;
fulleightMC._xscale = fulleight;
fullnineMC._xscale = fullnine;
fulltenMC._xscale = fullten;
fullelevenMC._xscale = fulleleven;
stop();
Changing Center On Xscale
Hello every one
am having a movie clip that am changing the xscale and the yscale with the mouse scroll
when i am scrolling its change the xscale and the yscale from the center of the movie clip
i need to know if i can change the center of be the mouse x & y.
thanks
Saef
[MX04] Resizing Mc WITHOUT Xscale
Hi there,
I'm having a problem which is very well known I think.
I'm having a buch of pictures of different height and width, which have to be loaded into different movieclips, and resized to 'bout 100px * 100px (so they're all the same size ~> thumbnails)
The problem width xscale and yscale, is that you have to specify the amount the movieclip/image resizes, in percentages instead of in pixels.
So my question, is there ANY way you can resize a dynamically loaded JPEG to EXACTLY 100*100 pixels ????
Here's my code (which doesn't work):
Code:
movieMain.thumbsHolder.createEmptyMovieClip("afbeelding" + j, j);
imageHolder = movieMain.thumbsHolder["afbeelding" + j]; imageHolder.loadMovie(path);
imageHolder._y = j * 200;
imageHolder._height = 100;
imageHolder._width = 100;
Hover Rollovers And Xscale
I have a project that uses hover captioins in a movie showing a the floorplan of the house. When a person scrolls over the room name, flash shows the room dimensions in the hover caption. The user also has the ability to rotate/flip the floorplan so they can see the alternate version of the plan. I use _xscale = -100; on the movie clip containing the entire floorplan and its captions. The problem is that the hover captions don't display when the plan is flipped... but it does show the background box where the caption text should appear. Thanks in advance for any help!
Here it is in action:
http://cibolacreative.com/taylorwood...41-acclaim.swf
Here's the code I used for the captions:
b1.onRollOver = function() {
captionFN(true, "13' Wide Standard", this);
this.onRollOut = function() {
captionFN(false);
};
};
b2.onRollOver = function() {
captionFN(true, "14'.10 x 12'.0 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b3.onRollOver = function() {
captionFN(true, "10'.0 x 23'.6 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b4.onRollOver = function() {
captionFN(true, "18'.5 x 9'.0 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b5.onRollOver = function() {
captionFN(true, "7'.9 x 10'.7 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b6.onRollOver = function() {
captionFN(true, "21'.10 x 14'.5 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b7.onRollOver = function() {
captionFN(true, "12'.4", this);
this.onRollOut = function() {
captionFN(false);
};
};
b9.onRollOver = function() {
captionFN(true, "12'.7 x 12'.4 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b10.onRollOver = function() {
captionFN(true, "10'.0 x 11'.0 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b11.onRollOver = function() {
captionFN(true, "19'.1 x 19'.4 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
b12.onRollOver = function() {
captionFN(true, "10'.0 x 11'.0 ", this);
this.onRollOut = function() {
captionFN(false);
};
};
captionFN = function (showCaption, captionText, bName) {
if (showCaption) {
this.createEmptyMovieClip("hoverCaption", this.getNextHighestDepth());
cap.desc.text = captionText;
cap._width = 7*cap.desc.text.length;
cap._alpha = 75;
//
if ((bName._width+bName._x+cap._width)>Stage.width) {
xo = -2-cap._width;
yo = -17;
} else {
xo = 2;
yo = -17;
}
hoverCaption.onEnterFrame = function() {
cap._x = this._xmouse+xo;
cap._y = this._ymouse+yo;
cap._visible = true;
};
} else {
delete hoverCaption.onEnterFrame;
cap._visible = false;
}
};
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
[MX04] Resizing Mc WITHOUT Xscale
Hi there,
I'm having a problem which is very well known I think.
I'm having a buch of pictures of different height and width, which have to be loaded into different movieclips, and resized to 'bout 100px * 100px (so they're all the same size ~> thumbnails)
The problem width xscale and yscale, is that you have to specify the amount the movieclip/image resizes, in percentages instead of in pixels.
So my question, is there ANY way you can resize a dynamically loaded JPEG to EXACTLY 100*100 pixels ????
Here's my code (which doesn't work):
Code:
movieMain.thumbsHolder.createEmptyMovieClip("afbeelding" + j, j);
imageHolder = movieMain.thumbsHolder["afbeelding" + j]; imageHolder.loadMovie(path);
imageHolder._y = j * 200;
imageHolder._height = 100;
imageHolder._width = 100;
LoadMovie() + Xscale Problem. . .
Hello all,
Here is the scenario. . .
I have a clipart gallery. Each piece of clipart is an external .swf and is very large (dimension wise).
I have a stage that I place empty movie clips onto and then call in the external swf. I know that I cannot simpley size the parent MC in order to size the movie being loaded using the loadMovie() method, I know that I need to use _xscale / _yscale because the movie being loaded will inherit from the parent.
However, I need the size of each to end up being the same but the original size of the .swf's changes.
Thus I cannot just set the same x and yscale for each parent MC.
Does that all make sense?
Any ideas?
Carousel - Messing With Xscale... Almost There...
Hi guys!
I am working with Lee´s carousel and was looking for a way to make the PNG´s thinner as the reach the carousel sides... For my surprise, I´ve managed to do it... at least most of it. Here is the funtion "mover" code:
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._yscale = s*100;
this._xscale = this._y-centerY; <--------------------------------------------take a look here
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._yscale) + 100);
}
With this adjustment, the PNG´s get thinner as they reach the sides of the carousel... That´s fine. Then, If I click on a PNG, the picturegets tweened and the dynamic text appears, as expected. The problem is that once I click on the selected image to get back to the carousel, it reappears all messed up! Can anyone give me a hand here? I feel that I am close...
Thanks in advance!
Here is the whole code:
import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;
var numOfItems:Number;
var radiusX:Number = 350;
var radiusY:Number = 75;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
var perspective:Number = 130;
var home:MovieClip = this;
theText._alpha = 0;
var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
t.icon._xscale = 35;
t.icon._yscale = 35;
t.r._xscale = 35;
t.r._yscale = 35;
}
}
function over()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sover");
sou.start();
home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}
function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}
function released()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
home.tooltip._alpha = 0;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,250,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,250,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,320,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
{
s.onRelease = unReleased;
}
}
}
}
function unReleased()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();
delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
{
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
}
}
}
}
}
function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
}
xml.load("icons.xml");
function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._yscale = s*100;
this._xscale = this._y-centerY;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._yscale) + 100);
}
this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/2500;
}
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,
Flipping A Controlled Character Using Xscale?
Hey guys,
I've just started to use Flash MX and am having trouble with flipping a controlled character on screen. Basically, it flips left and right fine on the first go but then reverses the second.
Here's the code;
MM = new Object();
MM.health = 3;
MM.speed = 10;
MM.endRun = 6;
MM.startRun = 4;
MM.state = "right";
MM.frameCounter = 0;
MM.xpos = MM_MC._x;
MM.ypos = MM_MC._y;
onEnterFrame = function () {
Mm_Run ();
trace (MM.frameCounter);
}
MM_Run = function () {
if ((MM.frameCounter<MM.startRun) or (MM.frameCounter>MM.endRun)){
MM.frameCounter=4;
}
if (Key.isDown(Key.RIGHT)) {
MM_MC.gotoAndPlay (MM.frameCounter);
MM_MC._x+=MM.speed;
MM.frameCounter ++;
MM.State="right";
}
if ((MM.frameCounter<MM.startRun) or (MM.frameCounter>MM.endRun)){
MM.frameCounter=4;
}
if (Key.isDown(Key.LEFT)) {
if (MM.state != "left") {
MM_MC._xscale *= -1;
}
MM_MC.gotoAndPlay (MM.frameCounter);
MM_MC._x-=MM.speed;
MM.frameCounter ++;
MM.State="left";
}
}
Basically, my character (megaman in this case) has an instance name og 'MM_MC' and he has 6 frames in total; the run frames i skip to are 4 - 6 then i loop back again whilke either the left or right key is down. I'm using 'MM.state' to keep track of which way he is facing...
Any ideas what i'm doing wrong (except trying to code with no skills)?
[F8] Xscale Movie Clip From Center?
how on earth can I scale my movie clip from the center easily? I have the following code attached to my button which scales the x and y up 5 when rolled over, but it does it from the upper left corner, not the center of the movie. This has always been a stupid quirk in Flash to me, as I usually would want the movies to default to the center, so how do i go around it?
I have these buttons placed specifically on the stage, thus don't want to dynamically attach them and use some suggested method where I place one clip inside another and use uneccesary math to decipher the center point of the outer clip...I just simply want to tell it to scale from the center rather than the left corner, and changing its orientation point on the stage doesn't do anything. There must be a way to do this though, otherwise how would it know to do it from the upper left corner?
if (_root.portfolio.briars.hitTest(_root._xmouse, _root._ymouse, true)) {
if ((_root.portfolio.briars._xscale<=105) && (_root.portfolio.briars._yscale<=105) ){
_root.portfolio.briars._xscale = _root.portfolio.briars._xscale + 5;
_root.portfolio.briars._yscale = _root.portfolio.briars._yscale + 5;
}
}
else {
_root.portfolio.briars._xscale = 100;
_root.portfolio.briars._yscale = 100;
};
}
Tween Class, Xscale To The Left
Hi, I'm using the tween class and have a rectangle which i would like to expand to the left. The only way i have been able to achieve this is if i pass my function a negative value, but this basically turns the rectangle over. Is there anyway to have it just start expanding for the left hand side out towards the left?
Lines Expanding With Xscale? (Flash 8)
I am trying to make a GUI component which can be scaled by the user. In this case, the component is a frame for a scaleable HP/Mana bar for a game.
The bar is split into three parts: left, right, and middle.
The left part is supposed to stay in place // works
The right part can be dragged horizontally // works
the middle part spans the distance between the other two. // problems!
The actionScript is on the MCs.
The dragging works fine with the right one, but the middle part has two problems:
1) it does not scale perfectly, leaving spaces. In this case, it has to be perfect or it will look broken.
2) the lines scale in thickness, which is obviously not what is intended.
I have included the file, if you take a look you'll see what I mean right away. Just try dragging the right end of the bar. Thanks in advance!
- Aesir
EDIT: This can be fixed with 9-Slice Scaling
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();
Q: Xscale On A Movie Clip With A Loadmovie Attached?
hi. here's my situation. i've loaded a movie onto a movie clip. then i use xscale and yscale on the MC to flip the loaded movie, using code like the following (flipVar equals wither 100 or -100):
_root.myClip._xscale = flipVar;
correct me if i'm wrong: for a regular MC without an swf loaded, this just sets the flip absolutely - if flipVar equals 100, it'll be normal and if it's -100, it'll be flipped... no matter what it was before this operation.
but it seems like with a loaded swf it sets it relative to how it was before the operation - if it was upside-down and flipVar is -100, it'll be right-side-up. is this all correct? if so, how can i flip a loaded movie absolutely?
your help is much appreciated!
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
Xscale Zoom Problem Flash Mx 2004
hi,
i am using the following code to zoom in and out on a movie clip. i do not want the clip to become less than 90% in size. the buttons work but it is possible to break the functionality as the clip size can get below 90 and the button becomes disabled. can i fix this with a loop?
any ideas much appreciated:
in_btn.onRelease = function (){
_root.inthemix._xscale*=1.25;
_root.inthemix._yscale*=1.25;
trace(inthemix._xscale);
out_btn.onRelease = function (){
_root.inthemix._xscale*=0.75;
_root.inthemix._yscale*=0.75;
if(inthemix._xscale < 90.000000000000) out_btn.enabled =false;
else if(inthemix._xscale >= 10000.0000000000000000) out_btn.enabled=true;
trace(inthemix._xscale);
}
};
thanks,
luke.
see it at www.lukem.co.uk (click on designs)
Q: Xscale On A Movie Clip With A Loadmovie Attached?
hi. here's my situation. i've loaded a movie onto a movie clip. then i use xscale and yscale on the MC to flip the loaded movie, using code like the following (flipVar equals wither 100 or -100):
_root.myClip._xscale = flipVar;
correct me if i'm wrong: for a regular MC without an swf loaded, this just sets the flip absolutely - if flipVar equals 100, it'll be normal and if it's -100, it'll be flipped... no matter what it was before this operation.
but it seems like with a loaded swf it sets it relative to how it was before the operation - if it was upside-down and flipVar is -100, it'll be right-side-up. is this all correct? if so, how can i flip a loaded movie absolutely?
your help is much appreciated!
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.
|