Hi KilikSky ,
Follow the following steps.
[lua]
–sender.lua
local data={}
data.options={
title = “ASSIF”,
backScene= “lala.lua”
}
data.name=“HI THIS IS LALA”
function data.myFunction( )
print(" I AM A FUNCTION WHOSE REFERENCE IS STORED IN data table")
end
return data
[/lua]
now require the sender.lua in the file where you want to use it or require it globally in main file, so that you can use it directly.
[lua]
–Any Receiver Scene where it data to be used for ex : receiiver.lua
obj = require(“sender”)
print(obj.options.title)
print(obj.options.backScene)
print(obj.name)
obj.myFunction( )
[/lua]
Note : If you only want to pass from One Scene to another Scene you can also use composer.setVariable() & composer.getVariable() methods.
-Assif