开发者

Is it possible a whole class object from one movieclip to another?

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.


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);


import my.class.a;

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

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜