[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


Track mouse position and adjust circle accordingly

Posted on 2004-10-21
Medium Priority
Last Modified: 2006-11-17
I have a circle (movie clip) in the upper left corner of my flash. I want to have that circle expand the closer the mouse gets to it or contract the farther it moves away from any entry point in the piece. How would I do this???
Question by:894359
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

Drakkon earned 2000 total points
ID: 12374881
var baseWidth = circle._width;
var baseHeight = circle._height;

function resizeCircle() {
      var currDist = Math.sqrt(Math.pow((circle._xmouse),2) + Math.pow((circle._ymouse),2));
      // can modify here to grow bigger with a grow factor */
circle._width = baseWidth+ currDist;
      circle._height = baseHeight + currDist;


Expert Comment

ID: 12374891
oops wasnt done yet...anyways use that code on first frame...circle is just your circle's movieclip name you can multiply or divide currDist to get it to grow/shrink at a rate you need

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question