1

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.

I've created app on AppHq, have Api and secret keys, also created room an I have room's ID.

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

I got errors (in AppWarpListener.as file):

1045: Interface ConnectionRequestListener was not found.
1045: Interface RoomRequestListener was not found.
1045: Interface NotificationListener was not found.

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.

Maybe that because I need to keep code files on FTP? I'm testing It from my PC.

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.`

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.

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.

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.

1
  • So no one doesn't know solution?
    – user1816133
    Commented Feb 1, 2014 at 14:46

2 Answers 2

1

You have to define a listener class to listen to responses and notifications. But in flash CC you can not define a class inside actions. You need to create an external action-script file and there define your listener class. Then go to File -> ActionScript Settings. There under source path section, add the path of the location where you have saved your new action script file.

You should add appwarp .swc by clicking Preferences (CTRL + U) > Code Editor > Action Script 3.0 Settings > Library path (I put here path to swc) only.

2
  • I did that, but the same. 3 errors that Listener not found.
    – user1816133
    Commented Feb 12, 2014 at 11:33
  • Also do what justnajm said Commented May 14, 2014 at 10:25
1

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{}