Hi Beany,
Here's a simple resolution to the issue you mention....
Change the declaration of
focus to
_focusCode:
private var _focus:DisplayObject; /// Object the viewport should center on.
...and add the following methods to the class:
Code:
public function changeFocus(newFocus:DisplayObject, ease:Boolean = true):void {
if (ease) {
_focus = newFocus;
} else {
focus = newFocus;
}
}
public function get focus():DisplayObject { return _focus; }
public function set focus(value:DisplayObject):void {
_focus = value;
if (scrolling) {
var saveEase:Number = scrollEase;
scrollEase = 1;
updateScroll();
scrollEase = saveEase;
}
}
Now, whenever the focus property is set directly, as is the case when the world is first created, there's no ease. If you want to change focus and use this ease method, then call
changeFocus.