Skip to content

Commit

Permalink
Updated to work with the latest version of OpenFL (1.2.2).
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonatan Van Hove committed Jan 14, 2014
1 parent cd7b3db commit f6f2033
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin/
assets/key.der
2 changes: 1 addition & 1 deletion src/IAPHandler.hx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class IAPHandler
// bind methods to JNI
trace("=================== JNI linking methods...");
initCall = openfl.utils.JNI.createStaticMethod
("com.jarnik.iaptest.OUYA_IAP", "init", "(Lorg/haxe/nme/HaxeObject;Ltv/ouya/console/api/OuyaFacade;Ljava/lang/String;)V", true);
("com.jarnik.iaptest.OUYA_IAP", "init", "(Lorg/haxe/lime/HaxeObject;Ltv/ouya/console/api/OuyaFacade;Ljava/lang/String;)V", true);
requestProductListCall = openfl.utils.JNI.createStaticMethod
("com.jarnik.iaptest.OUYA_IAP", "requestProductList", "([Ljava/lang/String;)V", true);
getProductListIDsCall = openfl.utils.JNI.createStaticMethod
Expand Down
6 changes: 3 additions & 3 deletions src/Main.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import flash.display.Sprite;
import flash.utils.ByteArray;
import haxe.io.Bytes;
import haxe.crypto.BaseCode;

import flash.Lib;
import openfl.Assets;

#if android
Expand Down Expand Up @@ -41,7 +41,7 @@ class Main extends Sprite {
icon.visible = false;

#if android
var getContext = JNI.createStaticMethod ("org.haxe.nme.GameActivity", "getContext", "()Landroid/content/Context;", true);
var getContext = JNI.createStaticMethod ("org.haxe.lime.GameActivity", "getContext", "()Landroid/content/Context;", true);
OuyaController.init ( getContext () );
ouyaFacade = OuyaFacade.getInstance();
ouyaFacade.init( getContext(), OUYA_DEVELOPER_ID );
Expand All @@ -53,7 +53,7 @@ class Main extends Sprite {
//, enter more product IDs here...
]);

stage.addEventListener (JoystickEvent.BUTTON_DOWN, stage_onJoystickButtonDown);
Lib.current.stage.addEventListener (JoystickEvent.BUTTON_DOWN, stage_onJoystickButtonDown); // 'stage' is still null here, so we use Lib.current.stage
#end
}

Expand Down
2 changes: 1 addition & 1 deletion src/java/com/jarnik/iaptest/OUYA_IAP.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.jarnik.iaptest;

import org.haxe.nme.HaxeObject;
import org.haxe.lime.HaxeObject;
import java.util.Arrays;
import android.util.Log;
import java.util.List;
Expand Down

0 comments on commit f6f2033

Please sign in to comment.