Hi there folks,
I'm having a small issue with the implementation of SharedObject.
My code is:
and then later on in a dynamicMCCode:var my_so:SharedObject; function jumpIn(){ attachMovie("startScreen", "startScreen", _root.getNextHighestDepth(),{_x:0,_y:24}); if(my_so.data.player != undefined){ trace(my_so.data.player); startScreen.myName.text = my_so.data.player; } else{ my_so = SharedObject.getLocal("dataGatherer"); // defines the SharedObject } } jumpIn();
The idea being that a repeat visitor will have his details filled into the dynamicMC form field rather than having to do it him/her self.Code:startScreen.dataEntry.onRelease = function() { // button is being pressed here numQ = startScreen.myQ.text; //count=numQ; me = startScreen.myName.text; myMail = startScreen.myEmail.text; if (startScreen.myName.text == "" || startScreen.myQ.text == "" || startScreen.myEmail.text == "") { display.htmlText = "Please enter your name, your email address and the number of questions you wish to answer."; } else if (numQ<1) { display.htmlText = "You must select between 1 and 50 questions"; } else { my_so.data.player = startScreen.myName.text; timer = numQ*90;// total time available in seconds initial_time = timer; startClock(); display.htmlText = "Click the question button to continue "+me; startScreen._visible = false; qbtn.enabled = true; reset_btn.enabled = false; for (var k = 0; k<topics.length; k++) { var tarray = topics[k].slice(2, 3); loadArray(myQuestions[tarray]);// load up the array } randomiseArray(); } };
It's not working.
Any idea where I'm going wrong?
Regards,
Charco


Reply With Quote
