Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 12-06-2005, 11:32   #1 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
mc#s inner halb verschachtelter arrays auf _x ausrichten

habe 8 mc's, die einen prototype aufrufen, im prototype werden zwei parameter mitgegeben;
der prototype aufruf mit der arrylösung funktioniert einwandfrei;
nun möcht ich die mc's GLEICHMÄßIG ausrichten;
das erste mc(MC_home) MUSS auf _X 12 liegen;
die andren sollen sich dann so ausrichten:

"mc_x = mc_linksdavor._x+mc_linksdavor._width+25;"

das bekomme ich aber in der array-schleife nicht gebacken...
ActionScript:
  1. var links = [["MC_home", "Home", "home.swf"], ["MC_vorstellung", "Vorstellung", "vorstellung.swf"], ["MC_service", "Service", "service.swf"], ["MC_speisen", "Speisen", "speisen.swf"], ["MC_presse", "Presse", "presse.swf"], ["MC_kontakt", "Kontakt", "kontakt.swf"], ["MC_linktipps", "Linktipps", "linktipps.swf"], ["MC_impressum", "Impressum", "impressum.swf"]];
  2. for (l=0; l<=links.length; l++) {
  3.     var linkzahl = links[l];
  4.     var linkbutton = linkzahl[0];
  5.     var bezeichner = linkzahl[1];
  6.     var datei = linkzahl[2];
  7.     _root[linkbutton].link(bezeichner, datei);//das funktioniert.....
  8.     //ab da geht's nimmer:
  9. for (a=0; a<=links.length; a++) {
  10.         var clip = links[a+1];
  11.         var clipname = clip[0];
  12.         var pos = 12;
  13.         _root[clipname]._x = pos+_root[clipname]._width+20;
  14.     }
  15. }
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 12-06-2005, 11:55   #2 (permalink)
agedoubleju
Gast
 
Beiträge: n/a
Das würde ich nicht in einer zusätzlichen Schleife machen, die würde ja sonst ständig alle Positionen überschreiben. Stattdessen würde ich abfragen, ob l==0 ist, wenn ja, dann den MC auf die erste Position setzen, wenn nein dann den MC auf die Position des vorherigen MCs plus dessen _width plus 20 setzen.
  Mit Zitat antworten
Alt 12-06-2005, 18:19   #3 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
Thumbs up

thx!
ActionScript:
  1. var buttons = ["MC_home", "MC_vorstellung", "MC_service", "MC_speisen", "MC_presse", "MC_kontakt", "MC_linktipps", "MC_impressum"];
  2. for (b=0; b<=buttons.length; b++) {
  3.     butt = buttons[b];
  4.     prebutt = buttons[b-1];
  5.     mc = _root[butt];
  6.     mcpre = _root[prebutt];
  7.     mc._x == 0 ? mc._x=12 : mc._x=mcpre._x+mcpre._width+25;
  8.     //mc._x = (mc._width+20)*b;
  9. }
funzt noch nicht ganz...das erschte is net auf zwölf....hmmmmmmmmmmm

edit
aber jetzt:
ActionScript:
  1. var buttons = ["MC_home", "MC_vorstellung", "MC_service", "MC_speisen", "MC_presse", "MC_kontakt", "MC_linktipps", "MC_impressum"];
  2. for (b=0; b<=buttons.length; b++) {
  3.     butt = buttons[b];
  4.     prebutt = buttons[b];//vorgänger-mc
  5.     postbutt = buttons[b+1];//nachfolger-mc
  6.     mc = _root[butt];
  7.     mcpre = _root[butt];
  8.     mcpost = _root[postbutt];
  9.     if (mc == 0) {
  10.         mc._x = 12;
  11.     } else {
  12.         mcpost._x = mcpre._x+mcpre._width+40;
  13.     }
  14. }
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary

Geändert von andretti (12-06-2005 um 18:54 Uhr)
andretti 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 22:21 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele