Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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: 8
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
PHP & Ruby Developer
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jan 2001
Posts: 1,437 JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level)JeffCT User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 5 h 36 m 40 sec
Reputation Power: 9
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?


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway