 |
|
 |
|
|
|
|
| |
|
|
| Browser Animation v01 |
| |
Most of us have seen how we can scale / animate the height of a movieclip in a flash movie, but how about using a button in the flash movie to animate the browser height. I did a very simple sample to demostrates that this is possible with actionscript and javascript.
If you guys had notice, i use getURL method to communicate with javascript instead of fsCommand, reason is being that fsCommand might had problem working on Mac OS.
I also include Robert Penner's Sine easing formula so that my browser will animate with a easeOut effect.
Click here to see browser animation
var begin:Number=800;
var end:Number=300;
var diff:Number=end-begin;
var time:Number=0;
var duration:Number=30;
var nV:Number=0;
var oV:Number=nV;
function animate(v:Number):Void{
getURL("javascript:resizeWindow("+v+");");
}
animate_btn.onRelease=function():Void{
onEnterFrame=function():Void{
oV=nV;
nV=diff*Math.sin(time++/duration*(Math.PI/2));
animate(nV-oV);
if(time>duration) onEnterFrame=null;
}
}

suggestion
|
| |
| |
|
|
| |
|
|
|
|
|
| |
© copyright 2007 THINKLUNATIC. |
|
|
|