|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
I'm wanting to develop a website similar to: http://www.evansblue.com/
It looks like its a large image that has different x/y coordinates set for each button to scroll to. Can anyone give me an example of some actionscript where button1 scrolls to a specified x/y coordinates and button2 scrolls to a specified x/y coordinates and so on? |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
you could do this using the Tween class and writing a method that you call from
any button and pass the coordinates you would like to move the image to. It would basically look something like this: import mx.transitions.Tween; import mx.transitions.easing.*; var time:Number = 30; //the time in 'frames' - dependent on your fps setting function slideTo(xp, yp) { new Tween(image_mc, '_x', Strong.easeOut, image_mc._x, xp, time, false); new Tween(image_mc, '_y', Strong.easeOut, image_mc._y, yp, time, false); } //then call the method from a button btn1.onPress = function() { slideTo(500, 400); //whatever coordinates you want } btn2.onPress = function() { slideTo(800, 1000); } |
|
![]() |
| Outils de la discussion | |
|
|