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

Stuck in easy project.. need help

Community Beginner ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

Hey guys,

I normally dont ask for help and try to get it on my own but after searching and trying for days I now ask for your help.

Would be awesome!

Here is what I try to do:

I want to have 82 pictures of showing a process of a flower while growing. so when you move the slider to the right, it should seem like a transition of all the pictures,

so when x position is 1: show picture 1, when slider is on 82, show pictures 82, and all that seamless and not only when realising the sliderbutton.

Unbenannt.PNG

I build a slider, and when releasing it it gives me the number of the position of the slider.

2 things i need is:

1. I need a output that is constantly (not only when releasing)

2. the code which connects the position with the the pictures

I hope you get what I mean, i really really would apreciate the help, thank you

also here is the code:

var knopf;

knopf =btn_knopf

var slider_start:Number;

var slider_ende:Number;

var slider_breite:Number;

var prozent:int

slider_start = btn_strich.x+6;

slider_ende = btn_strich.width + slider_start;

slider_breite = btn_strich.width;

knopf.x = slider_start;

knopf.y = btn_strich.y;

var slider_grenzen:Rectangle=new Rectangle(slider_start,

                                      btn_strich.y,

                                      slider_breite -20,

                                      0);

   

knopf.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void

    {

    knopf.startDrag(false,slider_grenzen);

       

    }

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void

    {

    knopf.stopDrag();

       

        prozent = ((knopf.x - slider_start) /  ((slider_breite -20) / 100) )

        trace (prozent)

    }

Views

169

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 , Dec 18, 2018 Dec 18, 2018

try:

lucasw20586300

var knopf;

knopf =btn_knopf

var slider_start:Number;

var slider_ende:Number;

var slider_breite:Number;

var prozent:int

slider_start = btn_strich.x+6;

slider_ende = btn_strich.width + slider_start;

slider_breite = btn_strich.width;

knopf.x = slider_start;

knopf.y = btn_strich.y;

var slider_grenzen:Rectangle=new Rectangle(slider_start,

                                      btn_strich.y,

                                      slider_breite -20,

                                      0);

   

knopf

...

Votes

Translate

Translate
Community Expert ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

LATEST

try:

lucasw20586300

var knopf;

knopf =btn_knopf

var slider_start:Number;

var slider_ende:Number;

var slider_breite:Number;

var prozent:int

slider_start = btn_strich.x+6;

slider_ende = btn_strich.width + slider_start;

slider_breite = btn_strich.width;

knopf.x = slider_start;

knopf.y = btn_strich.y;

var slider_grenzen:Rectangle=new Rectangle(slider_start,

                                      btn_strich.y,

                                      slider_breite -20,

                                      0);

   

knopf.addEventListener(MouseEvent.MOUSE_DOWN, fl_ClickToDrag);

function fl_ClickToDrag(event:MouseEvent):void

    {

    knopf.startDrag(false,slider_grenzen);

       this.addEventListener(Event.ENTER_FRAME,updateF);

    }

function updateF(e:Event):void}

        prozent = ((knopf.x - slider_start) /  ((slider_breite -20) / 100) )

        trace (prozent)

}

stage.addEventListener(MouseEvent.MOUSE_UP, fl_ReleaseToDrop);

function fl_ReleaseToDrop(event:MouseEvent):void

    {

    knopf.stopDrag();

              this.removeEventListener(Event.ENTER_FRAME,updateF); 

    }

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