Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 29-02-2004, 21:19   #1 (permalink)
Neuer User
 
Registriert seit: Apr 2003
Ort: USA
Beiträge: 130
scroll Zuordnung

Ich habe eine Funktion, bei der ich aus einem XML file eine Tabelle generiere, die maskiert ist und die ichjetzt scrollbar machen moechte. Funktioniert auch alles soweit ganz gut. Nur leider faengt meine Tabelle schon an zu scrollen wenn sie geladen wird, da die funktion auf einer 'onEnterFrame' Aktion liegt. Irgendwie bleibe ich an der Stelle stecken. Ich will natuerlich, dass die Tabelle erst scrollt wenn ich den drag button presse.
Irgendwelche Ideen?

AS siehe unten
fla und xml attached

Danke.

oso

ActionScript:
  1. loadRounds = function (nID) {
  2.     this.__theSeriesID = nID
  3.     this.theURL ="RaceXML.xml";
  4.     trace(this.theURL)
  5.     XMLObj = new XML();
  6.     XMLObj.ignoreWhite = true;
  7.     XMLObj.mc = this;
  8.     XMLObj.load(this.theURL);
  9.     XMLObj.onLoad = function(){
  10.         theXML = this.firstChild.childNodes
  11.         this.mc.createRoundTable(theXML)
  12.     }
  13. };
  14.  
  15. createRoundTable = function (theXML) {
  16.     UpcomingRacesTable.removeMovieClip();
  17.     _root.theRaceTable.RT.removeMovieClip();
  18.     _root.theRaceTable.roundHeader.removeMovieClip();
  19.     this.RaceData = theXML;
  20.     tH = this.attachMovie("roundRow_link","roundHeader",111)
  21.     tH.rounds.text = "RD";
  22.     tH.location.text = "ORT";
  23.     tH.datum.text = "DATUM";
  24.     tH.rounds.backgroundColor  = tH.location.backgroundColor  = tH.datum.backgroundColor =0xa72525
  25.     RacesTable = this.createEmptyMovieClip("RT",122)
  26.     RacesTable._y = this.roundHeader._y + this.roundHeader._height+5
  27.     raceTabMask = this.attachMovie("mask_link","theTableMask",999)
  28.     raceTabMask._x = RacesTable._x
  29.     raceTabMask._y = RacesTable._y
  30.     raceTabMask._height = 150;
  31.     RacesTable.setMask(raceTabMask)
  32.     Nav = this.createEmptyMovieClip("tT",410)   
  33.     for(a=0; a<this.RaceData.length; a++){
  34.         RacesTable.attachMovie("roundRow_link","roundreihe"+a,222+a)
  35.         row = RacesTable["roundreihe"+a]
  36.         row._y = ((row._height+2)*a)+1;
  37.         row.ID =this.RaceData[a].attributes.ID;
  38.         row.location.backgroundColor  = row.datum.backgroundColor  = row.rounds.backgroundColor =0x0099FF;
  39.         row.rounds.text = a+1
  40.         row.theTitle = row.location.text = this.RaceData[a].attributes.TITLE
  41.         row.theLocation = this.RaceData[a].firstChild.childNodes;
  42.         row.theDate = row.datum.text = this.RaceData[a].firstChild.nextSibling.childNodes;
  43.         row.onRelease = function(){
  44.             this._parent._parent.loadRace(this.ID,this.theTitle,this.theLocation,this.theDate);
  45.            
  46.         }
  47.         row.onRollOver = function(){
  48.             this.rounds.backgroundColor = this.location.backgroundColor  = this.datum.backgroundColor  = this.series.backgroundColor =0xcccccc
  49.         }
  50.         row.onRollOut = function(){
  51.             this.rounds.backgroundColor = this.location.backgroundColor  = this.datum.backgroundColor  = this.series.backgroundColor =0x0099FF
  52.         }
  53.         raceTabMask._width = RacesTable._width+1;
  54.         ///SCROLLER
  55.         if(RacesTable._height >= raceTabMask.height){
  56.             tL = this.attachMovie("line_link","theLine",88);
  57.             tL._x = raceTabMask._x + raceTabMask._width + 5;
  58.             tL._y = RacesTable._y;
  59.             tL._height = raceTabMask._height;
  60.             targY = raceTabMask._y
  61.             tS = this.attachMovie("scroller_link","theScroller",99)
  62.             tS._x = tL._x - (tS._width/2)
  63.             tS._y = tL._y
  64.             tS.onPress = function(){
  65.                 startDrag(this,false,this._x,raceTabMask._y,this._x,RacesTable._height-this._height-5);   
  66.             }
  67.             tS.onRelease = tS.onReleaseOutside = function(){
  68.                 stopDrag();
  69.                
  70.             }
  71.             RacesTable.onEnterFrame=function(){
  72.                 scrollAmount=(RacesTable._height-(RacesTable._height/1.3))/(RacesTable._height-tS._height);
  73.                 targY=-tS._y*scrollAmount;
  74.                 RacesTable._y-=(RacesTable._y-targY)/5;
  75.                 //trace("scrollAmount: "+scrollAmount)
  76.             }
  77.         }
  78.         ///END SCROLLER   
  79.     }
  80. };
  81. loadRounds();
Angehängte Dateien
Dateityp: zip tabel.zip (8,4 KB, 10x aufgerufen)

Geändert von osoful (01-03-2004 um 17:00 Uhr)
osoful ist offline   Mit Zitat antworten
Alt 29-02-2004, 21:24   #2 (permalink)
FlashLove@FirstSight
 
Benutzerbild von FLASHStyler
 
Registriert seit: Feb 2003
Beiträge: 2.460
PHP-Code:
/* Vielleicht diese function auf den Button legen?*/
deinButton.onPress = function () {
RacesTable.onEnterFrame=function(){
                                
scrollAmount=(RacesTable._height-(RacesTable._height/1.3))/(RacesTable._height-tS._height);
                                
targY=-tS._y*scrollAmount;
                                
RacesTable._y-=(RacesTable._y-targY)/5;
                                
//trace("scrollAmount: "+scrollAmount)
                        
}

Sorry in deiner fla ist nichts zu sehen...
__________________
www.johannes-erhardt.com | blog | xing me baby

Geändert von FLASHStyler (29-02-2004 um 21:27 Uhr)
FLASHStyler ist offline   Mit Zitat antworten
Alt 01-03-2004, 17:02   #3 (permalink)
Neuer User
 
Registriert seit: Apr 2003
Ort: USA
Beiträge: 130
danke, es funktioniert ,wenn ich onEnterFrame auf die button action lege.
das naechste problem ist, dass die tabelle nicht wieder in die ausgangspositions zurueckscrollt.


p.s.:hab das zip file geupdated
osoful ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 05:29 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele