3 Replies - 1436 Views - Last Post: 20 December 2018 - 03:42 PM

#1 Lupo_Slazy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-December 18

Beginner.. need help for a little project

Posted 18 December 2018 - 08:01 AM

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.



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)

 

    }
:code:

Attached image(s)

  • Attached Image

This post has been edited by modi123_1: 18 December 2018 - 08:02 AM
Reason for edit:: In the future, please use the [code] tag button in the editor.


Is This A Good Question/Topic? 0
  • +

Replies To: Beginner.. need help for a little project

#2 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2366
  • View blog
  • Posts: 7,220
  • Joined: 15-January 14

Re: Beginner.. need help for a little project

Posted 18 December 2018 - 10:16 AM

It seems like it would make sense to put all of your images in a movie clip with transitions between the images if you'd like (e.g. fade), and then use the position of the slider to determine which frame to skip to in the movie clip. You could also just play it to see the entire transition play out without the slider.
Was This Post Helpful? 0
  • +
  • -

#3 Lupo_Slazy   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-December 18

Re: Beginner.. need help for a little project

Posted 20 December 2018 - 12:37 PM

View PostArtificialSoldier, on 18 December 2018 - 10:16 AM, said:

It seems like it would make sense to put all of your images in a movie clip with transitions between the images if you'd like (e.g. fade), and then use the position of the slider to determine which frame to skip to in the movie clip. You could also just play it to see the entire transition play out without the slider.


This is exactly what I need. SO when moving the sliderbutton the images fade, whether it goes left or right, determined by xposition and frame.

But how can I do that? I am a beginner and cant find any helpful code
Was This Post Helpful? 0
  • +
  • -

#4 ArtificialSoldier   User is offline

  • D.I.C Lover
  • member icon

Reputation: 2366
  • View blog
  • Posts: 7,220
  • Joined: 15-January 14

Re: Beginner.. need help for a little project

Posted 20 December 2018 - 03:42 PM

I don't think you need much code there, other than on the slider. You would build the movie clip in the IDE and import your pictures, set the tween animations that you want, etc, and then just control that movie clip with the slider. If you're already getting the position of the slider then you just need to translate that to a frame in the movie clip.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1