Jump to content

Chocolate570

Members
  • Posts

    1,550
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Chocolate570

  1. <script type="text/javascript">function wizard(src,writer,txt,imager){this.src=src;this.writer=writer;this.txt=txt;this.imager=imager;}blue=new wizard();blue.src="lotad.gif"blue.writer="Blaaaaaa!"blue.txt="text"blue.imager="imager"</script>

    Well, you can't make an object from another function. The object has to be declared as: blue=new Object(). It should work once you've fixed the bug I stated above, but your wizard() function wont, so I suggest you add an extra parameter in the function and then call it, like this:

    <script type="text/javascript">function wizard(src,writer,txt,imager){document.getElementById(this).src=src;document.getElementById(this).writer=writer;document.getElementById(this).txt=txt;document.getElementById(this).imager=imager;x=document.createElement("img");x.src=this.src;}blue=new Object();blue.src="lotad.gif"blue.writer="Blaaaaaa!"blue.txt="text"blue.imager="imager"</script>

    What that should do is make the object's values worth different things and then make an image tag and change the src of it to the object's SRC. Sorry if it doesn't work, I'll have another go :)

  2. Do you think you could please keep your questions in one topic? You've made quite a bit of topics. Thanks.It didn't work in firefox for me, but that might just be because the images aren't be displayed. But what happens wrong?

  3. I don't understand. Will this be used for your game, or what? This is all I can think of.

    wizard = new Object();wizard.src="src of image"wizard.writer="what writes"wizard.txt="text"wizard.imager="imager"

  4. It worked perfectly for me when I shortened the code to this:

    <head><script type="text/javascript">function wizard(){alert("Blaa,blaa, blaa,blaa,blaa,blaa,blaa,blaa,blaa,")}</script></head><img src="http://i43.photobucket.com/albums/e366/kyogre_atlas/Zelda%20spritet/npc_wizard.gif" onmouseover="wizard()">

    By the way, I only removed the extra style attributes for aesthetic purposes. :)

  5. me and you both chocolate
    I believe the saying goes "You and me both" smile.gifOh...include me too.
    So..."him, you and me all"or, since it's me saying this:"him, him and you all"or something like that.
    It's official. None of us have lives. Hey, that means we're immortal! Woohoo! :)
    • Like 1
  6. "I can see clearly now the rain is gone"  Sorry, couldn't help it  :) I think I understand now:var x = 2;x += 8;which means x now = 10.  It takes the previous value of "x" and adds the new value to the current value of "x"...right?If not, I guess I'll need more coffee to finish waking up.

    Gosh darnit...I forgot to take out my new umbrella. Oh well, next time it comes around, i'll be waiting. :)
  7. Check out the operators page. What the += does is this. In this example, the two statements are the same.

    //First Statement, using the +=var x;x+=2;//End of first. Starting second.x=x+2//End....

    As you can see, += means the same thing as the variable is itself plus an integer or another variable. Do you get what I mean?

  8. OOP is usually used in languages where you interact with the user----and that interactivity is very important.

    <script type="text/javascript">var coder=new Object() //declare the objectcoder.name="Choco" //set the method 'name' to 'Choco'coder.prefLang="JavaScript" //set the method 'prefLang' to 'JavaScript'document.write("Our new coder is "+coder.name+". He likes "+coder.prefLang+". Welcome!");</script>

    That's a code to show you how to declare objects and use them. This is one that's an application in most sites.

    <script type="text/javascript">x=document.getElementById("test") //set x to the object 'test'x.src="omghaxxors.gif" //set the method 'src' to 'omghaxxors.gif'</script>

    Do you understand?

  9. Putting styles in are very hard in phpbb, at least the proper way. What you do is put <style type="text/css"> sig css here</style> at the beginning of overall_header.tpl. And then do whatever you have to.

×
×
  • Create New...