Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 05-03-2007, 12:22   #1 (permalink)
It's all a Game
 
Benutzerbild von Kandidat
 
Registriert seit: Sep 2004
Ort: Berlin
Beiträge: 53
Talking [DIASHOW] Cache-Problem mit loadMovie

Hallo Leute

Das Script funktioniert bereits in Mozilla und offline prima. Nur der Internetexplorer scheitert aus irgend einem Grund ständig beim letzten Bild. Wenn das Flash zum ersten mal in den Cache geladen wird lädt IE die ersten zwei Pics. Nach einem anschließenden Reload der Seite wird dann auch das dritte Image geloaded.

Was genau läuft da schief?

Hier das Flash in Aktion: http://www.outreach-osw.de

Hier das Srcipt:
Bildnazahl und einige andere Variablen werden mit einer XML defieniert

ActionScript:
  1. // [url]www.biffbang.de[/url] // FLYERCASE by Paul Holland - [email]paul.holland@web.de[/email] - (c)2007
  2. //
  3. //    F L Y E R C A S E  Version 1.0
  4. //       - improoved DIA-Script -
  5. //
  6. // GLOBAL SETTINGS
  7. //
  8. Object.registerClass("DIAdz", DIA);
  9. _global.getDiasLoaded = 0;
  10. _global.getDiaStatus = "ready";
  11. _global.POSITION = 0;
  12. //
  13. info = new XML();
  14. info.ignoreWhite = true;
  15. info.contentType = "text/xml";
  16. info.load(["---/flyer/info.xml"]);
  17. info.onLoad = function(success) {
  18.     infoXML = info.firstChild;
  19.     if (success) {
  20.         _root.info_txt.text = "";
  21.         showHead();
  22.     } else {
  23.         _root.info_txt.text = "Die Datei 'info.xml' konnte nicht geladen werden.";
  24.     }
  25. };
  26. function showHead() {
  27.     trace(infoXML.nodeName+" "+infoXML.attributes.domain);
  28.     trace("");
  29.     trace("Script: "+infoXML.attributes.script);
  30.     trace("Author: "+infoXML.attributes.author);
  31.     trace("");
  32.     Settings();
  33. }
  34. function Settings() {
  35.     Set = [];
  36.     for (var i = 0; i<infoXML.childNodes[1].childNodes.length; i++) {
  37.         Set[i] = infoXML.childNodes[1].childNodes[i].attributes.value;
  38.     }
  39.     _global.AUSWAHLFARBE = "0x"+Set[0];
  40.     _global.TIMEOUT = Math.abs(Set[1]);
  41.     _global.FADETIME = Math.abs(Set[2]);
  42.     _global.ROTATION = Math.abs(Set[3]);
  43.     //
  44.     infoXML.childNodes[0].removeNode();
  45.     //
  46.     _global.DIAANZAHL = Math.abs(infoXML.childNodes.length)-1;
  47.     trace("DIAS: "+DIAANZAHL);
  48.     //
  49.     _root.DROPDOWN();
  50. }
  51. //
  52. //
  53. //
  54. DROPDOWN = function () {
  55.     var i = 1;
  56.     var a = 0;
  57.     this.onEnterFrame = function() {
  58.         a++;
  59.         if (i<=DIAANZAHL && getDiaStatus == "ready" && a>=16) {
  60.             _root.attachMovie("DIAdz", ["dz"+i+"_mc"], i);
  61.             _root["dz"+i+"_mc"].init(i);
  62.             i++;
  63.             _global.getDiaStatus = "loading";
  64.         } else if (i>=DIAANZAHL) {
  65.             delete this.onEnterFrame;
  66.         }
  67.     };
  68. };
  69. //
  70. //
  71. DIA = function () {
  72. };
  73. DIA.prototype = new MovieClip();
  74. DIA.prototype.init = function(nr) {
  75.     this._alpha = 0;
  76.     this.nr = nr;
  77.     this.ok = false;
  78.     // Dateiname
  79.     this.path = ["---/flyer/"+infoXML.childNodes[this.nr].childNodes[0].attributes.value];
  80.     // Link
  81.     this.link = infoXML.childNodes[this.nr].childNodes[1].attributes.value;
  82.     //
  83.     trace("");
  84.     trace("Flyer"+this.nr+": "+this.path);
  85.     trace("Link: "+this.link);
  86.     this.load();
  87. };
  88. DIA.prototype.load = function() {
  89.     this.loadingdelay = 0;
  90.     this.dz.loadMovie(this.path);
  91.     this.onEnterFrame = function() {
  92.         this.bt = this.dz.getBytesTotal();
  93.         this.bl = this.dz.getBytesLoaded();
  94.         this.p = this.bl*100/this.bt;
  95.         // anzeige
  96.         _root.load_txt.text = "Lädt...  [ Flyer"+this.nr+": "+this.bt+"|"+this.bl+" ]";
  97.         if (this.p>=90) {
  98.             delete this.onEnterFrame;
  99.             _root.load_txt.text = this.nr+"";
  100.             this.loadOK();
  101.             _global.getDiasLoaded++;
  102.             _global.getDiaStatus = "ready";
  103.             //
  104.         } else if (this.bt == -1) {
  105.             this.loadingdelay++;
  106.             if (this.loadingdelay>=16) {
  107.                 delete this.onEnterFrame;
  108.                 _root.info_txt.text = "Error...  [ Flyer"+this.nr+" konnte nicht geladen werden. ]";
  109.                 this.loadOK();
  110.                 _global.getDiasLoaded++;
  111.                 _global.getDiaStatus = "ready";
  112.             }
  113.         }
  114.     };
  115. };
  116. D;
  117. DIA.prototype.loadOK = function() {
  118.     this.positionXY();
  119.     this.ok = true;
  120.     _root.info_txt.text = "Nummer: "+this.nr+" "+this.ok
  121. };
  122. DIA.prototype.positionXY = function() {
  123.     // Position
  124.     this.onEnterFrame = function() {
  125.         if (this.dz._width>=32) {
  126.             delete this.onEnterFrame;
  127.             this._x = Stage.width/2;
  128.             this._y = Stage.width/2;
  129.             this.dz._x -= this.dz._width/2;
  130.             this.dz._y -= this.dz._height/2;
  131.             //
  132.             this.swapDepths(10+this.nr);
  133.             this._xscale = 0;
  134.             this._yscale = 0;
  135.             //
  136.             this.aktion();
  137.             this.timeout((this.nr-1)*(TIMEOUT+1));
  138.         }
  139.     };
  140. };
  141. DIA.prototype.timeout = function(epos) {
  142.     this.e = epos;
  143.     this.getMyStart = ((TIMEOUT*this.nr)-TIMEOUT);
  144.     this.getMyEnd = (TIMEOUT*this.nr);
  145.     if (this.getMyEnd == TIMEOUT*DIAANZAHL) {
  146.         this.getMyEnd = 0;
  147.     }
  148.     this.getNextNr = ((this.getMyEnd/TIMEOUT)+1);
  149.     // Counter
  150.     this.onEnterFrame = function() {
  151.         if (this.e == 0) {
  152.             this.fadein();
  153.         } else if (this.e == TIMEOUT) {
  154.             this.fadeout();
  155.             POSITION = this.getMyEnd;
  156.         }
  157.         this.e++;
  158.     };
  159. };
  160. DIA.prototype.fadein = function() {
  161.     var fade = 100/FADETIME;
  162.     var rotate = ROTATION/FADETIME;
  163.     var i = 0;
  164.     this.onEnterFrame = function() {
  165.         if (i<=FADETIME) {
  166.             i++;
  167.             this._xscale = fade*i;
  168.             this._yscale = fade*i;
  169.             this._alpha = fade*i;
  170.             this._rotation = rotate*i-rotate;
  171.         } else {
  172.             this.swapDepths(30+this.nr);
  173.             this.timeout(FADETIME);
  174.         }
  175.     };
  176. };
  177. DIA.prototype.fadeout = function() {
  178.     var fade = 100/FADETIME;
  179.     var rotate = ROTATION/FADETIME;
  180.     var i = FADETIME;
  181.     var n = 0;
  182.     this.onEnterFrame = function() {
  183.         var key = _root["dz"+this.getNextNr+"_mc"].ok;
  184.         if (n == 0 && key == true) {
  185.             _root["dz"+this.getNextNr+"_mc"].e = 0;
  186.             n++;
  187.         }
  188.         if (i>=0 && key == true) {
  189.             i--;
  190.             this._xscale = fade*i;
  191.             this._yscale = fade*i;
  192.             this._alpha = fade*i;
  193.             this._rotation = rotate*i-rotate;
  194.         } else if (key == true) {
  195.             this.swapDepths(10+this.nr);
  196.             this.timeout(TIMEOUT+1);
  197.         }
  198.     };
  199. };
  200. DIA.prototype.aktion = function() {
  201.     //this.onRollOver = this.rollover;
  202.     //this.onRollOut = this.rollout;
  203.     this.onRelease = this.popup;
  204. };
  205. DIA.prototype.popup = function() {
  206.     getURL(this.link, "_top");
  207. };
  208. Stage.scaleMode = noScale;
  209. _root.info_txt._x = 0;
  210. _root.info_txt._y = 10;
  211. _root.load_txt._x = 0;
  212. _root.load_txt._y = Stage.height-load_txt._height-10;
  213. Object.registerClass("DIAdz", DIA);
__________________
//Iss nich immer so viel sinnlosen Zucker!
//Iss mal ne Banane zur Abwechslung!

viel.Vitamine = Gesund (Duuuuuuu! Ganove ;-)


Links:
Mein Kofferradio. Mit lauter Smith-Songs
Mein MySpace Account
Kandidat 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 02:25 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele