Web design and coding samples, free tools, tips and more..
Untitled Document

Archive for the ‘Code Samples’ Category

PostHeaderIcon Top 70 ajax demos and code examples

For more attractive web sites;

  1. Ajallerix : AJAX, simple, fast Web image gallery demo ; at Novell
  2. AJAX – microlink pattern tutorial : A microlink is a link that opens up content below it.
  3. Ajax BBC News RSS Reader : demo by Nigel Crawley
  4. AJAX Chat in Python with Dojo : at AquaAjax
  5. Ajax Chess : multiplayer chess
    Read the rest of this entry »
  • Share/Bookmark

PostHeaderIcon Javascript form control for capital letters

With this example of javascript code, you may automatically return capital letters into small letters.

onblur =”this.value = this.value.toLowerCase()”

Just add this code into your textarea or textbox tag, that’s all.

  • Share/Bookmark

PostHeaderIcon Flash Actionscript Preloader

Here is a good & working  AS2.0 preloader sample.

Insert the code above  into frame 1, add new dynamic text on scene and name its var as “showpercent”, that’s all..

onEnterFrame=function(){

            var total:Number=_root.getBytesTotal();

            var loaded:Number=_root.getBytesLoaded();

            if(loaded==total){

                        delete  onEnterFrame

                        play();

            }else{

                        var percent:Number=Math.floor((loaded/total)*100);

                       showpercent.text=percent

            }

}

stop();

  • Share/Bookmark

PostHeaderIcon How to disable enter key on html form submit

Here’s a usefull javascript to disable enter key on html form submit. It directs the user to use mouse click.

 

<script type=”text/javascript”>

function stopRKey(evt) {
  var evt = (evt) ? evt : ((event) ? event : null);
  var node = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null);
  if ((evt.keyCode == 13) && (node.type==”text”))  {return false;}
}

document.onkeypress = stopRKey;

</script>

  • Share/Bookmark

PostHeaderIcon How to disable browser cache for flash

As you know when you upload new swf file to server, browser doesn’t show it until you delete browser cache. Also it’s important to delete swf cache for websites which includes dynamic data and dynamic sub swf files. Here’s the method that we pass this problem for flash.

Read the rest of this entry »

  • Share/Bookmark

PostHeaderIcon How to delete xml cache with actionscript?

İt’s important to delete xml cache in flash if your content is renewing it self often.  Here’s the sample code for deleting xml cache with actionscript;

Just change your xml loading code with this:

Read the rest of this entry »

  • Share/Bookmark
Categories
open all | close all