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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:29:13+00:00 2026-05-24T22:29:13+00:00

New to AS3, long time programmer. Essentially I am creating a myriad of objects,

  • 0

New to AS3, long time programmer. Essentially I am creating a myriad of objects, all of which will have the same functionality, although the properties will vary between each object, including the artwork. I believe they will all be movieclips as they will be interactive and I believe they will be moving.

I am wondering what the best way to create these objects are. I am assuming that I create an object class with the functionality and properties, I’m just unsure how to instantiate multiple copies with different properties, if that makes sense.

Sorry for my poor wording, I can help elaborate if necessary, and thank you for your help in advance! 🙂

  • 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-24T22:29:14+00:00Added an answer on May 24, 2026 at 10:29 pm

    Create a class.

    package {
        import flash.display.MovieClip;
    
        public class MyMovieClip extends MovieClip {
        }
    }
    

    Add properties that may vary.

    package {
        import flash.display.DisplayObject;
        import flash.display.MovieClip;
    
        public class MyMovieClip extends MovieClip {
            private var _borderColor : uint;
            private var _artWork : DisplayObject;
        }
    }
    

    Add possibilities to modify the properties. You may use constructor arguments or explicit getter/setter or you could declare your properties to be public.

    package {
        import flash.display.DisplayObject;
        import flash.display.MovieClip;
    
        public class MyMovieClip extends MovieClip {
            private var _borderColor : uint;
            private var _artWork : DisplayObject;
    
            // using constructor parameters
    
            public function MyMovieClip(borderColor : uint, artWork : DisplayObject) {
                _borderColor = borderColor;
                _artWork = artWork;
            }
    
            // using setter/getter
    
            public function set borderColor(borderColor : uint) : void {
                _borderColor = borderColor;
            }
    
            public function get borderColor() : uint {
                return _borderColor;
            }
    
            public function set artWork(artWork : DisplayObject) : void {
                _artWork = artWork;
            }
            public function get artWork() : DisplayObject {
                return _artWork;
            }
    
        }
    }
    

    Create instances of the class and set them up using different values:

    package  {
        import flash.display.Shape;
        import flash.display.Sprite;
    
        public class Main extends Sprite {
            public function Main() {
                var myMc1 : MyMovieClip = new MyMovieClip(0xFF0000, new Shape());
                var myMc2 : MyMovieClip = new MyMovieClip(0x0000FF, new Shape());
                var myMc3 : MyMovieClip = new MyMovieClip(0x00FF00, new Shape());
    
                myMc1.borderColor = 0xFF0000;
                myMc3.artWork = new Shape();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to AS3 and I have been creating myself mini-projects to learn
I'm new to AS3 and have been working on an XML driven navigation system
I am new to Flash and AS3. I have a DataGrid like this Item
I have the following array as3 example: var arrayDefinitionsargsAmfPhp:Array = new Array(); arrayDefinitionsargsAmfPhp['tabela'] =
I'm new to AS3 and have been putting my code on the timeline and
All, I'm pretty new to AS3, so this is probably a very trivial question.
I'm new to C# but have a strong background in ActionScript 3. In AS3,
Hi I am new to as3 and have a problem with a site im
Let's say I have some code like this in AS3 for(...) thing = new
In as3 I'm creating a drop shadow, which works fine. But when I change

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.