Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7082045
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:59:50+00:00 2026-05-28T06:59:50+00:00

In flash, I use lineTo to draw a line between two points. This is

  • 0

In flash, I use lineTo to draw a line between two points. This is working well, but I’m finding that on slower computers, the line is jagged because not as many mouse events are firing.

I want to ‘smooth’ the line out, to add more points in between each point that the mouse registers:

Illustration

The black lines show the result, the green ones are what I want. The red dots are actual points, and the green ones are interpolated.

I have tried to code this myself but I can’t seem to get it right, here is the code anyway:

var interX:Number = lastMouseX+(lastMouseSpeed.x/2);
var interY:Number = lastMouseY+(lastMouseSpeed.y/2);

//Also tried: lastMouseX+(this.mouseX-lastMouseX)/2;
// also jittery

graphics.lineTo(interX, interY);

graphics.lineTo(this.mouseX, this.mouseY);

lastMouseSpeed.x = this.mouseX-lastMouseX;
lastMouseSpeed.y = this.mouseY-lastMouseY;

lastMouseX = this.mouseX;
lastMouseY = this.mouseY;

the result is much more jagged than the normal one.

Sorry, but I can’t give screenshots (for some reason it copies my screen as black)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:59:50+00:00Added an answer on May 28, 2026 at 6:59 am

    You probably want something like spline interpolation, though other approaches are possible.

    The reason your current approach isn’t working is that what you want to do for the point between red points 1 and 2 depends on red point 3, but you’re equations don’t account for this. Accounting for it makes it possible to appropriately consider the curvature, but it’s more complicated though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I don't want to use flash. I've found multiple jquery libraries that do this.
I am working on a chatting app that makes use of flash sockets. I
I use Flex SDK in command line to develop a flash. But trace() doesn't
as you all know that if we use flash object in web page in
Does websites created by Flex Builder works on every browsers that use Flash ?
When running flash components that use localConnection within an HTML container, I get the
In one web page we use a flash upload control but becouse a flash
Flash can use 2 types of fonts such that they can be changed at
I have to hand off a Flash file to a client that use Flash
So, I'm naturally a PHP coder, but I have to use flash for a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.