Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

myData = new LoadVars() -> on(press) reLoad myData??

Status
Not open for further replies.

Curisco

Programmer
Feb 6, 2002
90
SE
Helo folks,
Please can some one help me figure out how to reload the below code, which is lying on frame two

i woild like to give the person the option to "restart", go to the beginning of frame two by-passing the "intro" on frame one.

logo_btn.onPress= function(){
goToAnd stop(2);
}

gives an undesired result. on frame two there are many mc's therefore i need to "reset" all of those also.

i believe reloading frame two will bring me back to the start "default position" of frame two.

hope this makes sense.

i have tried almost everything, google, onEnterFrame, splitting into Scenes, amongst others. i feel i'm close ...but alas...

the code:


myData = new LoadVars()
myData.load("default.txt")
//Make a reference to "this" timeline
myData.ref = this
//Callback handler and data fetching
myData.onLoad = function(succes){
if(succes){
for(var i=0; i<this.cant; i++){
this.ref["Title_txt"+i].htmlText = "<b>"+this["Title"+i]+"</b>"
this.ref["Comments_txt"+i].text = this["Comments"+i]
this.ref["holder_mc"+i].loadMovie(this["Image"+i])


}
} else trace("Error loading data")

}


Fla provided if needed.

Thanks Ramsey

-------------------------------------
Laughing out loud every day,
keeps the doctor away....gotoAndPlay
-------------------------------------
 
If you wrap the whole thing up in a function you can call it from where ever you like - although you'll probably have to make a change to the 'ref' setup as 'this' inside a function refers to the function itself rather than the timeline:

Code:
loadData=function(){
//your existing code here
}
 
Can you zip the whole thing and post it? Need to see it.

Wow JT that almost looked like you knew what you were doing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top