Slowing Down Objects
Is there a way to slow down objects without decreasing FPS or increasing the number of frames?
And can anyone direct me to a acceleration/deceleration tutorial?
FlashKit > Flash Help > Flash Newbies
Posted on: 03-22-2002, 01:27 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Slowing Down Objects Using Actionscript?
Hi peeps
I have a animation of some text moving across the screen using actionscript.
Now when it gets to a certain spot it stops but the only thing it stops to sudden, I would like it to ease in (slow down) into the point where its supposed to stop.
can anyone help me?? Here is the code that I am using:
onClipEvent(enterFrame) {
if (this._x<600) {
this._x +=10;
}
}
the .fla is attached
Cheers
Slowing Down Objects Using Actionscript?
Hi peeps
I have a animation of some text moving across the screen using actionscript.
Now when it gets to a certain spot it stops but the only thing it stops to sudden, I would like it to ease in (slow down) into the point where its supposed to stop.
can anyone help me?? Here is the code that I am using:
onClipEvent(enterFrame) {
if (this._x<600) {
this._x +=10;
}
}
the .fla is attached
Cheers
Slowing Down
Hi, can anyone give me action script formula to calculate a slow down movement of an image.
Slowing Down
when i test my game it is really slow, can anyone tell me why and how i can sort it. thanks
Slowing Down
hello,
i am new to flash and i was wondering if there is a way to slow down for loops.
Like i can set how many seconds till it goes and loops again. I have tried setInterval but didnt work.here is my code:
on (press) {
enemmyX = this._x;
enemmyY = this._y;
for(starX = _root.star1._x;starX>enemmyX; starX--){
_root.star1._x = _root.star1._x-1;
// Slow down function here
}
}
help will be appreciated.
Slowing Down ?
Very strange...
When I run my flash-movie in .swf format it runs at the framerate I entered in the document properties (40 fps). When I run the HTML file the swf is embedded in, the framerate seems to have dropped to a lower number (something like 25fps) . How come ?
s.
Slowing Down
hello,
i am new to flash and i was wondering if there is a way to slow down for loops.
Like i can set how many seconds till it goes and loops again. I have tried setInterval but didnt work.here is my code:
on (press) {
enemmyX = this._x;
enemmyY = this._y;
for(starX = _root.star1._x;starX>enemmyX; starX--){
_root.star1._x = _root.star1._x-1;
// Slow down function here
}
}
help will be appreciated.
Cpu Slowing
Hello guys!
Why my computer is slowing up when running my movie? (it's size is note very large! 120kb) ???
Regards,
http://www.inwww.ltd.uk
Slowing A FLV Down, How?
hi there,
a friend of mine wants to have something like www.yabla.com has. if you watch a video there and hit the SLOW button, you will see how the sounds (and all entire FLV) slows without changing the pitch.
how is that possible ?
they use the same FLV, as i saw i'm not loading a fast.flv and a slow.flv and changes between them. thanks.
Slowing Down Flash 4
I have a huge project where you, from a map-interface, get alarms in form of graphic indications.
This is done with variables loaded from an asp-script (about 300-400 different values and rising...!).
Now it seems to slow down the cpu so I had to extend the loop (done with the variables loaded in frame 1 and then in frame 100 return to frame 1 to load the updated values). I wonder if there are some things to think about or smart ways to work around this "slow-down" flash experiences?
Grateful for any suggestions regarding large amounts of variables/values that has to be read into flash...
Slowing Down MC Movement
I have a mouse trail and managed to retrict it within the main Flash rectangle using this script:
onClipEvent (enterFrame) {
trgt_y = _root._ymouse - _y;
_y = _y + trgt_y;
if (_root._ymouse < 0)
{
_y = 0
}
else if (_root._ymouse > 351)
{
_y = 351
}
}
However, what I want is the mouse trail slowing down smoothly to a halt in coordinate 0 when I move my mouse out instead of teleporting there. Thanks.
Slowing Movement?
Greetings!
I'm fairly new to Actionscript - here's my question:
Lets say I have a little movieclip that upon pressing the <Right> key I want to move right. I believe that I should:
1. make a variable equal to the clip's _x.
2. make a condition where upon pressing the <RIGHT> key, the variable will increase.
This I have accomplished with little to no trouble. Now the question is....how can I make it slow to a stop rather than just stop dead?
Slowing Down One Set Of Frames, But Not The Other, Is It Possible?
First off thanks to everyone who has hlped me in the past! I've really learned allot from doing just want you all said, reading, reading, and reading. I Still have allot to learn, but don't we all.
Ok now to the question, I'm not for sure if this can even be done, but this is Flash we're talking about. Ok here it is...I have a advance button, it shakes when the mouse is put over it, that not the problem, well it kind is but not really. My text is also always scrolling across the screen, this is what I want, but I want people to see the link, and for the shake to work the per frame rate has to be fast like 20 or something, but then that makes the main scene to fast, and the text FLY by. So would it be possible to slow down as a movie, but then keep the scene the same? I'm sorry if I didn't explane this good enough, I've been up for over 48 hours... Web Sites will kill you, and flash makes it even harder...lol.. Well thank you in advance.
Oh by the way I got my flash to load, and everything, I didn't upload the swf...lol but the whole page is about to change once agian so thank to thoes who replied!
Keep metal Alive, and The Flash Coming..lol.. m/
Slowing Looping MC
Howdy!
Need to know how to get an MC to start fast and slow down to a stop. Can't seem to figger it out. Please help.
Thanks in advance.
Joey
Slowing To A Stop
Anyone have a simple "engine" or example to study for accomplishing the following navigation?:
press a menu button and the "viewport" scrolls (starting slow-speeding up-slowing down-stops) to the appropriate position.
Slowing The Drawing API Down
Hi
First, if this thread appears more than once, sorry but I am having diffculty getting it on the forum.
My problem is: I want to draw the hierarchical structure of a business. eg CEo--GM--managers etc but I want the user to be able to see the chart as it is being drawn. Is there a way of slowing the process down or should I be looking at doing it another way?
I am using MX
thanks heaps
Slowing Down To Stop
Hellu.
I have an object(button) moving around a guide, which is a circle. is there a way to slow down to a stop on mouse over?
thnkz.
Slowing Problem
Ive made a menu with some wide images rolling at different speed, simulating a camera movement.
There are three layers rolling and the widests size is about 2300 pixels (height=400)
I dont know if the problem is the size or the quality (gif128 dithered) But the menu runs in an irregular speed and with some "shaking"
Then ive put the music file. It goes slower and with more shaking.
I WOULD REALLY APPRECIATE ANY HELP WITH THIS PROBLEM.
(sorry for my english)
Here you can see this menu project::
www.soda-europe.com/ramps/sodaweb
Slowing Down For-loops
Im trying to get a "for" loop to "step" more slowly for a text effect. The following code only works for very small interval times. When using larger interval times the function exceeds 256 recursion steps and returns an error. Does anybody have any ideas about how to solve the problem
Code:
interval=20;//sets the desired interval between steps
time=getTimer();//saves the current time
//checks wether the desired time has passed
function wait() {
if((getTimer() - time)<interval){
wait();
} else {
time=getTimer();
}
}
//test to see wther it works
for (i=1; i<20; i++){
wait();
trace("time: "+getTimer()+" i: "+i);
}
Slowing Down Player
Attached is a movie using (matrix special)effect (originally created by a flashkit user Jiminy,not me), problem is that it slows down the pc after some duplications and thus slows down everything. What should I do? also can anyone please suggest a suitable framerate for optimization?
Slowing Loop?
Hey.. how do I show this script down? It rotates a clock hand to 180 degrees but it happens too fast to see anything. (MX actionscript 1)
onClipEvent (load) {
second = 0;
for (i=0; i<750; ++i) {
trace(second)
_root.clock.arm._rotation = second;
second += 0.24;
}
}
cheers
Slowing Down When MC Loop
Hello dear,
Do you guys have any experience like me ?
When I use looping animation in MC (like using onClipEvent (enterFrame)), the other animation outside the MC become slowing down, but when I stop the loop, the animation become normal.
Any solution for my problem ?
Thanks in advance
Hairos
www.kairos-digitalstudio.net
Speeding Up - Slowing Down
hello all, i'm trying to draw a line but not with a regular speed.
In fact, i'd like to have an acceleration and deceleration once near the end...
For the moment i'm using this script:
keyframe1
------------------------------------------
var=0.85;
------------------------------------------
keyframe3
------------------------------------------
if(mc._width<790){
mc._width = mc._width+var;
var=1.75*var;
gotoAndPlay(4);}
else {gotoAndPlay(2);}
------------------------------------------
But as you can see the script doesn't include deceleration
anyone can help
thanks
Expression For Slowing Down
Hello
Could someone please help. I need to modify the script below so that the scroll goes slower (making faster is easy: _parent.body.scroll -= 1*5) but i dont know how to do it.
onClipEvent ( enterFrame ) {
if (lmouseover) {
_parent.body.scroll -= 1;
}
}
Thanks
Kuli
Slowing A Script Down
I have re-wrote an old piece of code that was a function into a class. It runs so quickly I need to tell the code to wait for half a second at 1 point so the flash movie can ketch up. I tried "break();" but it breaks the script and what I really want it to do is hold on and I don't want any listners related to the wait. I know there is a statment in flash for this can someone please point me in the right direction.
Thank you for all the help.
Quince
For Slowing Down Game
I've run into a standstill with a game I'm making. My game is sort of an overhead city type thing, and it's going to have lots of walls, and lots of people. I didn't want to put if statements for every single person, because I'd end up with an incredible amount of if statements in an incredible amount of walls. What I'm doing now is this (in the walls):
onClipEvent (enterFrame) {
for (i=65; i<90; i++) {
peoplecounter = "_root.person"+chr(i);
if (this.hitTest(peoplecounter)) {
tellTarget (peoplecounter) {
_x -= 20;
}
}
}
}
With each person named personA, personB, personC, and so on. The only problem with this is that it slows the game down an extreme amount when I have a bunch of walls. So, my question is: is there a better way to do this or a way to speed it up? I've made and attached an example with just the problem, so download it and see what you can do. Thanks.
.swf Slowing My Site Down
lads and lassies!
i have put my first site online(hip hip??!)
www.thedearborn.com
BUT its very slow on loading...i only have 4 images on it...well 5...
how can you make a .swf smaller and quicker to load without losing quality in images...
the .swf is 211kbs
HELP ME!!!!!!!!!arrrghhh
cheers everyone
.swf Slowing My Site Down
lads and lassies!
i have put my first site online(hip hip??!)
www.thedearborn.com
BUT its very slow on loading...i only have 4 images on it...well 5...
how can you make a .swf smaller and quicker to load without losing quality in images...
the .swf is 211kbs
HELP ME!!!!!!!!!arrrghhh
cheers everyone
Slowing Down Rotation
i want to make a rotating movieClip that gradualy slows down and finally stops rotating.i use following script for my movieClip but it just slows down the rotation to zero and starts rotating conversely!
onClipEvent(load){
speed=100;
}
onClipEvent(enterFrame){
if(speed>0){
speed--;
this._rotation+=speed;
}
}
it doesnt pay attention to "if(speed>0)" !!!
Slowing Down Scene
I have a file with two scenes in it. My client wants to slow down the whole intro scene. I would like to do this without having to go in and manually stretch all of the frames. I also want to leave the files framerate where it is because changing it will effect my other scene. Is there an easy way to do this. Is there an easy way to stretch all the frames (edit multiple frames?) along out farther on my timeline or possibly controlling the framerate through actionscript? Any help would be greatly appreciated.
Thanks.
Please Help Animations Slowing Down
I'm under the gun for time, so I hope someone can help me!
I have some large FLV files that I am linking to (40MB), and everytime the video plays, all of my other Flash animations slow down to a crawl.
I posted in the video forum earlier, but since I've tried a bunch of different FLV sizes, I'm not sure if it is just a general Flash issue. I've checked the Windows Task manager and only about half of the CPU and Memory are being used.
I'm using Quicktime Pro to do the FLV conversion and have tried all of the various settings.
Has anyone been able to have large video playing without a major slowdown of regular Flash animations?
Any input is appreciated. Thanks!
- Kent
Code Slowing
Hey,
I have a clients website that's www.jayhunting.com and seems to run fine until i run it on IE.
The problem is that it sometimes misses code out, i'm not too sure what the reason is.
This function checks if the images are loaded and then goes about setting properties for the border and the image location.
Is there a way to slow the code down? I tried using an if statement, but it does repeat the code so if it's false it just misses all the code out.
code:
loadListener.complete = function(eventObj) {
_root.firstimg = true;
width = image_mc.mcload.content._width;
height = image_mc.mcload.content._height;
image_mc.mcload.content._y = 0;
image_mc.mcload.content._x = 0;
pos = (600-width)/2;
if (pos>0) {
image_mc.mcload.content._x = pos;
} else {
image_mc.mcload.content._x = 0;
}
with (image_mc.mcwhite) {
_width = image_mc.mcload.content._width+20;
_height = image_mc.mcload.content._height+20;
_x = image_mc.mcload.content._x-10;
_y = image_mc.mcload.content._y-10;
}
fadein();
};
Here's the error, only when the code seems to have been missed:
Thanks in advance
Slowing Down Scrolling
I have a scrolling text with this on the mc containing the textbox:
onClipEvent (enterFrame) {
if (down == "1") {
this.text.scroll += 1;
}
}
onClipEvent (enterFrame) {
if (up == "1") {
this.text.scroll -= 1;
}
}
It's working fine but it's really fast - too fast 2 read! Is it possible to slow it down?
Also - i have MX professional 2004. Why isn't there a scrollbar in the components panel - there's only the scrollPane...
Hope anyone can help me :-)
Slowing Problems
I have a couple of issues I need help with.
My swf. files slowing down when I view them on a webpage. When I publish the fla. file and view it in internet explorer it slows down dramaticly. When I view the swf. file itself it plays correct. I don't have any sound in the project and the file is only about 16k. I know its not a hardware issue. Has anyone had this problem before?
Also when I used to publish my work I was able to just use a regular "EMBED" tag in html code to place the swf. file on a webpage but now it will not allow me to do that. Is this a recent thing?
Any assistance would be great.
Slowing Issues
I have a couple of issues I need help with.
My swf. files slowing down when I view them on a webpage. When I publish the fla. file and view it in internet explorer it slows down dramaticly. When I view the swf. file itself it plays correct. I don't have any sound in the project and the file is only about 16k. I know its not a hardware issue. Has anyone had this problem before?
Also when I used to publish my work I was able to just use a regular "EMBED" tag in html code to place the swf. file on a webpage but now it will not allow me to do that. Is this a recent thing?
Any assistance would be great.
Program Slowing Down
I have written a program for educational purposes with the following characteristics. There are 3 scenes: opening, table 1, and table 2. The only difference between table 1 and 2 is the size of the text table and fonts (table 1 makes a large number for movement, while table 2 gives a smaller font with paragraphed instructions). After the opening scene is initiated it references the frame at table 1, which uses the following code:
keyListener=new Object();
keyListener.onKeyDown=function(){
if(Key.getCode()==Key.TAB){fscommand("quit");}
events();
}
Key.addListener(keyListener);
stop();
The script "events" is located in the first frame of the opening scene and acts globally as an event generator. If the event is a number, it will go to table 1, else it will go to table 2 WHICH uses the same code as table 1 (same listener reference == keyListener).
if (W<=70){_level0.gotoAndPlay("table1");}else{_level 0.gotoAndPlay("table2");}
All works well; however, as the program is used, the response time gets longer and longer, which I am sure is related to completion of executions and piling on events. How do I prevent the slowdown?
Thanks!
Slowing Down A Loop... But Not Too Much.
I'm trying to get a movie clip to shrink and fade away on the click of a button. If I just do a "for" loop, it happens so fast it appears to be instantaneous. So I did this:
on (press) {
var i:Number = 100;
Reducer = function(message){
i--;
setProperty(_root.open_movie, _yscale, i);
setProperty(_root.open_movie, _xscale, i);
setProperty(_root.open_movie, _alpha, i);
}
ID = setInterval(Reducer, 1);
}
This works, but with two problems I can't seem to figure out
1. How to get it to stop!
2. How to get it to go faster. Before it was instant, now it's sort of sluggish, even at the fastest speed (1) I can set it to.
I'm using Flash 8.
And I'm sure the above code is ugly - I'm still figuring out Actionscript.
Any help is much appreciated!
[CS3] [AS2] Keyboard Slowing Down The Swf
I'm trying to move my character around on the screen. When I use the mouse it's just fine. But if I try to use the keyboard it starts lagging the game and drudging along. Both the mouse and keyboard are using the exact same code to move the character but the keyboard lags it so bad that it doesn't really become a viable option to move the character. For that matter, even if the keyboard isn't supposed to move the character, if I hold down any key on the keyboard regardless if it serves a purpose in the game or not it'll lag the game. Any suggestions?
Slowing Down Code
I have these two loops in a functions to make a rectangle grow
while (a < w)
{
contentA.expandContent._width = a;
setInterval(1000);
a++;
}
while (b < h)
{
contentA.expandContent._height = b;
setInterval(1000);
b++;
}
first the width then the height.
I am finding that they grow so fast you actually dont see it...grow.
I want to slow down the loop so i placed in intervals...
fristly i dont know if thtas the right thing to do?
Secondly the interval function isn't working...
i also have this same problem when coding the alpha of an object slowly increasing.
Can anyone advise.
ilan
Slowing Down An Animation
I don't even know if this is possible... but I am trying to control the speed of an animation...
What I have so far is incredibly simple...
Code:
onClipEvent (enterFrame) {
this._rotation = random(5);
}
unfortunately, the movieclip looks like its having a seizure and I want it to have a more fluid motion to it...
Anyone know how to accomplish that?
Slowing Down A Movieclip By Using AS3
Please Help. I Have Been Trying To Figure This Out For Days Now. I Want To Slow Down A Movie Clip By Using Actionscript 3.0 Without Moving The Keyframes In The Timeline Or Changing The Framerate. I Know I Can Either Use The Enterframe Or The Timer. Please Help. Thanks.
Unload() Slowing Everything Down
I have multiple .swf linked to one another. but using the unload() function, so i can remove the swf is causing my flash to play very very slowly.
any ideas?
ActionScript Code:
stop();
about.buttonMode = true;
contact.buttonMode = true;
portfolio.buttonMode = true;
var request:Loader = new Loader();
about.addEventListener(MouseEvent.ROLL_OVER, overAbout);
about.addEventListener(MouseEvent.ROLL_OUT, outAbout);
about.addEventListener(MouseEvent.MOUSE_DOWN, downAbout);
function overAbout(MouseEvent):void{
about.gotoAndPlay(2);
}
function outAbout(MouseEvent):void{
about.gotoAndStop(1);
}
function downAbout(MouseEvent):void{
request.unload()
request.load(new URLRequest ("AboutMe.swf"));
request.x = 0;
request.y = 0;
addChild(request)
gotoAndStop(2);
}
portfolio.addEventListener(MouseEvent.ROLL_OVER, overPortfolio);
portfolio.addEventListener(MouseEvent.ROLL_OUT, outPortfolio);
portfolio.addEventListener(MouseEvent.MOUSE_DOWN, downPortfolio);
function downPortfolio(MouseEvent):void{
request.unload()
request.load(new URLRequest ("Portfolio.swf"));
request.x = 0;
request.y = 0;
addChild(request)
gotoAndStop(2);
}
function overPortfolio(MouseEvent):void{
portfolio.gotoAndPlay(2);
}
function outPortfolio(MouseEvent):void{
portfolio.gotoAndStop(1);
}
contact.addEventListener(MouseEvent.ROLL_OVER, overContact);
contact.addEventListener(MouseEvent.ROLL_OUT, outContact);
contact.addEventListener(MouseEvent.MOUSE_DOWN, downContact);
function downContact(MouseEvent):void{
request.unload()
request.load(new URLRequest ("Contact.swf"));
request.x = 0;
request.y = 40;
addChild(request)
gotoAndStop(2);
}
function overContact(MouseEvent):void{
contact.gotoAndPlay(2);
}
function outContact(MouseEvent):void{
contact.gotoAndStop(1);
}
My Machine's Slowing Down
I notice that my machine is gradually slowing down each time I test my project. I keep having to reboot about every 100 tests.
I've read this stuff about removed objects remaining in memory and not being garbage collected. Is the memory still locked even after Flash player closes?!?!
Unwanted Slowing
I have a gallery-flash/AS thingie all set up, just one little annoyance: For picture frames I use a pre-drawn box that I scale down to the size of the picture like this:
on the _root -level I have a movie called picture.border which has the following nested within the instance itself
Code:
onClipEvent (load) {
_root.Xfactor = 100;
_root.Yfactor = 100;
}
onClipEvent (enterFrame) {
varXfactor = this._xscale;
varYfactor = this._yscale;
difXfactor = 100-(_root.W/this._width*100);
difYfactor = 100-(_root.H/this._height*100);
setProperty(this, _xscale, varXfactor-(difXfactor/5));
setProperty(this, _yscale, varYfactor-(difYfactor/5));
}
Oh, I forgot... The _root.W and _root.H are variables assigned by the picture to be framed...
It works fine, but after a while everything just keeps slowing down. Any ideas why?
Expression For Slowing Down
Hello
Could someone please help. I need to modify the script below so that the scroll goes slower (making faster is easy: _parent.body.scroll -= 1*5 but i dont know how to do it.
onClipEvent ( enterFrame ) {
if (lmouseover) {
_parent.body.scroll -= 1;
}
}
Thanks
Kuli
Slowing Down MC Key Press
Hey, is there a way to slow down the key press on a movie clip?
for example:
Code:
onClipEvent(enterframe) {
if (Key.isDown(Key.LEFT)) {
moveFrame();
}
}
for instance im cycling through frames inside the movie clip and when i press right it goes to the next frame and when i press left it goes to the previous frame...
i want to slow down the press so it only cycle through one frame with every press..
Audio Slowing
A audio wav file implemented within a flash file needed a slight edit (in the middle) so I changed it in sound editing software and updated the file in Flash - the file remained at 44kHz Mono 16 Bit. When I update the file in Flash, it plays slower than the original. I decided to switch it back to the original and the old one plays at the same slower rate - even when I delete and re-import. Please help!
Slowing Down The Movie
i made an animation which runs at a conference.
everything seem to be fine, however, they want now that when a speaker goes on stage, the animation should be much slower.
is there a possibility to controll that with a button?
cheers, dimitri
Camera Slowing Down To 4 FPS
Hello everyone,
I have a problem with the camera slowing down in my project. I thought it could be because of the complexity and memory consumtion of this work, so I created a completely new movie, typed such code:
quote:var camera:Camera = Camera.getCamera();
var video = new Video(camera.width, camera.height);
video.attachCamera(camera);
addChild(video);
function onEnterFrame(event:Event):void
{
trace(camera.currentFPS);
}
addEventListener(Event.ENTER_FRAME, onEnterFrame);
Despite there was nothing else done than just displaying the captured video, the camera fps was still slowing donw (however it was much lengthened in time than in the complex project), but ultimately I also finished with 4fps. So I came up with an idea to check if there is a connection between the memory usage and the camera fps. So I changed the code a little bit and got:
quote:var camera:Camera = Camera.getCamera();
var video = new Video(camera.width, camera.height);
video.attachCamera(camera);
addChild(video);
function onEnterFrame(event:Event):void
{
trace(camera.currentFPS + " / " + System.totalMemory);
}
addEventListener(Event.ENTER_FRAME, onEnterFrame);
And... this time the camera's fps stayed 25fps all the time. To be honest - I really don't know why :| I mean, I'm happy the fps stayed stabily at the level, but I don't know what to do in the mentioned, complex, project to make the fps faster. I can't just add the trace line ;)
For any questions here are some details about my project:
PC: Core 2 Extreme Quadro 2,66 GHz, 2.0Gb RAM, EVGA GeForce 8800 Ultra
Flash used: CS4
Tested on cameras: Canon MV 450i Digital Camera and an ordinary USB webcam (both the same effect)
Thanks in advance for any help.
|