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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:23:15+00:00 2026-05-26T15:23:15+00:00

I found a tutorial on how to make a dynamic unfilled and filled circle.

  • 0

I found a tutorial on how to make a dynamic unfilled and filled circle. that will take input from a slider to dertermine how much of the circle is drawn. I wanted to use this for a preloader. Unlike the author I would like to use it inside of a document class. I am getting
1061: Call to a possibly undefined method createEmptyMovieClip through a reference with static type document. and 1120: Access of undefined property circ1. The second is caused from the first. How would I get this to work in my document class? Thanks in advance!

//original code
// x: circles center x, y: circles center y
// a1: first angle, a2: angle to draw to, r: radius
// dir: direction; 1 for clockwise -1 for counter clockwise
MovieClip.prototype.CircleSegmentTo = function(x, y, a1, a2, r, dir) {
     var diff = Math.abs(a2-a1);
     var divs = Math.floor(diff/(Math.PI/4))+1;
     var span = dir * diff/(2*divs);
     var rc = r/Math.cos(span);
     this.moveTo(x+Math.cos(a1)*r, y+Math.sin(a1)*r);
     for (var i=0; i<divs; ++i) {
          a2 = a1+span; a1 = a2+span;
          this.curveTo(
               x+Math.cos(a2)*rc,
               y+Math.sin(a2)*rc,
               x+Math.cos(a1)*r,
               y+Math.sin(a1)*r
          );
     };
     return this;
};

// empty
this.createEmptyMovieClip("circ1",1);
circ1._x = 100;
circ1._y = 150;
circ1.radius = 35;

circ1.onEnterFrame = function(){
    this.clear();
    var endAngle = 2*Math.PI*percentLoaded;
    var startAngle = 0;
    if (endAngle != startAngle){
        this.lineStyle(2,0,100);
        this.CircleSegmentTo(0, 0, startAngle, endAngle, this.radius, -1);
    }
}

//filled
this.createEmptyMovieClip("circ2",2);
circ2._x = 220;
circ2._y = 150;
circ2.radius = 35;
/* code in tutorial i left out since its for a second filled in circle
circ2.onEnterFrame = function(){
    this.clear();
    var endAngle = 2*Math.PI*slider.value/100;
    var startAngle = 0;
    if (endAngle != startAngle){
        this.lineStyle(2,0,100);
        this.beginFill(0xFF9999,100);
        this.lineTo(this.radius,0);
        this.CircleSegmentTo(0, 0, startAngle, endAngle, this.radius, -1);
        this.lineTo(0,0);
        this.endFill();
    }
}
*/
  • 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-26T15:23:15+00:00Added an answer on May 26, 2026 at 3:23 pm

    That code you got was made using Actionscript 2, and you’re building it for Actionscript 3, so you have to either recode it to Actionscript 3 or compile it for AS2.

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

Sidebar

Related Questions

I found a tutorial in microsoft asp.net website , that make an instance from
I'm trying to make a listview from an arraylist using the tutorial i found
I found a tutorial online that extends that Apple QuickStart Application which is the
I have just found this great tutorial as it is something that I need.
I am making a TCP chat server from a simple tutorial I found and
I want to make a nice, modern-looking transitions between pages. I've found this tutorial:
I am extrapolating from a User model given in the Rails tutorial found here
I have a question regarding Xcode. I found a tutorial on the net that
I want add new fonts for Android. I found a tutorial that asks me
I found this tutorial at tizag.com. But It is for displaying entries from different

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.