The problem with doing: storyboard.myVariable = 10 is that it’s not safe. We could come along and decide we want to have a member named .myVariable and then your app would break. You have to protect your member’s by name spacing the variable names. We at one point suggested using a table named “state” (storyboard.state.myVariable) with the assumption we would never use state. But again, this isn’t a best practice because we could again start using it. Composer adds a setVariable and getVariable method to provide you a safe way of doing this.
Regardless, it’s probably not as clean to do this when we gave you a data module method in the Goodbye Globals tutorial that does the same thing in a more semantic way.
Now Storyboard provided the ability to pass parameters in a table between scenes and Composer carries that concept on as well.
storyboard.gotoScene( “mygame”, { effect = “crossFade”, time = 250, params = { someVar = “SomeData”, someOtherVar = “someOtherData” } } )
Rob