|
|
 |
|
|
|
|
|
Hi guys,
this is my first tutorial for creating the elastic button using the advance method of Swishmax scripting!
Elastic Button Preview
Here it is:
1.Open Swishmax and in the file menu click new.
2.In the current scene (Scene_1) do this: -create the shape object of your choice. and name it "roller". -group it as sprite and name it as "roller" again.
3.For the shape in the sprite, add this code: on (rollOver) { jump = false; xskal = xskal * 2; yskal = yskal * 2; roller = 1; } on (rollOut) { xskal = 100; yskal = 100; roller = 0; } 4. For the Sprite object, add this action:
onLoad () { xskal = 100; yskal = 100; jump = false; sX = 0; sY = 0; multiplikator = 0.800000; ratio = 0.300000; } onEnterFrame() { if (!jump) { sX = Number(sX * multiplikator) + Number((xskal - _xscale) * ratio); sY = Number(sY * multiplikator) + Number((yskal - _yscale) * ratio); _xscale = _xscale + sX; _yscale = _yscale + sY; } }
5.That's all.
6.Test your button!
Download Example
ENJOY
|
|
|
|