View Full Version : asp refresh
padone
06-14-2005, 01:28 PM
I need to add some asp into my page that will refresh the asp everytime it loads
Any Ideas???? :D
You want to refresh the ASP page or the page containing the flash?
padone
06-14-2005, 02:10 PM
my flash is on a html page and i have a highscores movieclip that calls a asp page which gets the highscores from the database and then sends them to my flash but the thing is it only refreshs when i clear my history and delete files in my internet options???
Try adding this:
?nocache=" + getTimer()
to the your loadvars statement. It prevents the browser from caching.
padone
06-14-2005, 02:36 PM
sorry where about do i put it in my flash
myData = new LoadVars()
myData.load("highscores.asp")
myData.ref = this
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.cant; i++){
this.ref["Title_txt"+i].htmlText = "<b>"+this["yourname"+i]+"</b>"
this.ref["Comments_txt"+i].text = this["yourtime"+i]
}
} else trace("Error loading data")
}
stop()
myData.load("highscores.asp?nocache=" + getTimer());
padone
06-14-2005, 02:48 PM
that worked a treat cheers
padone
06-14-2005, 03:19 PM
Sorry i have another problem...
I have this code that sends the data to the database
submit.onPress = function(){
if(yourname.text!="" && yourtime.text !="" && youremail.text!=""){
myData.yourname = yourname.text
myData.yourtime = yourtime.text
myData.youremail = youremail.text
myData.sendAndLoad("save.asp", myData, "POST")
}
}
myData = new LoadVars()
myData.onLoad = function(){
if(this.writing=="Ok") {
gotoAndPlay(8)
status.text = "Submited data was saved"
}
else status.text = "Error in saving submitted data"
}
stop();
the thing is that if you dont clear history and delete files it only lets you submit it once???
padone
06-14-2005, 03:20 PM
could it have something to do with this line perhaps its cacheing
if(this.writing=="Ok") {
think it has to do with your loadvars() structure. You have it split across 2 functions. I would rework that and make it one function. That should solve the refreshing problem.
padone
06-14-2005, 03:36 PM
so perhaps if i put this
myData = new LoadVars()
myData.onLoad = function(){
submit.onPress = function(){
if(yourname.text!="" && yourtime.text !="" && youremail.text!=""){
myData.yourname = yourname.text
myData.yourtime = yourtime.text
myData.youremail = youremail.text
myData.sendAndLoad("save.asp", myData, "POST")
if(this.writing=="Ok") {
gotoAndPlay(8)
status.text = "Submited data was saved"
}
else status.text = "Error in saving submitted data"
}
}
}
stop();
submit.onPress = function(){
if(yourname.text!="" && yourtime.text !="" && youremail.text!=""){
myData = new LoadVars()
myData.yourname = yourname.text
myData.yourtime = yourtime.text
myData.youremail = youremail.text
myData.onLoad = function(){
if(this.writing=="Ok") {
gotoAndPlay(8)
status.text = "Submited data was saved"
}
else status.text = "Error in saving submitted data"
}
myData.sendAndLoad("save.asp", myData, "POST")
}
}
stop();
Think I just confused myself....
padone
06-14-2005, 05:44 PM
that didnt seem to do the trick but cheers for your help today you have been a life saver
Ill return the favour some time :)
what isnt it doing exactly, or has nothing changed?
padone
06-15-2005, 09:49 AM
nothing changed i still only get one chance to submit a highscore
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.