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 8693199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:29:40+00:00 2026-06-13T00:29:40+00:00

I am trying to move the red circles (bcircle.rcircle) within the blue circles (bcircle)

  • 0

I am trying to move the red circles (bcircle.rcircle) within the blue circles (bcircle) in a clockwise motion each second. I have tried changing the x and y coordinates of the red circles (bcircle.rcircle) in the timer event handler (redClockwise). I wouls appreciate any help on this. Thanks.

My current code follows..

package
{
    import flash.display.*;
    import flash.utils.Timer;
    import flash.events.TimerEvent;


    public class blueCircles extends MovieClip
    {
        public var bcircle:MovieClip = new MovieClip();
        public var rcircle:MovieClip = new MovieClip();
        private var timer:Timer = new Timer(1000,10);

        public function blueCircles()
        {
            createCircles();
            timer.start();
            timer.addEventListener(TimerEvent.TIMER, redClockwise);

        }
        private function createCircles():void
        {

            for (var i:Number=0; i<=9; i++)
            {
                var bcircle:MovieClip = new MovieClip();
                var bxpos:int = 20;
                var bypos:int = 20;

                bcircle.graphics.beginFill(0x0033CC);
                bcircle.graphics.drawCircle(bxpos,bypos,15);
                bcircle.graphics.endFill();
                bcircle.y = (30 + 10) * i;
                addChild(bcircle);

                //var rcircle:MovieClip = new MovieClip();
                bcircle.rcircle = new Shape();
                var rxpos:int = 15;
                var rypos:int = 25;

                bcircle.rcircle.graphics.beginFill(0xFF0000);
                bcircle.rcircle.graphics.drawCircle(rxpos,rypos,5);
                bcircle.rcircle.graphics.endFill();
                rcircle.y = (30 + 10) * i;
                bcircle.addChild(bcircle.rcircle);
            }
        }
        public function redClockwise(e:TimerEvent):void 
        {
            trace("Call");

            //bcircle.rcircle.rotation += 50;
            bcircle.rcircle.x += 50 * Math.PI/180;
            bcircle.rcircle.y += 50 * Math.PI/180; 
            //rcircle.rotation = 50;

        }

    }

}
  • 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-06-13T00:29:41+00:00Added an answer on June 13, 2026 at 12:29 am

    A few points:

    1. You need to store reference to bcircle at a class-level so that you can reference it within the redClockwise() method. You’ve kind of done that, however if you pay close attention you’ll notice that what you’re actually doing within createCircles() is creating a new local variable called bcircle and using that, rather than referring to the class-level definition.
    2. Because you have multiple circles, a single class-level definition will not work. You’ll need to create an Array, and store each circle within that so that you can loop over that array and update all of the circles.
    3. Your timer will only run 10 times. That may be intentional but I thought I would point that out.
    4. Your logic for movement along a circular path is invalid. All you’re doing here is moving southeast of the starting location. You need to use sin and cos to move the way I’m assuming you want. The idea will be positioning the red circles so that they’re in the centre of the blue, then using a value (perhaps rotation) to offset the position of the red circle away from the centre of it’s blue parent based on its radius and the aforementioned value to get the angle from the centre right.
    5. You’re doing too much in a single class. Create a class “DualCircle” or something like that, and in there manage the movement of the red circle as well as the appearance of each. Use the document class only to create and position each of these elements. This will reduce the complexity of what you’re trying to do greatly.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to get it so that if I move a red div-square around
I am trying to move some files in python, but they have spaces in
So I'm simply trying to make a red 10 x 10 box move vertically
I'm trying to make an object, a red circle move bounce to a random
Im Trying to make a red square move from top of view to a
Trying to move some divs using hover, this is my markup: <div class=item dark-grey>
I am trying to move even numbers in an array to the front and
I am trying to move an object by checking if the mouse is colliding
I am trying to move the logic to the very high-level from the db.
I am trying to move to UITableView named Cart from UIView by clicking on

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.