This content has been marked as final. Show 5 replies
I think the answer lies in what you're not telling us - how are you passing it the name of the host clip? have you considered setting up your class to extend movieClip so that you don't need to pass it the host? what happens when you trace(drag_mc) in the constructor?
>>he drag() function traces undefined
Simple scope problem. Inside callback functions the members of the class go out of scope. To solve, use the import statement:
and then use:
drag_mc.onPress = Delegate.create(this,drag);
Without the import statement:
drag_mc.onPress = mx.utils.Delegate.create(this,drag);
Thanks for the replies.
Looking at the code that I have here, is this the preferred method to create a class that controls a set of movieclips or should I be taking a different approach?
I am trying to create a script that will beahviors to a group of movieclips and also have the flexibility to edit the movieclips directly within a few simple guidelines.
If you mean if you should extend the MovieClip Class, then no. Only use inheritance when you need all or most of the functionality of the MovieClip Class (the IS-A relationship).
You're on the right track.
Thanks for the help.