Jump to content

ashenwraith

Members
  • Posts

    10
  • Joined

  • Last visited

ashenwraith's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. When you run the code above the output is JohnJohnJohnSallySallySally - notice there is no 500 delay between each cycle.The output should also be JohnSallyJohnSallyJohnSally(with a time delay between each).Compare that to this code here:http://www.kevlindev.com/tutorials/javascr.../count-down.htmBtw, at this time I had developed the code to 3 john and 5 sally (to emphasize the cycle difference) and getting rid of other vars other than firstname and cycles. The guy who helped me took liberties in changing sally to sarah, numbering the cycle for each, adding more time delays, etc - the core concept is there though.
  2. I found this 'solution' on faqts.com and applied it before I posted here - it doesn't work.I did however find someone who really understands OOPing when applied to javascript and he solved this issue.Anyone who is interested can read about it here:http://www.kevlindev.com/blog/?p=72
  3. This code is missing features and it doesn't even have an element name parameter.Anyways the following code I wrote below solved 99% of my problems:function person(firstname,lastname,age,eyecolor, cycles){ this.firstname=firstname this.lastname=lastname this.age=age this.eyecolor=eyecolor this.cycles = cycles; //this.newlastname=newlastname function load_person(firstname,lastname,age,eyecolor, cycles) { document.write(firstname); cycles--; var firstnamez=firstname var lastnamez=lastname var agez=age var eyecolorz=eyecolor var cyclesz = cycles; if(cycles <= 0) { return 0; } //var load_p = "load_person(firstnamez, lastnamez, agez, eyecolorz, cyclesz)"; load_person(firstnamez, lastnamez, agez, eyecolorz, cyclesz); //setTimeout(load_p, 500); return 0; } load_person(this.firstname, this.lastname, this.age, this.eyecolor, this.cycles); }new person("John","Doe",50,"blue", 3)new person("Sally","Rally",48,"green", 3) The only issue is that setTimeout will not recognize the load_person method within the object.Once I fix this, I'll be able to solve all of my coding problems by reapplying these techniques.
  4. Maybe you could try some way of emulating the F11 key with an event trigger.
  5. Alright, I have a lot of functions that are pretty much useless because they do not protect/instanciate the data within them, thus making them unusable for multiple objects (ie, tables, images, etc).I tried converting them to objects based on what refs I found on the inet, but they don't seem to work and I'm getting all sorts of errors like 'too much recursion', etc.I'm pretty sure I'm missing something small and this should work, ie maybe nest it in another object/function, move where/how the variables are declared, etc. Anyways if someone could help me out I'd really appreciate it - My code is below (I simplified it down to a single function/object).Direct links to the code:Procedural/Function:http://www.christophercoggins.com/Temp_Ref..._move_proc.htmlMy (broken) OOP/Object conversion:http://www.christophercoggins.com/Temp_Ref...e_move_OOP.htmlHere is a zip with both of these files:http://www.christophercoggins.com/Temp_Refs/zimage_move.zip
×
×
  • Create New...