tags:

views:

19

answers:

2

Any sample code to do so ? I can only see example for passing simple variable.

Let's say I have a movieClip M1 and a movieClip M2 loaded by M1. Then M2 will create an instance of a class c that will be passed to MovieClip M1 by calling a predefined method.

I'm totally new to actionscript so I'd need to know the exact syntax and event to do so.

A: 
import my.class.a;

class b {
    var test:A = new A;
}

this is an abstract version, hope you can use it.

antpaw
thanks but I don't understand your answer : you only instantiate the class A in B. It doesn't show me how to pass class A to B.
+1  A: 

You can pass them the same way you pass simple variables.

function myFunction(a:CustomClass):void
{
  trace("received " + a.toString());
}

var c:CustomClass = new CustomClass("blah", 42);
myFunciton(c);
Amarghosh
I think that's it I will try thanks.