Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Flash or JavaScript] Coding a banner

Initiate Mage
Joined
Jan 5, 2010
Messages
3
Reaction score
0
=================
===Lerck===
=================


Hey guys.
I was surfing the net and I looking at these banners , and all of a sudden I had a idea which I thought you guys
could help me with.
Can you guys help me make a black background banner with white text saying "can you count to 3?" and underneath it ,
it will have a white button saying "yes" and beside it , another one saying "no". But theIre is a catch. When you put
your mouse over the YES or NO button , it moves. Say it moves up/down or left/right so you can never press it. When
you restart the homepage , it goes back to normal.

-I would have posted this in the Graphics zone but I don't think this has anything to do with Graphics.
-I'm not sure if this can be done, I was just wondering.

Sorry if this is the wrong section, I don’t know which other section could help me create this.
 
Last edited by a moderator:
Legendary Battlemage
Loyal Member
Joined
Apr 7, 2009
Messages
647
Reaction score
25
Re: [Help] Coding a banner

Java script should do the job.
Although I don't think it'll be impossible, if the person has fast reflexes, and knows where the button will go next (or if they have an autoclicker)
 
Junior Spellweaver
Joined
Nov 9, 2008
Messages
178
Reaction score
5
Re: [Help] Coding a banner

Do you mean like If you were to adapt that with a simple if function you could pretty easily make it. I don't know JS so I wouldn't know how to. But yes, Javascript would be pretty handy for this.
 
Status: Pooping
Joined
Jul 16, 2008
Messages
861
Reaction score
25
Re: [Help] Coding a banner

You don't need to know action script ^^
Just start a new project in photoshop actioscript 3, make a button for yes and no double click on the buttons for what it has to see if you rollover^^ so wut!:)
 
Legendary Battlemage
Loyal Member
Joined
Apr 7, 2009
Messages
647
Reaction score
25
Google Cache:
PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> 
<base href="http://www.jordaaan.com/"><div style="margin:-1px -1px 0;padding:0;border:1px solid #999;background:#fff"><div style="margin:12px;padding:8px;border:1px solid #999;background:#ddd;font:13px arial,sans-serif;color:#000;font-weight:normal;text-align:left">This is Google's cache of <a href="http://www.jordaaan.com/" style="text-decoration:underline;color:#00c">http://www.jordaaan.com/</a>. It is a snapshot of the page as it appeared on 26 Dec 2009 04:56:40 GMT. The <a href="http://www.jordaaan.com/" style="text-decoration:underline;color:#00c">current page</a> could have changed in the meantime. <a href="http://www.google.com/intl/en/help/features_list.html#cached" style="text-decoration:underline;color:#00c">Learn more</a><br><br><div style="float:right"><a href="http://74.125.155.132/search?q=cache:http://jordaaan.com/&hl=en&strip=1" style="text-decoration:underline;color:#00c">Text-only version</a></div> 
<div> </div></div></div><div style="position:relative"> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
     <head> 
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
          <title>jordaaan</title> 
          <style type="text/css"> 
          
          *
          {
               margin: 0px;
               padding: 0px;
          }
          
          body
          {
               font-family: "Lucida Grande", sans-serif;
               font-size: 12px;
               background-image: url('images/site/schematic.png');
               background-repeat: repeat;
               background-position: top left;
          }
          
          #container
          {
               position: absolute;
               top: 50px;
               left: 50px;
               -webkit-border-radius: 5px;
               -moz-border-radius: 5px;
               border: 1px solid black;
               background-color: white;
               padding: 10px;
          }
          
          p
          {
               padding: 3px;
          }
          
          </style> 
          <script type="text/javascript"> 
          
          var browserWidth, browserHeight;
          var existingStyle = 'position: absolute; -webkit-border-radius: 5px; -moz-border-radius: 5px; border: 1px solid black; background-color: white; padding: 10px;';
          
          function setBrowserViewPortDimensions ()
          {
               if (typeof window.innerWidth != 'undefined')
               {
                    browserWidth = window.innerWidth;
                    browserHeight = window.innerHeight;
               }
               else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0)
               {
                     browserWidth = document.documentElement.clientWidth;
                     browserHeight = document.documentElement.clientHeight;
               }
               else
               {
                     browserWidth = document.getElementsByTagName('body')[0].clientWidth;
                     browserHeight = document.getElementsByTagName('body')[0].clientHeight;
               }
          }
          
          function adjustContainerPosition ()
          {
               setBrowserViewPortDimensions ();
               var boundX = browserWidth - 250;
               var boundY = browserHeight - 50;
               var randomX = Math.floor (Math.random () * boundX + 1);
               var randomY = Math.floor (Math.random () * boundY + 1);
               document.getElementById('container').setAttribute ('style', (existingStyle + 'top: ' + randomY + 'px; left: ' + randomX + 'px;'));
               window.setTimeout (function () { adjustContainerPosition () }, 1000);
          }
          
          window.onload = function () {
               window.setTimeout (function () { adjustContainerPosition () }, 1000);
          };
          
          </script> 
     </head> 
     <body>
 <center>Can you count to three?</center>
          <div id="container"> 
               <input type="button" value="Yes!" />
               <input type="button" value="No!" />
          </div> 
     </body> 
</html>

That auto moves. :)
It's up to you to find out how to make it move when you mouse over it.
 
Last edited:
Initiate Mage
Joined
Jan 5, 2010
Messages
3
Reaction score
0
SilverBullet , I can get the page source to , but it's not quite what I am looking for.
First off , it's a banner not a web page.
Secondly , the button is meant to move when the mouse is over it ( sorry ,I didn't include this )

I still feel like you guys don't understand me , so If you need pictured diagrams , just tell me.

@spn , is it ok if I let this thread finish ?
 
Legendary Battlemage
Loyal Member
Joined
Apr 7, 2009
Messages
647
Reaction score
25
Heck, you can do this in any language.
C#, C, C++, Java, Actionscript...
Any language that has event handlers like onmouseover.
 
Back
Top