Please confirm this OpenFeint functionality

Near the beginning of my main.lua file I have

  
local openfeint = require("openfeint")   
  
openfeint.init( "XXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXX", "MY GAME NAME", "1234567" )  
  

When I launch a new build of my game (first time game is ever played) it displays an OpenFeint screen asking if I want to enable OpenFeint for my game.

I have played other games (possibly not created with Corona) where this does not occur and instead there is a button to launch OpenFeint.

Anyway my game includes a button to launch the openFeint dashboard but I would like to know if I can prevent the openFeint screen displaying when game first launched? Perhaps it is not sensible to remove it but it is quite annoying.

Thanks

Paul [import]uid: 7863 topic_id: 5337 reply_id: 305337[/import]

I guess try put that code in a button? Does that work?
It should cause I used it with a timer before! [import]uid: 10657 topic_id: 5337 reply_id: 17728[/import]

[code]
local ui = require(“ui”)
local openfeint = require(“openfeint”)

local function startOF( event )

openfeint.init( “XXXXXXXXXXXXXXXXX”, “XXXXXXXXXXXXXXXXXXXX”, “MY GAME NAME”, “1234567” )

end

local ofBtn = ui.newButton{
default = “openfeint.png”,
over = “openfeint-over.png”,
onRelease = startOF
} [import]uid: 10657 topic_id: 5337 reply_id: 17730[/import]

Doh, yeah good point. I thought I had read that the require and initi needed to be called as early as possible but not sure why.

I guess I can set a variable to stop it calling the code every time the user clicks on the openfeint button [import]uid: 7863 topic_id: 5337 reply_id: 17731[/import]

Hey thanks Rick

I gave it a quick go and the theory works OK.

Possibly there is a bit of a delay when clicking the button

Also clicking the button a second time crashes the app but I suspected I would need to put a vaariable in to check if init had been already called.

Many thanks for your help

Paul [import]uid: 7863 topic_id: 5337 reply_id: 17734[/import]

Excellent! I’m gonna do that myself!

Its a much better flow for the game!
[import]uid: 10657 topic_id: 5337 reply_id: 17738[/import]

Works fine when setting a global variable to remember if openFeint initialised yet
So I have in main.lua

  
local openfeint = require("openfeint")  
gOpenFeintInitialised = false  
  

And in screen1.lua (Main Menu)

  
local function clickOpenFeintButton ( event )  
  
 local self = event.target  
  
 if event.phase == "ended" then  
  
 local bounds = self.stageBounds  
 local x,y = event.x,event.y  
 local isWithinBounds = bounds.xMin \<= x and bounds.xMax \>= x and bounds.yMin \<= y and bounds.yMax \>= y  
  
 if isWithinBounds then  
  
 if gOpenFeintInitialised == false then  
  
 openfeint.init( "XXXXXXXXXXXXXXXXX", "XXXXXXXXXXXXXXXXXXXX", "MY GAME NAME", "1234567" )  
 gOpenFeintInitialised = true  
  
 end  
  
 openfeint.launchDashboard()  
  
 end  
  
  
 end  
 end  

[import]uid: 7863 topic_id: 5337 reply_id: 17737[/import]