PDA

Volledige versie bekijken : Soort van vernieuwen


thebeatman
%Europe/Berlin %786 %2005, 18:52
Beste mensen!

Ik ben bezig met het maken van een flash site. Nou laad ik een .txt bestand in mijn flash en dat doet hij allemaal prima. Maar als ik wat toevoeg in dat .txt bestand en ik refresh mijn site dan staat dat er niet in. Ik moet steeds mijn tijdelijke internet bestanden leeg gooien voor hij het erin laad. Is er niet iets waarmee ik het .txt bestand bijv. elke 5 minuten laat refreshen? Een auto refresh dus. Dit is mijn Actionsript.

// create a new loadVars object
mySimpleText = new LoadVars();
// use the loadVars.load() method to retrieve the textfile
mySimpleText.load("nieuws_txt.txt");
// use the loadVars.onLoad() event to put the data in the textfield
mySimpleText.onLoad = function(success) {
if (success) {
nieuws_txt.text = this.mySimpleVar;
} else {
getURL("javascript:alert('Could not load the requested textfile');");
}
};

Groeten,
Ronald

Dauntless
%Europe/Berlin %803 %2005, 19:17
Als je'm automatisch opnieuw wilt laten inladen moet je een functie maken die alles inlaadt, en die dan met een setInterval oproepen.

Om het gewone cache probleem tegen te houden, helpt dit wel:


// create a new loadVars object
mySimpleText = new LoadVars();
// use the loadVars.onLoad() event to put the data in the textfield
mySimpleText.onLoad = function(success) {
if (success) {
nieuws_txt.text = this.mySimpleVar;
} else {
getURL("javascript:alert('Could not load the requested textfile');");
}
};// use the loadVars.load() method to retrieve the textfile
mySimpleText.load("nieuws_txt.txt?d="+Math.random()*99999999);

Groeten,
Ronald[/QUOTE]

thebeatman
%Europe/Berlin %924 %2005, 22:10
Hij doet hij hiermee ook auto refreshen?

Jordy
%Europe/Berlin %927 %2005, 22:15
nee, als je goed leest wat ie zegt ;). Dan zou je een interval gebruiken, zoek even op in de help :)