Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 30-04-2005, 16:10   #1 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
broblem mit vor und zurück mit xml

hi also ich habe eine xml datei die ich auslese, aber ich habe leider ein kleinen fehler bei dem weiter & zurück btns. Also ich will immer in einem neuen tag rein indem die infos drin sind aber klappt nicht so ganz es wäre nett wennsich das jemand angucke würde und mir dann sagen könnte wo dran es liegt oder was ich ändern muss. okay ich bedanke mich schon mal.
ActionScript:
  1. stop();
  2.  
  3. //xml
  4. mein_xml = new XML();
  5. mein_xml.ignoreWhite = true;
  6. mein_xml.load("xml/inhalt.xml");
  7. //Lesevorgang
  8. mein_xml.onLoad = function(status) {
  9.     if (status && this.loaded) {
  10.         anzahl = mein_xml.firstChild.childNodes.length;
  11.         geladen = true;
  12.         inhalt = 0;
  13.         ladeinhalt(inhalt);
  14.         //trace(inhalt);
  15.     }
  16. };
  17. //Funktion, welche die Daten der XML-Datei verarbeitet
  18. function ladeinhalt(inhalt) {
  19.     //hier ist eine var die vorher bearbeitet werden soll
  20.     status_mc._visible = 1;
  21.     //ausgabe des unterknoten der xml
  22.     id = mein_xml.firstChild.childNodes[inhalt].attributes.id;
  23.     //seiten angaben und co.
  24.     aseite = mein_xml.firstChild.childNodes[inhalt].attributes.aseite;
  25.     geseite = mein_xml.firstChild.childNodes[inhalt].attributes.geseite;
  26.     //druckansicht
  27.     druck = mein_xml.firstChild.childNodes[inhalt].attributes.druck;
  28.     //überschrift und fießtext
  29.     headline = mein_xml.firstChild.childNodes[inhalt].attributes.headline;
  30.     subline = mein_xml.firstChild.childNodes[inhalt].attributes.subline;
  31.     url_text = mein_xml.firstChild.childNodes[inhalt].attributes.url_text;
  32.     //kleine bilder
  33.     kl_bild1 = mein_xml.firstChild.childNodes[inhalt].attributes.kl_bild1;
  34.     kl_bild2 = mein_xml.firstChild.childNodes[inhalt].attributes.kl_bild2;
  35.     kl_bild3 = mein_xml.firstChild.childNodes[inhalt].attributes.kl_bild3;
  36.     kl_bild4 = mein_xml.firstChild.childNodes[inhalt].attributes.kl_bild4;
  37.     kl_bild5 = mein_xml.firstChild.childNodes[inhalt].attributes.kl_bild5;
  38.     kl_bild6 = mein_xml.firstChild.childNodes[inhalt].attributes.kl_bild6;
  39.     //große bilder
  40.     gr_bild1 = mein_xml.firstChild.childNodes[inhalt].attributes.gr_bild1;
  41.     gr_bild2 = mein_xml.firstChild.childNodes[inhalt].attributes.gr_bild2;
  42.     gr_bild3 = mein_xml.firstChild.childNodes[inhalt].attributes.gr_bild3;
  43.     gr_bild4 = mein_xml.firstChild.childNodes[inhalt].attributes.gr_bild4;
  44.     gr_bild5 = mein_xml.firstChild.childNodes[inhalt].attributes.gr_bild5;
  45.     gr_bild6 = mein_xml.firstChild.childNodes[inhalt].attributes.gr_bild6;
  46.     //output the text in the data
  47.     loadVariablesNum(headline, 0);
  48.     loadVariablesNum(subline, 0);
  49.     loadVariablesNum(url_text, 0);
  50.     //output the small picture data
  51.     _root.createEmptyMovieClip("pic_kl1_mc", 101);
  52.     _root.pic_kl1_mc.loadMovie(kl_bild1, "pic_kl1_mc");
  53.     _root.pic_kl1_mc._x = 501;
  54.     _root.pic_kl1_mc._y = 462;
  55.     _root.createEmptyMovieClip("pic_kl2_mc", 102);
  56.     _root.pic_kl2_mc.loadMovie(kl_bild2, "pic_kl2_mc");
  57.     _root.pic_kl2_mc._x = 577;
  58.     _root.pic_kl2_mc._y = 462;
  59.     _root.createEmptyMovieClip("pic_kl3_mc", 103);
  60.     _root.pic_kl3_mc.loadMovie(kl_bild3, "pic_kl3_mc");
  61.     _root.pic_kl3_mc._x = 651;
  62.     _root.pic_kl3_mc._y = 462;
  63.     _root.createEmptyMovieClip("pic_kl4_mc", 104);
  64.     _root.pic_kl4_mc.loadMovie(kl_bild4, "pic_kl4_mc");
  65.     _root.pic_kl4_mc._x = 726;
  66.     _root.pic_kl4_mc._y = 462;
  67.     _root.createEmptyMovieClip("pic_kl5_mc", 105);
  68.     _root.pic_kl5_mc.loadMovie(kl_bild5, "pic_kl5_mc");
  69.     _root.pic_kl5_mc._x = 801;
  70.     _root.pic_kl5_mc._y = 462;
  71.     _root.createEmptyMovieClip("pic_kl6_mc", 106);
  72.     _root.pic_kl6_mc.loadMovie(kl_bild6, "pic_kl6_mc");
  73.     _root.pic_kl6_mc._x = 876;
  74.     _root.pic_kl6_mc._y = 462;
  75.     //bilder an anfang auf eins stellen
  76.     _root.pic_gr1_mc._visible = 1;
  77.     _root.pic_gr2_mc._visible = 0;
  78.     _root.pic_gr3_mc._visible = 0;
  79.     _root.pic_gr4_mc._visible = 0;
  80.     _root.pic_gr5_mc._visible = 0;
  81.     _root.pic_gr6_mc._visible = 0;
  82.     //output the first big picture data
  83.     _root.createEmptyMovieClip("pic_gr1_mc", 206);
  84.     _root.pic_gr1_mc.loadMovie(gr_bild1, "pic_gr1_mc");
  85.     _root.pic_gr1_mc._x = 500;
  86.     _root.pic_gr1_mc._y = 95;
  87.     _root.pic_gr1_btm.onRelease = function() {
  88.         _root.pic_gr1_mc._visible = 1;
  89.         _root.pic_gr2_mc._visible = 0;
  90.         _root.pic_gr3_mc._visible = 0;
  91.         _root.pic_gr4_mc._visible = 0;
  92.         _root.pic_gr5_mc._visible = 0;
  93.         _root.pic_gr6_mc._visible = 0;
  94.     };
  95.     _root.createEmptyMovieClip("pic_gr2_mc", 205);
  96.     _root.pic_gr2_mc.loadMovie(gr_bild2, "pic_gr2_mc");
  97.     _root.pic_gr2_mc._x = 500;
  98.     _root.pic_gr2_mc._y = 95;
  99.     _root.pic_gr2_btm.onRelease = function() {
  100.         _root.pic_gr1_mc._visible = 0;
  101.         _root.pic_gr2_mc._visible = 1;
  102.         _root.pic_gr3_mc._visible = 0;
  103.         _root.pic_gr4_mc._visible = 0;
  104.         _root.pic_gr5_mc._visible = 0;
  105.         _root.pic_gr6_mc._visible = 0;
  106.     };
  107.     _root.createEmptyMovieClip("pic_gr3_mc", 204);
  108.     _root.pic_gr3_mc.loadMovie(gr_bild3, "pic_gr3_mc");
  109.     _root.pic_gr3_mc._x = 500;
  110.     _root.pic_gr3_mc._y = 95;
  111.     _root.pic_gr3_btm.onRelease = function() {
  112.         _root.pic_gr1_mc._visible = 0;
  113.         _root.pic_gr2_mc._visible = 0;
  114.         _root.pic_gr3_mc._visible = 1;
  115.         _root.pic_gr4_mc._visible = 0;
  116.         _root.pic_gr5_mc._visible = 0;
  117.         _root.pic_gr6_mc._visible = 0;
  118.     };
  119.     _root.createEmptyMovieClip("pic_gr4_mc", 203);
  120.     _root.pic_gr4_mc.loadMovie(gr_bild4, "pic_gr4_mc");
  121.     _root.pic_gr4_mc._x = 500;
  122.     _root.pic_gr4_mc._y = 95;
  123.     _root.pic_gr4_btm.onRelease = function() {
  124.         _root.pic_gr1_mc._visible = 0;
  125.         _root.pic_gr2_mc._visible = 0;
  126.         _root.pic_gr3_mc._visible = 0;
  127.         _root.pic_gr4_mc._visible = 1;
  128.         _root.pic_gr5_mc._visible = 0;
  129.         _root.pic_gr6_mc._visible = 0;
  130.     };
  131.     _root.createEmptyMovieClip("pic_gr5_mc", 202);
  132.     _root.pic_gr5_mc.loadMovie(gr_bild5, "pic_gr5_mc");
  133.     _root.pic_gr5_mc._x = 500;
  134.     _root.pic_gr5_mc._y = 95;
  135.     _root.pic_gr5_btm.onRelease = function() {
  136.         _root.pic_gr1_mc._visible = 0;
  137.         _root.pic_gr2_mc._visible = 0;
  138.         _root.pic_gr3_mc._visible = 0;
  139.         _root.pic_gr4_mc._visible = 0;
  140.         _root.pic_gr5_mc._visible = 1;
  141.         _root.pic_gr6_mc._visible = 0;
  142.     };
  143.     _root.createEmptyMovieClip("pic_gr6_mc", 201);
  144.     _root.pic_gr6_mc.loadMovie(gr_bild6, "pic_gr6_mc");
  145.     _root.pic_gr6_mc._x = 500;
  146.     _root.pic_gr6_mc._y = 95;
  147.     _root.pic_gr6_btm.onRelease = function() {
  148.         _root.pic_gr1_mc._visible = 0;
  149.         _root.pic_gr2_mc._visible = 0;
  150.         _root.pic_gr3_mc._visible = 0;
  151.         _root.pic_gr4_mc._visible = 0;
  152.         _root.pic_gr5_mc._visible = 0;
  153.         _root.pic_gr6_mc._visible = 1;
  154.     };
  155.     //btns für weiter und zurück
  156.     trace(inhalt);
  157.     trace(geladen);
  158.     trace(ladeinhalt);
  159.     trace(anzahl);
  160.  
  161.     weiter.onRelease = function ()
  162.     {
  163.         trace(inhalt);
  164.         trace(geladen);
  165.         trace(ladeinhalt);
  166.         trace(anzahl);
  167.         if (geladen && inahlt < anzahl - 1)
  168.         {
  169.             inhalt++;
  170.             ladeinhalt(inhalt);
  171.         } // end if
  172.     };
  173.    
  174.     zurueck.onRelease = function ()
  175.     {
  176.         trace(inhalt);
  177.         if (geladen && inahlt > 0)
  178.         {
  179.             inhalt--;
  180.             ladeinhalt(inahlt);
  181.         } // end if
  182.     };
  183.  
  184. }
flozwo ist offline   Mit Zitat antworten
Alt 01-05-2005, 15:55   #2 (permalink)
helpQLODhelp
 
Benutzerbild von bokel
 
Registriert seit: Feb 2002
Ort: Köln
Beiträge: 8.505
Heisst die betreffende Variable inahlt oder inhalt?
mfg. r.
bokel ist offline   Mit Zitat antworten
Alt 03-05-2005, 07:48   #3 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
Talking

ja aber der springt noch nciht einmal vor also der geht nciht weiter.
ActionScript:
  1. _root.weiter.onRelease = function ()
  2.     {
  3.         trace(inhalt);
  4.         trace(geladen);
  5.         trace(ladeinhalt);
  6.         trace(anzahl);
  7.        
  8.         if (geladen && inahlt < anzahl - 1){
  9.             inhalt++;
  10.             ladeinhalt(inhalt);
  11.         } // end if
  12.         /*
  13.         if (geladen && fragen<anzahl-1) {
  14.         fragen++;
  15.         ladefragen(fragen);
  16.         }
  17.         */
  18.     };
  19.    
  20.     _root.zurueck.onRelease = function ()
  21.     {
  22.         trace(inhalt);
  23.         if (geladen && inhalt > 0)
  24.         {
  25.             inhalt--;
  26.             ladeinhalt(inhalt);
  27.         } // end if
  28.     };


aber schon mal danek das du mir den fehler gesagt hast=)
flozwo ist offline   Mit Zitat antworten
Alt 03-05-2005, 07:52   #4 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
Talking

okay danke habe es funden.
Man sieht meinchmal dem Wald vor lauter Bäumen nicht mehr.
freu freu =)
Danke
flozwo ist offline   Mit Zitat antworten
Alt 03-05-2005, 08:28   #5 (permalink)
Neuer User
 
Registriert seit: Sep 2004
Beiträge: 888
aber jetzt noch eine andere frage wie kann ich dem sagen das der direkt zu einer sezien id springen soll. also ich sag dem id ist "1" und dann gehe ich ins nechste frame und gib dem den wert. also so hatte ich mir das vorgestellt.

habe aber noch keine idee wie ichdas machen soll.
flozwo 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:10 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele