layabox 打包成IOS工程,代码需要交互,互相调用,那么怎么样互相调用方法呢?
layabox代码:
public class MainView extends MainUI{
public function MainView(){
trace("---------------2");
testButton.on(Event.CLICK,this,share);
}
//没有回调的方法
public function toast():void{
var Test :IPlatformClass = Laya.PlatformClass.createClass("Test");
var a:Boolean =false;
Test.call("toast3:",a);
// alert("----hahah");
}
//带回调的方法
public function share():void{
var Test :IPlatformClass = Laya.PlatformClass.createClass("Test");
var testAdd:IPlatform =Test.newObject();
// testAdd.callWithBack(function(n){},"setOp:","+");
// testAdd.callWithBack(function(n){alert("2+3="+n);},"operatorWith:and:",2,3);
testAdd.callWithBack(sb,"operatorWith:and:",2,3);
}
public function sb(sb:String):void{
alert("----------"