本文介绍了如何成功整合AppWarp为ActionScript 3 code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想创建闪存多人游戏对于Facebook 。我已经与游戏的code做的,只是我不知道如何整合 AppWarp 正确。I want to create flash multiplayer game for Facebook. I already done with game's code, just I don't know how to integrate AppWarp correctly.我已经AppHq创建应用程序,有阿比密钥,也创造了房我有房的ID。I've created app on AppHq, have Api and secret keys, also created room an I have room's ID.当在我的主类的的ActionScript 3.0 code我尝试使用这样的:When In my main class ActionScript 3.0 code I try to 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);} 我得到错误(AppWarpListener.as文件)1045: Interface ConnectionRequestListener was not found.1045: Interface RoomRequestListener was not found.1045: Interface NotificationListener was not found.我跟着这个教程,我下载了这个 SDK 。里面SDK文件夹是深港西部通道的很多版本,所以我安装最新的:V_1.5.2这里是文件 AppWarpLib.swc 我进口它来的Adobe Flash CC在2种方式:I followed this tutorial and I downloaded this SDK. Inside SDK folder are many versions of swc, so I installed latest: V_1.5.2 here is file AppWarpLib.swc I imported It to Adobe Flash CC in 2 ways:By clicking Preferences (CTRL + U) > Code Editor > Action Script 3.0 Settings > Library path (I put here path to swc);And By clicking publish settings SWC > Output file (here I select that swc)但同样的,我还是得到了这些错误。But the same, still I got these errors.也许这是因为我需要保持在FTP code文件?我是从我的电脑测试。Maybe that because I need to keep code files on FTP? I'm testing It from my PC.另外后,我在preferences设置路径我得到了很多的警告这样的:Also after I set path in Preferences I got many warnings like that:`Line 1, Column 1 Warning: 5002: The frame scripts of the symbol 'Symbol 116' have been ignored because a compiled clip contains a definition for Game__fla.Symbol116_26. To override the Game__fla.Symbol116_26 definition, place a custom class file within your classpath.`此外,在哪个环节我之前写的就是样品文件夹,但里面只。至于文件,我不知道该怎么尝试没有FLA文件SDK文件夹。Also in SDK folder which link I wrote before is sample folder, but inside only .as files and I don't know how to try It without .fla file.因此​​,有你的想法?谢谢你。So have you ideas? Thanks.此外,在哪个环节我之前写的就是样品文件夹,但里面只。至于文件,我不知道该怎么尝试没有FLA文件SDK文件夹。Also in SDK folder which link I wrote before is sample folder, but inside only .as files and I don't know how to try It without .fla file.我试图创造新的空白FLA文件,并设置类为 SpriteMoveDemo.as ,但同样的问题,我得到了这些错误(AppWarpListener.as文件)I've tried to create new blank .fla file and set Class to SpriteMoveDemo.as, but the same problem I got these errors (in AppWarpListener.as file):1045: Interface ConnectionRequestListener was not found.1045: Interface RoomRequestListener was not found.1045: Interface NotificationListener was not found.因此​​,有你的想法?谢谢你。So have you ideas? Thanks.推荐答案样品用appwarp的旧版本制作,但新版本包括一些新的方法和听众。The sample was made using older version of appwarp, but the new version includes some new methods and listeners.所有你需要做的是落实丢失的听众。All you need to do is to implement the missing listeners.public function onInitUDPDone(res:int):void{}public function onUserPaused(locid:String, isLobby:Boolean, username:String):void{}public function onUserResumed(locid:String, isLobby:Boolean, username:String):void{}public function onGameStarted(sender:String, roomid:String, nextTurn:String):void{}public function onGameStopped(sender:String, roomid:String):void{}public function onUpdatePeersReceived(update:ByteArray, isUDP:Boolean):void{} 这篇关于如何成功整合AppWarp为ActionScript 3 code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 17:14