Can a class use a class?

Hello,
I have created a simple button class, to fire roll over and out states of a movie clip attached from the library.

However - I want to use a Tween engine to make my onRollOver events animate nicely.
This causes my class to clash with my tween class!
Is there any way around this??!!

class IndexClass extends MovieClip
{
    public function IndexClass()
    {
        this.onRollOver = this.over();
        this.onRollOut = this.out();
    }
    public function over()
    { 
        this.tween("_x",280,1,"easeoutSine");
    }
    public function out()
    {
        this.tween("_x",0,1,"easeinSine");
    }
}

Is my class code.
So the ‘tween’ isn’t recognised by the class file, although it would if it were in the native actionscript code where the

#include "MC_tween.as"

is kept and initialised…

Any help out there! There’s always a way around!:stare:

I don’t think you include “include” in a class file.

I think you main swf pulls in seperate classes and they communicate via the swf.

shrugs

that’s right - but how can the class communicate to the tween class within the swf its been associated to?!

Im sure it’s a case of syntax … one minor line of code … … …

First of all get the AS 2.0 version of that class.
Then simply use the import statement inside your custom class.


import mc_tween_as2
class YourCustomClass extends MovieClip{
	//...
}

interesting …
So let me get this right … >
inside MyCustomClass.as file I associate the class I wish to Import?
So If im using a tween engine such as “lmc_tween”.as:
my root SWF

#include "lmc_tween.as"

MyCustomClass.as

import lmc_tween_as2
class MyCustomClass extends MovieClip{
//......
}

Is that what you’re saying? I don’t quite get, ‘get the AS 2.0 version of the class’ …

Thanks!