Scaling Using Actionscript...
i would like to know how to control scaling of an obj using actionscript instead of tweening...
I did this on the obj script:
onClipEvent (enterFrame) { i == 1; if (i<400) { this._yScale = _root.grid._yScale+10; this._xScale = _root.grid._xScale+10; } }
where did i go wrong? pls help
FlashKit > Flash Help > Flash Newbies
Posted on: 10-01-2001, 06:57 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Scaling With ActionScript
Hi!
I'm trying to scale a mc using the following code that I snagged from Canfield Studios examples:
onClipEvent (load) {
aScale = [25, 100];
nScaleIncr = 5;
nDir = -1;
nScale = aScale[1];
}
onClipEvent (enterFrame) {
if (nDir) {
if (((nScale+nScaleIncr*nDir)-aScale[(nDir+1)/2])*nDir<=0) {
// Calculate new value of scale properties in existing direction.
nScale += nScaleIncr*nDir;
} else {
// Otherwise, set nScale variable to boundary value (so it doesn't run over)...
nScale = aScale[(nDir+1)/2];
// and switch direction.
nDir = 0;
}
// Apply _xscale and _yscale property for this iteration.
_xscale = _yscale=nScale;
}
}
I'm not quite sure what this is doing other than it starts out big, and it gets small. I'm not sure what this is: aScale = [25, 100]; I'm assuming thats the x and y coordinates??
Also, my image looks pretty jagged (I'm using a .png file) when it finally stops.
Is there an easier way to scale from big to small (or vise versa) without having the final symbol looking jagged and pixely??
Thx!
Help With Actionscript Scaling
I have a rectangular shaped movie clip that needs to have its center point on one end so when it scales, one side stays stationary, while the other side moves. I went into scale mode and moved the white circle to one end to accomplish this and when I manually scale it, the desired effect is achieved. I then used actionscript to scale the shape when a button is pressed. When I run the movie, the symbol scales likes its center point is in the middle, not on the end. How do I fix this?
Scaling With Actionscript
I noticed that in MX when I move the pivot point let say to the right and then scale it using actionscript it still scales from the center. Has anyone else encountered this?
Scaling With ActionScript?
Hello all,
I have a presenation that allows the user to navigate through floorplans with arrows, reset position, and zoom in an zoom out options.
Currently, if you zoom in it zooms in based on the 'registration point' (edit center) of the MC using x_scale and y_scale scripting.
Is there a way so that when you zoom in, that it is based on the relative center of the point that is zoomed in? So that when someon is navigating the floorplans and need to zoom in on a specific area, that it zooms in based on the position of the map.
This is probably confusing but it is the best way i can describe it.
Any ideas?
Thank you,
Ynygma
Scaling With ActionScript
Hello all,
I have a presenation that allows the user to navigate through floorplans with arrows, reset position, and zoom in an zoom out options.
Currently, if you zoom in it zooms in based on the 'registration point' (edit center) of the MC using x_scale and y_scale scripting.
Is there a way so that when you zoom in, that it is based on the relative center of the point that is zoomed in? So that when someon is navigating the floorplans and need to zoom in on a specific area, that it zooms in based on the position of the map.
This is probably confusing but it is the best way i can describe it.
Any ideas?
Thank you,
Ynygma
X And Y Scaling Together In Actionscript
anyway to do this???
I want the MC to scale evenly and bounce back to original scale when key is pressed:
onClipEvent (load) {
var a = .6;
var b = 1.2;
var d = 0;
var i = (this._yscale)/(this. _xscale);
}
onClipEvent (enterFrame) {
d = (((this._yscale)/(this. _xscale)-i)/a+d)/b;
i -= d;
}
on(keyPress"i"){
i=200
}
please help ...thanks
Scaling Via Actionscript.
I have been reading tutorials for the past hour and still can't get this to work correctly.
I have 10 movies all arriving into the scene in the same manner. I would like to attatch a "onLoad" movement to them instead of "hand" animating them all one by one...
Here is the effect I'm looking for, simple I think..
http://www.noquo.com/help
I apologize for the obviously ignorant question..
Thanks
Schimke
Actionscript Scaling. Help Please.
Could someone kindly post some simple actionscript code to make an object bigger, then stop, then smaller? If not, just some actionscript detailing simple flash object scaling. Many thanks.
[F8] Scaling With Actionscript
Calling all Actionscripters!
HELP!
I am new to actionscripting (fairly) and I am stuck.
I am trying to create a series of buttons which scale up to 125% of their size when the mouse is rolled over and scale back when the mouse rolls out, tweening in between the two states.
I have found some clipEvent scaling but cant seem to make it work with the buttons.
I have attached the neccessary files for you to check out.
Many thanks to all
Long live CS3! May we all get a copy!
Neilb1969
[CS3] Actionscript Help With Scaling Please
Hello, I need help floating an object in flash. I am using actionscript 2.0 because some of the other coding stuff I'm doing will only work in that.
I am scaling an object called sight 1, in relationship to it's distance from the sight object. With some help I got this code to work for what I am doing, but I can't figure out how to make it scale smaller the further away it is, rather than larger, like it is now. Some of the code is moving the sight1 object around randomly. Thank you.
//Sight 1
sight1.goalX = Math.random()*(650 -sight1._width)
sight1.goalY = Math.random()*(515 -sight1._height)
sight1.xSpeed = 20
sight1.ySpeed = 20
sight1.onEnterFrame=function() {
this.xDifference = this.goalX - this._x
this._x += this.xDifference/this.xSpeed
this.yDifference = this.goalY - this._y
this._y += this.yDifference/this.ySpeed
this.xDelta = this._x - sight._x
this.yDelta = this._y - sight._y
this.myDistance = Math.sqrt(Math.pow(this.xDelta,2)-Math.pow(this.yDelta,2))
this._xscale += (this.myDistance - this._xscale)/this.ySpeed
this._yscale += (this.myDistance - this._yscale)/this.ySpeed
if (Math.abs(this.xDifference)<10){
this.goalX = Math.random()*(650 -sight1._width)
this.xSpeed = 5+Math.random()*20
}
if (Math.abs(this.yDifference)<10){
this.goalY = Math.random()*(515-sight1._height)
this.ySpeed = 5+Math.random()*20
}
}
Scaling In Actionscript
i havea photo, and when you click on it, i want it to enlarge to the stage size.
what type of code is needed to do that, since im doing it to multiple pictures, and i dont want to tween everyone
Scaling A Box (Actionscript)
Basically I'm looking for a tutorial to scale a "box" on the click of a button. For example my "box" is first 100x200, and when a button is clicked the box transforms (smootly) to 50x300.
Here's a visual of what im looking for: http://www.stefanbuechner.com/index.html (when the numbers are clicked the main box transforms to fit the image)
Thanks in Advance.
Help With Scaling W/ Actionscript
Help,
I'm new here, and I am trying to find actionscript that will allow an object to shrink width wise, and when it reaches a certain size, it reverses and starts to grow again, and then repeats.
Basically I'm trying to make as object look like it's spinning.
Any help would be AWESOME!!!
Thanks in advance,
Stephen
Scaling In Actionscript
i havea photo, and when you click on it, i want it to enlarge to the stage size.
what type of code is needed to do that, since im doing it to multiple pictures, and i dont want to tween everyone
Mask Scaling With Actionscript?
I have looked at the tutorials on the drag mask thing but need to get control over the scale of the mask and not the position. Any ideas.
Thanks
carter
Scaling With Bouncing (actionscript)
when my swf load a would like to my mc cube scaling and boucing ( when the swf load) so when the cursor on my timeline pass over the keyframe the action to scale start..
thanks you
Scaling Movieclip Using Actionscript
Hey guys...wasnt sure whether to put this in newbie or actionscript forum, so i just decided on here.
I have a movieclip that when you mouseover/rollover it, it swells just a bit, and when you roll off it swells back down. I didnt want to make a movieclip with a hittest and nextframe/prevframe - as i want to extend my knowledge of object manipulation directly in actionscript. Ive tried a few methods and all have proven non usful. Im sure this is an easy question for you AS gurus, but nonetheless a very useful trick. Thanks in advance!
Jesse
Actionscript Scaling Animation
Hi
I'm relative newcomer to Flash and I'm attempting to create some basic animation with Actionscript in Flash 5.
The effect I'm trying to achieve is made of a number of manipulations of the properties of a circle, created in Flash. I'm having particular trouble creating and controlling a 'throbbing' effect by increasing and decreasing the scale of the circle.
Basically, I want the circle to increase in size until it reaches a certain predetermined value, then decrease in size until it reaches another, predetermined value; increase in size, decrease in size, and so on...
Using variables, I've managed to get the circle to either increase or decrease in size to either the highest or lowest predetermined size value from its randomised starting size, at which point it stops as the conditions controlling the animation cancel one another out.
I can also get the circle to either increase or decrease in size until it fills the screen or disappears altogether!
I'm sure there is a way of using Actionscript to make the size of the circle bounce back and forth between my two predetermined size values, but it's beyond me.
Can anyone help or make a suggestion?
Many thanks in advance!
zeropaul
Moving, Scaling Via Actionscript
Here is what I want to do.. I just dont know the syntax or what the proper implementation would be (frame script I'm guessing).
Anyway here goes:
I want to have a symbol (any symbol) and perform this:
start on frame x
add 10 frames to x and move horizontally y pixels
add 3 frames to that and scale 150%
add 5 frames to that and scale back to 100%.
I should be able to apply this to any symbol and have it perform the above details from any frame in the movie.
If this is too confusing post a message and I'll try to explain more thoroughly.
Steven
Scaling Down Images Using Actionscript?
Ok, through trial and error, I have found that neither the _xscale nor the width property will work for an image, yet if I place that image in a movieclip, the _xscale property will work (the width still wont for some reason) Yet, I think I have found a way to achieve what I want. . . only the code is not working Could anyone please tell me what I am doing wrong, or if there is an easier way without resizing the images in a graphics editing program?
Code:
loadMovie("imgs/1.jpg", this.blank);
while(this.blank.width > 100) {
this.blank._xscale--;
}
(
I am loading 1.jpg into a blank movieclip called 'blank', I am then trying to tell flash that as long as the 'blank' movieclip is wider than one hundred pixels, I want it to decrease the scaling by one. It's as if the movieclip doesn't have a width property perhaps its a syntax error i am not seeing. Please help!
Scaling A Shape With Actionscript
If I draw a rectangle with no fill and a 1px border on the stage, I can scale it, using a shape tween and the border stays 1px. However, I need to create the rectangle with ActionScript and scale it with actionScript - does anyone know of a way to do this without scaling the border width as well? Would I have to redraw the rectangle for each frame of the animation?
Thanks lads,
CaroD
Actionscript Scaling Question
Hi there
If I use the code:
new Tween(myMC,"_xscale",Regular.easeIn,80,100,1,true) ;
This will scale an object from 80 to 100% of it's own width. How would I go about scaling it from say 50 to 75% of the available stage width??
If I just collect Stage.width, and insert that variable instead of the '100' in the above code, it would still interpret the number value of Stage.width as a percentage of myMC and scale it to 500% if the stage is 500 wide. (at least I think that's what it's doing)
Any help would be appreciated.
Cheers
Actionscript - MC Scaling Question
Hi. I've just started to learn actionscript and would like some advice.
This is a movie clip in the form of an aeroplane but it could be a rectangle or anything. The script to make it scale larger is OK.
I want it to increase in size and then make it STOP after a few seconds. Say for example when A becomes 150, or when the plane gets quite big.
Thanks for any tips.
onClipEvent(load) {
scaleA = 10;
x = 525;
y = 25;
}
onClipEvent(enterFrame) {
scaleA++;
x -= 5;
y += 5;
this._xscale = scaleA;
this._yscale = scaleA;
trace(scaleA);
}
Actionscript Scaling Function
Calling all Actionscripters!
HELP!
I am new to actionscripting (fairly) and I am stuck.
I am trying to create a series of buttons which scale up to 125% of their size when the mouse is rolled over and scale back when the mouse rolls out, tweening in between the two states.
I have found some clipEvent scaling but cant seem to make it work with the buttons.
I have attached the neccessary files for you to check out.
Many thanks to all
Long live CS3! May we all get a copy!
Neilb1969
Download sample files
Tutorial For Scaling W/actionscript
Could someone help me to point to a tutorial? I'd like to have 2 mc's that scale up or down depending on which one the pointer is over. When th epointer is over mc1 it increases and the mc2 decreases equally. I have tried searching "scaling with actionscript but I don't find anything remotely close, at least not on the first 140 topics found (or so).
Would be grateful for help
Tutorial For Scaling W/actionscript
Could someone help me to point to a tutorial? I'd like to have 2 mc's that scale up or down depending on which one the pointer is over. When th epointer is over mc1 it increases and the mc2 decreases equally. I have tried searching "scaling with actionscript but I don't find anything remotely close, at least not on the first 140 topics found (or so).
Would be grateful for help
Scaling Objects With Actionscript
Helo, I want to make this animation, where each plus sign increases his size to certain point and then stops and starts to reduce it's size and at some point the next plus sign starts to grow and than starts to become smaller etc. with each next object.. I've tried something but it didn't worked, here is my code and file, hope someone can help me with this.. Thank you in advance!
http://videotutorials-bg.com/stuff/plus.fla
http://videotutorials-bg.com/stuff/plus.swf
Code:
var size:Number = 15;
var speed:Number = 5;
var smalling:Number = 3;
plus.onEnterFrame = function() {
this._width = this._height += speed;
if (this._width >= size)
{
this._width = this._height -= smalling;
}
}
Actionscript Based Scaling Effect?(MX)
Can someone give me a quick tutorial on how to create a scaling effect with just actionscript in Flash MX? I can change the _xscale and _yscale properties of MCs but the change is instantaneous. I need something that would create a tweened scaling effect with just the script on the rollover of a button or movieclip. Any help would be appreciated.
[F8] Simple Scaling Actionscript? Any Ideas?
I'm looking for a simple actionScript that I can put on a timeline
that allows me to change the scale and alpha of 2 vector MC squares.
I need to be able to chage the size of these by clicking on
different nav buttons.
For example home | about |contact | etc.
Each section resizes and moves both squares to a specific part of the page.
(the squares will load content into them later)
There are so many (somewhat) simiar methods out there, but all seem
to have different purposes with alot of code that doesn't pertain.
I use a simple AS for changing the position of MC:
Is there something similar to change the size (with easing)?
onClipEvent (load) {
this._y = 71;
endPosy = 71;
this._x = -40;
endPosx = -40;
}
onClipEvent (enterFrame) {
movey = (endPosy-this._y)/3;
this._y += movey;
movex = (endPosx-this._x)/3;
this._x += movex;
}
Any help is much appreciated.
I think I found what I was looking for
thanks Pellepiano.
http://board.flashkit.com/board/show...ght=scale+ease
[CS3] Actionscript 2.0 - Changing Scaling Point
I have a movieclip that's a rectangle, and I want it to scale around a point that's on the bottom of the rectangle.
I can do this fine inside the IDE using Tweening, however, if i use the Tweener class like:
var tweenX:Tween = new Tween(etc, etc);
then it doesn't scale around that point I set inside the IDE but rather it seems to scale based on the top left corner.
Is it possible to change this?
Image Scaling In Flash With Actionscript 3.0
I'm having problems scaling images in Flash with ActionScript 3.0. The only way I can see to get the quality decent is by using smoothing, which drastically hurts performance.
The thing that confuses me is that I made the same site in ActionScript 2.0, targeting Flash player 7, and the image quality is fine when scaling even without smoothing. As soon as I target Flash player 8 (or 9 with Actionscript 3.0) the quality degrades when scaling.
Does anyone know any way around this so I don't have to move back to Actionscript 2?
Gradual Scaling Of Movie Clip Using Actionscript
Hi,
I have a movie clip which contains in the simplist sense 3 buttons for a menu. Lets say in the shape of a triangle with each button on a triangle.
Anyway, I've create basic actionscript that will scale the MC if a button is clicked. Right now, this is a button action but will eventually be a fxn to use for each button.
on (release) {
if (_root.nav._xscale && _root.nav._yscale == 100 )
{
_root.nav._xscale =_root.nav._xscale / 2 ;
_root.nav._yscale = _root.nav._yscale / 2 ;
}}
this works fine, but the change in scale is drastic. Is there any way to do this gradually with the effect of a changing scale with a tween.
Advanced Actionscript? Problem W/stage And Scaling
This is what I want to do:
1) have a "holder" swf that contains the background img and SCALES to fit the browser window.
2) have the "main" swf inside the holder that DOES NOT SCALE with the holder.
An example can be found here:
www.olivier-baldissera.com
so far I've been able to scale the holder to fit the window as I wanted using the "noborder" and 100%x100% html attributes. I've been fooling with the stage.onResize function and listeners, but they don't seem to work right, partly because I don't think they're supposed to be used with "noborder" set to true.
PLEASE HELP!
Scaling In ActionScript (or: How Cute, The Designer Thinks He Can Program ... )
Good evening everyone, hope you're all having a great weekend.
My question is going to sound very elementary and newbie-like, but I'm afraid I have to ask it anyway, 'cos I just can't figure it out.
Essentially, my Flash design is going to have some boxes that expand (from 0 pixels to, say, 500 pixel along the y-axis), and I don't want to rely on timeline animation anymore, and it bloats my files and doesn't have the same smoothness ActionScripted animations do.
So, my question is: How do I do that? And how do I add AS easing to those animations? And it it possible to scale an obect from right to left using the same method?
Um, OK, so that was three questions. Understand that I'm really an AS newbie, and any help on this topic would be very much appreciated.
Cheerio!
Xenon.
No Resize/scaling A Movie Clip On The Scaling Stage...
I know this has probably been answered here already, but 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. If you can point me to a thread where this has already been answered, great! Otherwise I would be grateful for any help you could provide here.
Scaling Dynamic Textfield Without Scaling Font
the titel sys it...
if you create a dynamic textfield...you drag it but you can not see the prcise idth value...so lets say i have a field and the width is 198,5 and i want it to be 200...the problem is if you scale...the fonts also scale...any ideas...
[9-slice Scaling] Not Scaling At Correct Size ?
Hi people,
I found something strange with the 9-slice scaling option.
My MC with that option is simply smaller than the one without it !
You can see an example here (fla in attachement).
with the simple code on the green button :
Code:
on (release) {
_root.i += 10;
this.scroller._height = _root.i; // the left one with 9ss
this.bar._height = _root.i; // the right one without 9ss
}
Does someone have any explanation ?
thanks
Scaling Cursor/Scaling Draggable
Hello.
I am trying to create a draggable movie that will scale depending on it's _x and _y coordinates.
Basically, when the movie is on the lower part of the screen it will be larger than when it's on the top part of the screen.
I would like the scaling to be smooth. I can say, "if this clip is above 100, then reduce by 10%", but it looks poor.
Does anyone have a nicer way to achieve this draggable scaling?
Thanks.
Scaling/preloader..scaling To A Certain Size..
Hi gang...ok...I have a percentage preloader using getBytes.....and I have a preloader bar that increases dependant on the percentage of bytesloaded...what I want is to have the preloader bar scale so that when the percentage reaches 100% the loader bar will be a certain width.
Here is my code so far....please help me edit my exixsting code..and NOT start just re-write the whole thing..I am trying to learn..and incorporate.
Code:
//In Frame 1 I have this:
total = this.getBytesTotal();
//In frame 2 I have this:
_root.growbar._xscale = percent;
loaded = this.getBytesLoaded();
percent = Math.round((loaded/total)*100);
displayPercent = "LOADING: "+percent+"%";
if (percent == 100) {
gotoAndPlay (4);
}
//In frame 3 I have this:
gotoAndPlay (2);
//In frame 4 I have this:
gotoAndPlay ("start");
I made an MC with the name of "growbar" on the stage....
I cant figure ot what I am overlooking...
-whispers-
p.s. Nevermind..I feel like a fool....I found it..LOL
Non-scaling Object In Scaling Movie
Does anyone know - Is it possible to have an movie clip, that retains a fixed pixel size e.g. 200x100 inside a flash movie that scales to 100% to fit browser window?
Scaling Shapes Without Scaling Strokes
Hello, I am a new Flash user. I am creating a simple animation to be used in an educational video. I created a graphic symbol which I have tweened in many instances to fade in/out and to grow in size. This is a simple circle without a fill, starting out with a solid 5 pixel stroke. How can I grow this symbol (it ends up at least 4 times larger than its original size) without growing the stroke as well?
Scaling Vs. Non Scaling Of Loaded Clips
Hi there,
I am trying to achieve the loadmovie whereby my container flash movie (main.swf) is 100%x and 100%y scaled in the browser...ie so it's size is dynamic to the browser size (This is fine...know how to do)
But want to load the internal clip at exact dimensions - ie I guess a loadmovie in a target clip or level? with exact x and y size dimensions that always centres in the container flash clip. ie. its size is constant no matter the browser size.
Look at this site for reference.... http://www.beachblanket.co.uk/
Thank you for your help!
Josh
Full Scaling Site + Scaling MC's
I have been trying to figure out how to do this, because I think it looks fantastic. I know that there are a number of things you add to the stage in order to get it to sit aligned right in the middle. I have even manged to ease the stage movements so that when you maximise and minimise by adding friction and acceleration, the movement is smoother and cleaner.
It looks like whatever is loaded into the MC expands and contracts the parent MC, with a border. The movement is seamless and I was wondering if anyone knows how to achieve the same effect.
I have gotten pretty far with it too, but I am momentarily clueless as to this part.
check it out
http://www.nulldesign.de
Scaling And Not Scaling In One Movie
Hi!
I´m creating a movie in witch I want curtain ellements (vector images) to scale to 100% of
the users screen and other ellements (pixel images) to stay at a fixed size and position.
Take a look at the following site:
www.hi-res.net
When you scale the browser window, the background photo scales with it; it stays fullscreen.
However, the menu stays at its original size.
The effect is possible without using html layers (see source of www.hi-res.net). Anyone
knows how to make this work within 1 swf through actionscripting?
Thanks,
Jef
Achieve Scaling After Scaling
The situation:
I have a header frame that could possible be a 1024 pixels, 800 pixels, etc, etc in width depending on the users resolution. Now, I want my flash file to span accross this space 100% which can easily be done in flash/html.
The problem that I have is that I don’t want the height to change and I don’t want anything distorting inside the flash file itself as an image would. I would like the flash interface to scale in the same way html does.
If you left align something, I want it to be at the far left with no change in actual size.
I have seen this done before with scrolling panes but can’t seem to find information on it anymore.
Any help would be appreciated
Thank you for your time,
Ryan Tate
Non Scaling In Scaling Part
Hi All,
really sorry to bring this one up again. I've managed to create quite good working gallery, thanks to cello and scotty. What I'm trying to now is create a menu that is attached to the scaling part but does not scale it self - in other words just changes position. here's an example of what I mean: galleru #1
gracias for your help,
m.
|