• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

As3 Slider

New Here ,
Oct 04, 2010 Oct 04, 2010

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

TOPICS
ActionScript

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 04, 2010 Oct 04, 2010

:


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 }

Votes

Translate

Translate
Community Expert ,
Oct 04, 2010 Oct 04, 2010

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 }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2010 Oct 04, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2010 Oct 04, 2010

Copy link to clipboard

Copied

should clip_mc be easing into those x values when the buttons are clicked?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 04, 2010 Oct 04, 2010

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 04, 2010 Oct 04, 2010

Copy link to clipboard

Copied

LATEST

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).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines