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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:35:53+00:00 2026-05-12T18:35:53+00:00

i have 3 mc : category1 , category2 , category3 in library, in each

  • 0

i have 3 mc : category1, category2, category3 in library, in each of them i have mc with the same instance names : _background, _picture, but with totally different contend. What i wanted to do is to create a SuperCategory class that would do the same things on _background, _picture. So in library i did Export for Actionscript Category1, Category2, Category3.

public class SuperCategory extends MovieClip
{
    public var _picture:MovieClip;
    public var _background:MovieClip;
    public var time:int = 0;

    public function SuperCategory() 
    {
         addEventListener(MouseEvent.ROLL_OVER, onRollOver)
    }
    public function onRollOver(event:MouseEvent):void
    {
         TweenMax.to(_picture,time,{alpha:0.2});
    }

}

and i want to extend this class

public class Category1 extends SuperCategory
{
    public function Category1()
    {
        time = 2;
        super();
    }
}

I know that the conflict is between the public var _picture and the mc in library having an instance named _picture, but how can i do something like this and avoid this error ?

  • 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-12T18:35:53+00:00Added an answer on May 12, 2026 at 6:35 pm

    What if in the Category MC you change the instance name to something else maybe “_pic”.
    Then in the Category class in the constructor you do something like:

    public class Category1 extends SuperCategory{    
           public function Category1()    
           {        
              time = 2;        
              super();   
              registerRollOver(_pic);
           }
    }
    

    SuperCategory class

     public class SuperCategory extends MovieClip
        {
            public var _picture:MovieClip;
            public var _background:MovieClip;
            public var time:int = 0;
    
            public function SuperCategory() 
            {
    
            }
            public function onRollOver(event:MouseEvent):void
            {
               TweenMax.to(_picture,time,{alpha:0.2});
            }
    
            public function registerRollover(clip:MovieClip):void
            {
               _picture = clip; //in case you want it to be class member still
               _picture.addEventListener(MouseEvent.ROLL_OVER, onRollOver)
            }
    
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a static library (let's call it S) that uses a category (NSData+Base64
I have a Category and a Post model, with each Post belonging to a
I have defined file path like- $docRoot = $_SERVER['DOCUMENT_ROOT']; $webRoot = str_replace(array($docRoot, 'library/config.php'), '',
I have a Library application which is already implemented in spring MVC. I need
I am trying to use the JSONKit library and have included the source files
I have this code: (define-foreign-library libc (:unix libc.so.6)) (use-foreign-library libc) (defcfun setlocale :pointer (category
I have been using Freemarker for a while and found displaytag library very useful.
I have many sites that use the same root category of the Main Site.
Let me setup the problem real quick. I have a library serial that depends
I got a prob that, I have a base static library Base, then other

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.