/ Published in: Other
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package nl.hnk.animations { import com.greensock.TweenLite; import com.greensock.easing.Sine; import flash.display.Sprite; /** * @author alexanderdehaas */ public class ContentHover extends Sprite { public function ContentHover() { with(graphics) { beginFill(0x666666); drawRect(0, 0, 300, 120); endFill(); } x = y = 125; } public function startHover():void { TweenLite.to(this, 3, {delay: 0.5, y: 140, ease:Sine.easeInOut, onComplete: hoverUp}); } private function hoverUp():void { TweenLite.to(this, 3, {delay: 0.5, y: 110, ease:Sine.easeInOut, onComplete: startHover}); } } }