Google Answers Logo
View Question
 
Q: Passing data to MovieClip subclass ( No Answer,   0 Comments )
Question  
Subject: Passing data to MovieClip subclass
Category: Computers > Programming
Asked by: weimin-ga
List Price: $15.00
Posted: 21 Mar 2005 21:00 PST
Expires: 26 Mar 2005 22:02 PST
Question ID: 498384
Is it possible to pass user-defined parameters to the constructor of
dynamic subclass of MovieClip in AS? Basically something like this:

dynamic class class1 extends MovieClip {
  function class1 (data1, data2) {
    trace(data1);
    attachMovie(...);
    trace(data2);
  }
}

var obj:class1 = new class1(1, 2);

Clarification of Question by weimin-ga on 22 Mar 2005 09:04 PST
What I am trying to do is to create a library item (or component) that
can do things as specified. For example, a car object. At the object
creation time, we pass data such as from location and to location.
Once created, the car will move as specified. If I want two cars
moving from a to b and c to d, respectively. All I need to do in the
main stage is:

var car1:Car = new Car (a, b);
var car2:Car = new Car (c, d);

Constructor of Car (a dynamic subclass of MovieClip) will attach the
movie (car) and move it from one location to another.
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy