{lang: 'de'}
Flashhilfe.de - Flash Community

Problem mit Scrollbar - Position [Flash 9]

 


AntwortenRegistrieren Seite1  

pat_and_nobody#1
Benutzerbild von pat_and_nobody
Beiträge: 478
Registriert: Aug 2007

17.05.2011, 17:25

Also, ich verwende in meinem AS2 Projekt eine Scrollbar.

http://bit.ly/kiEXKa

Das Problem ist, das die irgendwie fehlerhaft scrollt. Hab aber meines Erachtens alles richtig eingestellt in dem Script. Sieht den Fehler jemand.

ActionScript:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function Scroller()
{
     dragger.useHandCursor = false;
     targY = 0;
     //set the x position of the dragger
   //dragger._x=theMask._width;
   //set the drag action of the dragger
   //drag is restricted to the height of the mask
   dragger.onPress = function()
     {
        startDrag(this, false, this._x, 69, this._x, theMask._height+69 - this._height);
     };
     //stop the drag
   dragger.onRelease = dragger.onReleaseOutside = function ()
     {
        stopDrag();
     };
     //set the mask for the text
   //inhalt_mc.setMask(theMask);
   //the scrolling animation
   inhalt_mc.onEnterFrame = function()
     {
        /*set a variable
        this variable basically stores info regarding what fraction of the total text
        is being displayed through the mask and ensures that dragging the dragger
        from top to bottom will reveal all the text.
        this allows you to change the amount of text and the scroller will update itself
        */

        
        scrollAmount = (this._height - (theMask._height / 1.3)) / (theMask._height - dragger._height);
        
        //set a new target y position
      targY = -dragger._y * scrollAmount;
        //set the y of the text to 1/5 of the distance between its current y and the target y

        //change the 5 to a lower number for faster scrolling or a higher number for slower scrolling
      //this._y -= (this._y - targY) / 20;
      this._y -= (this._y - targY) / 30;
        //this._y = 69;
   };
}
Schlagwörter: AS2, position, scrollbar
pat_and_nobody#2
Benutzerbild von pat_and_nobody
Beiträge: 478
Registriert: Aug 2007

Themenautor/in

18.05.2011, 16:22

Hat keine eine Idee? Habe schon mit den Werten herumprobiert, aber irgendwas durchblick ich mit der Berechnung nicht.
skoda#3
Benutzerbild von skoda
Beiträge: 1189
Wohnort: Boston MA
Registriert: Feb 2006

18.05.2011, 20:18