Copy link to clipboard
Copied
Ho to everyone.
I already hava a slider in AS2 but I need it in AS3, and as many of you know my AS3 it's no well. But here it's the deal:
In the as Layer i have the actions whit this code:
stop();
btn_volver.onRelease=function(){
clip_mc.x=(0);
}
btn_adelantar.onRelease=function(){
clip_mc.x=(-410.0);
}
btn_3.onRelease=function(){
clip_mc.x=(-570.0);
When 0 is the main position, -410 is the second position and -570,0 is the last position.
In button layer i have a movieclip which contains the buttons and this mc have this code:
onClipEvent(load){
x=0
_x=0
}
onClipEvent(enterFrame){
_x+=(x-_x)*0.2
}
As you can see works fine, but there is a way to have it in AS3??? ... Which sintax do i have to use??
THANKS A LOT
PD: I upload the file. http://skpepublicidad.com/pruebas/slider.fla.zip
:
stop(); btn_volver.addEventListener(MouseEvent.CLICK,volverF);
function volverF(e:Event){ clip_mc.x=0; } btn_adelantar.addEventListener(MouseEvent.CLICK,adelantarF);
function adelantarF(e:Event){ clip_mc.x=-410.0; } btn_3.addEventListener(MouseEvent.CLICK,threeF);
function threeF(e:Event){ clip_mc.x=-570.0; }
x=0
this.addEventListener(Event.ENTER_FRAME,enterframeF);
function enterframeF(e:Event){
_x+=(x-_x)*0.2
}
Copy link to clipboard
Copied
:
stop(); btn_volver.addEventListener(MouseEvent.CLICK,volverF);
function volverF(e:Event){ clip_mc.x=0; } btn_adelantar.addEventListener(MouseEvent.CLICK,adelantarF);
function adelantarF(e:Event){ clip_mc.x=-410.0; } btn_3.addEventListener(MouseEvent.CLICK,threeF);
function threeF(e:Event){ clip_mc.x=-570.0; }
x=0
this.addEventListener(Event.ENTER_FRAME,enterframeF);
function enterframeF(e:Event){
_x+=(x-_x)*0.2
}
Copy link to clipboard
Copied
Thanks a lot.
It works !!!! just fine, I write (not copy and paste) your code in my file and it does well. Have a question .. is there a way to have that easing effect in the AS2 file???
THANKS SO LOT
Copy link to clipboard
Copied
should clip_mc be easing into those x values when the buttons are clicked?
Copy link to clipboard
Copied
Hello.
No ... don't have the esasing effect every time when the btn its clicked
http://skpepublicidad.com/pruebas/slider_as3.fla.zip
THANKS
Copy link to clipboard
Copied
i don't download and correct files unless i'm hired. so, you'll need to describe the easing (or post a link to your html/swf).