Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 11th, 2002, 09:13 AM
jamesf4218 jamesf4218 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2001
Location: England
Posts: 673 jamesf4218 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 27 m
Reputation Power: 13
How do you make a clip move more smoothly without increasing the frame rate please?

Hello,

I have been developing this piece of code with the help of people in the forum and what I have so far is below. It makes a clip move around the screen in the opposite direction to the mouse.

It all works fine, but when the clip moves, it is jerky. Is there any way to make it move more smoothly without increasing the framerate? Increasing the framerate does not do anything on older computers with slower processers.

Can the code be altered at all to make the clip move more smoothly?

Many thanks

James

onClipEvent(Load){
//where 550 X 400 is your movie size
M_halfwidth= 550/2
M_halfheight= 400 /2
}
onClipEvent (enterFrame) {

//this will always move the peice relevant to the centre
//as it tracks every frame not just when mouse moves= no delay

_y = M_halfheight+(M_halfheight-_root._ymouse);
_x = M_halfwidth+(M_halfwidth-_root._xmouse);

//then you need to check if you have moved 2 far
//check _x at minimum and max
if (_x<=0){
_x=0;
}else if (_x>=M_halfwidth*2){
_x=M_halfwidth*2;
}

// do the same for _y
if (_y<=0){
_y=0;
}else if (_y>=M_halfheight*2){
_y=M_halfheight*2;
}


}

Reply With Quote
  #2  
Old February 1st, 2002, 11:58 AM
JeffCT JeffCT is offline
Dev
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,436 JeffCT User rank is Sergeant Major (2000 - 5000 Reputation Level)JeffCT User rank is Sergeant Major (2000 - 5000 Reputation Level)JeffCT User rank is Sergeant Major (2000 - 5000 Reputation Level)JeffCT User rank is Sergeant Major (2000 - 5000 Reputation Level)JeffCT User rank is Sergeant Major (2000 - 5000 Reputation Level)JeffCT User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 5 h 52 m 59 sec
Reputation Power: 40
What do you have the framerate at now? Flash 5 is fairly fast with vector graphics and such, these days you don't really need to worry about "slower computers" with most applications unless your movie uses tons of bitmaps with alpha effects and such. On a Pentium II 400Mhz or so, which is pretty slow compared to today's P4 2.4Ghz machines, most Flash movies don't have much slowdown even at 30+ fps. A slower Pentium III at maybe 600Mhz or so can run a lot of clips at 60fps which is the maximum. Unless you specifically target your site to people who use slow Pentium I machines then I wouldn't even worry about increasing the frame rate.

If you are running at the default 12fps it's going to be hard to get anything smooth. That's a very slow framerate. When you look at a lot of Flash movies these days that seem to run very smoothly, with very fluid animations, they are probably running at 40fps or more. To make the animation smoother for that clip following the mouse, you're just going to have to make it follow the mouse slower (i.e. it's always going to be way behind it, catching up at it's own pace).

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > How do you make a clip move more smoothly without increasing the frame rate please?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap