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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:05:21+00:00 2026-05-20T18:05:21+00:00

Take this class: package { import flash.display.MovieClip; public class test extends MovieClip { public

  • 0

Take this class:

    package  {
    import flash.display.MovieClip;

    public class test extends MovieClip {

        public function test(parentMC) {
            var s=new MovieClip()
            s.graphics.lineStyle(1,0x000000,1)
            s.graphics.drawCircle(200,200,100)
            parentMC.addChild(s)
        }

    }

}

Why does the following code not move the created circle and how can I make it do so?

var s=new test(stage)
s.x=500

Thanks!

  • 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-20T18:05:22+00:00Added an answer on May 20, 2026 at 6:05 pm

    Try this instead:

    package  
    
    {
        import flash.display.Sprite;
    
        public class Test extends Sprite   
        {
    
            public function Test() 
            {
                graphics.beginFill(0xFF0000);
                graphics.lineStyle(1,0x000000,1);
                graphics.drawCircle(200,200,100);
                graphcis.endFill();
    
            }// end function
    
        }// end class
    
    }// end package
    

    and implement it like this:

    var test:Test = new Test();
    test.x = 500;
    addChild(test);
    

    The problem was that you weren’t adding the Test’s class’s local display object (in the Test class’s constructor) to the Test display object container, you were adding it to the parentMC display object container.

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

Sidebar

Related Questions

Let's Say I Have This Class: package{ import flash.display.Sprite; public class Main extends Sprite{
package { import flash.display.*; import flash.events.*; import flash.net.URLRequest; public class Main extends MovieClip {
Take a look at this code: public class Test { public static void main(String...
Take this class as example: public class Category : PersistentObject<int> { public virtual string
Take this sample class as an example: [AttributeUsage(AttributeTargets.All, AllowMultiple=true)] public class BugFixAttribute : System.Attribute
take this simple code: class A{ public: virtual void foo() = 0; void x(){
How do i create aliases in c# Take this scenario class CommandMessages { string
I'm using SharedPreferences to persists Object fields. Take this example: class Item { private
Take this mapping file <class name=com.data.StudentData table=gr_student> <id name=id> <generator class=identity /> </id> <property
I just wanted to confirm the difference here, take this as an example: class

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.