Closed ghost closed 13 years ago
You don't need to create a global variable. Rather, the state itself can hold the value that is used by the state's enterState
and exitState
methods. Example:
fooState: Ki.State.design({
enterState: function() {
this._value = SC.Object.create({ ... });
},
exitState: function() {
this._value.destroy();
}
})
How do I share a variable between enterState() and exitState() because when entered I want to create an object that is destroyed on exit.
Is there a way or do I have to use a global variable?