Mornign Guys/Girls I am having some trouble nulling out or stopping some dynamic variables i have created ...
I have built a dynamic window system which does alot of things, one is checking a database to ensure the most up to date information is in input boxes ... Now to check this i create a dynamic variable when the contents is loaded via an ajax request... [code] checkRecord_<?php echo($rand); ?> = new PeriodicalExecuter(function() { testingRecord('<?php echo($rand); ?>'); },7); [/code] in this rand is just a unix epoch on when the page was created and is referenced throughout the whole entire page and all its elements ... for those that dont know php here is a simpler version of the code [code] checkRecord_123423414 = new PeriodicalExecuter(function() { testingRecord('123423414'); },7); [/code] in the DOM there is now a variable called "checkRecord_123423414" (please bear in mind this is dynamic so i cant just do checkRecord_123423414=null; when i want to null it or stop the object as the ending string is allways different dependant on what page you are on ... Now the problem i get is when closing the windows in the system (which are just div containers) i have to stop observing alot of stuff ... this is done quite easily with stopObserving(); But i need to stop the PeriodicalExecutor from continuing once the window is closed ... i have tried to use "checkRecord_+e.stop();" (`e` is the random string passed to it) but it gives me a syntax error i have tried to use "checkRecord_+e=null;" but the interpretor does not recognise the dynamic variable ..... is there a way i can assign the variable to something so it inherits all of the things i need to stop in it .. Something like (PSUEDO CODE) [psuedo code] var blah='checkRecord_'+e; blah=null; [/psuedo code] Will this inherit the "new PeriodicalExecutor" stuff in it so i can null the object and stop it listening ? It allready half works just by closing the window, but if you close it while its doing a request (testingRecord();) it moans about things being null (as they are removed from the dom prior to the object being nulled out !!! Sorry if this makes no sense at all !! if anything needs clarifying please ask Regards Alex --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---