Hello, Im trying to make a MC smooth scroll on button press, right now it only advances once when pressed, it doesnt stay advancing when it stays hovered. here is my code _root.leftButton_mc.onRollOver= function() { _root.world.grass._x = _root.world.grass._x + 25; _root.world.water_mc._x = _root.world.water_mc._x + 5; _root.world.city._x = _root.world.city._x + 2; _root.world.item2Button._x = _root.world.item2Button._x + 5; } I tried onPress, onMouseOver etc but can not figure this one out, also any easing code help will be greatly appreciated to make it look nice and smooth. Thanks! -Tim
SOLVED _root.leftButton_mc.onPress = function() { this.onEnterFrame = function() { _root.world.grass._x = _root.world.grass._x + 25; _root.world.water_mc._x = _root.world.water_mc._x + 5; _root.world.city._x = _root.world.city._x + 2; _root.world.item2Button._x = _root.world.item2Button._x + 5; } } _root.leftButton_mc.onRelease = function() { delete this.onEnterFrame; }
I would suggest you use timer rather than implementing new onEnterFrame event handler, to save CPU usage. regards