Mercurial > MadButterfly
diff nodejs/examples/mce/mainmenu.js @ 915:80000948fcde
Add callback function to load browser.svg at the end of the ani9mation.
author | wycc |
---|---|
date | Thu, 21 Oct 2010 23:57:39 +0800 |
parents | a934ad0c8968 |
children | 30cd14b11bc7 |
line wrap: on
line diff
--- a/nodejs/examples/mce/mainmenu.js Thu Oct 21 23:56:55 2010 +0800 +++ b/nodejs/examples/mce/mainmenu.js Thu Oct 21 23:57:39 2010 +0800 @@ -112,8 +112,9 @@ var target = this.items[this.item]; var sx = 500 - target.center.x; var sy = 220 - target.center.y; - var an = new animate.shift(this.app,target,sx,sy,1); - an.start(); + var an = new animate.shift(this.app,target,sx,sy); + var self = this; + animate.run([an],0,1,function() {self.changePage();}); for(i=0;i<this.items.length;i++) { if (i == this.item) continue; var x = Math.random(); @@ -131,4 +132,8 @@ } } +MainMenu.prototype.changePage=function() { + this.app.loadSVG("browser.svg"); +} + exports.MainMenu=MainMenu;