javascript - How to successfully integrate AppWarp to ActionScript 3 code? -
i want create flash multiplayer game facebook. done game's code, don't know how integrate appwarp correctly.
i've created app on apphq, have api , secret keys, created room have room's id.
when in main class actionscript 3.0 code try use this:
public class script extends movieclip { public var roomid:string = "my room id"; private var apikey:string = "my api key" private var secretkey:string = "my secret"; private var listener:appwarplistener; } public function script() { warpclient.initialize(apikey, secretkey); warpclient.getinstance().setconnectionrequestlistener(listener); warpclient.getinstance().setroomrequestlistener(listener); warpclient.getinstance().setnotificationlistener(listener); }
i got errors (in appwarplistener.as file):
1045: interface connectionrequestlistener not found. 1045: interface roomrequestlistener not found. 1045: interface notificationlistener not found.
i followed tutorial , downloaded sdk. inside sdk folder many versions of swc, installed latest: v_1.5.2 here file appwarplib.swc
imported adobe flash cc in 2 ways:
by clicking preferences (ctrl + u) > code editor > action script 3.0 settings > library path (i put here path swc); , clicking publish settings swc > output file (here select swc)
but same, still got these errors.
maybe because need keep code files on ftp? i'm testing pc.
also after set path in preferences got many warnings that:
`line 1, column 1 warning: 5002: frame scripts of symbol 'symbol 116' have been ignored because compiled clip contains definition game__fla.symbol116_26. override game__fla.symbol116_26 definition, place custom class file within classpath.`
also in sdk folder link wrote before sample
folder, inside .as files , don't know how try without .fla file.
so have ideas? thanks.
also in sdk folder link wrote before sample
folder, inside .as files , don't know how try without .fla file.
i've tried create new blank .fla file , set class spritemovedemo.as
, same problem got these errors (in appwarplistener.as file):
1045: interface connectionrequestlistener not found. 1045: interface roomrequestlistener not found. 1045: interface notificationlistener not found.
so have ideas? thanks.
you have define listener class listen responses , notifications. in flash cc can not define class inside actions
. need create external action-script file , there define listener class. go file -> actionscript settings. there under source path section, add path of location have saved new action script file.
you should add appwarp .swc clicking preferences (ctrl + u) > code editor > action script 3.0 settings > library path (i put here path swc) only.
Comments
Post a Comment