Monthly Archives: October 2009

How to rotate text with CSS

CSS   .rotate {   /* Safari */ -webkit-transform: rotate(-90deg);   /* Firefox */ -moz-transform: rotate(-90deg);   /* Internet Explorer */ filter: progid: DXImageTransform.Microsoft.BasicImage(rotation=3);   }  
Posted in CSS | Tagged , , , , | Leave a comment

How to Disable or Block Right Click – JavaScript

JavaScript   <script language=JavaScript> function clickIE() { if (document.all) { return false; } } function clickNS(e) { if (document.layers||(document.getElementById&&!document.all)) { if (e.which==2||e.which==3) { return false; } } } if (document.layers) { document.captureEvents(Event.MOUSEDOWN); document.onmousedown=clickNS; } else{ document.onmouseup=clickNS; document.oncontextmenu=clickIE; } document.oncontextmenu=new Function("return false") </script>  
Posted in JavaScript | Tagged , , | Leave a comment

How to Limit the Number of Characters in a Form Field – JavaScript

JavaScript   <script language="javascript" type="text/javascript">             function limitText(limitField, limitCount, limitNum) {                 if (limitField.value.length > limitNum) {                         limitField.value = limitField.value.substring(0, limitNum);                 } else [...]
Posted in JavaScript | Tagged , , | Leave a comment

How to Create a Simple Rotator Ad/Banner with JavaScript

JavaScript   <script language=JavaScript>   var img_width = "468"; var img_height = "60"; var img_title = "Click Here";   var ad=new Array() //insert here your images src ad[0]=‘images/Banner01.jpg’; ad[1]=‘images/Banner01.jpg’; ad[2]=‘images/Banner01.jpg’; ad[3]=‘images/Banner01.jpg’;   var links=new Array() //insert here your links links[0]=‘http://www.link01.com’; links[1]=‘http://www.ink02.com’; links[2]=‘http://www.ink03.com’; links[3]=‘http://www.ink04.com’;   var xy=Math.floor(Math.random()*ad.length); document.write(‘<a href="’+links[xy]+‘" target="_blank"><img src="’+ad[xy]+‘" width="’+img_width+‘" height="’+img_height+‘" alt="’+img_title+‘" border="0"></a>’); </script> [...]
Posted in JavaScript | Tagged , , , | Leave a comment

How to Convert Decimal to Binary – JavaScript

JavaScript   <SCRIPT language="JavaScript">   function check() {      dec = document.DecToBin.deci.value;        if (dec == "")          {alert("please insert decimal number first.");                    }      else          {scan(dec);}; };   function scan(ok) {  var chr="1234567890";  count=0; [...]
Posted in JavaScript | Tagged , , | Leave a comment

How to make Fullscreen with ActionScript 3.0

HTML Example   <!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" lang="en" xml:lang="en">         <head>                 <title></title>                 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />                 <script type="text/javascript" src="swfobject.js"></script>     [...]
Posted in ActionScript 3.0 | Tagged , , | Leave a comment

How to Create a Checkbox – ActionScript 3.0

ActionScript 3.0   package {   import flash.display.*;   import flash.events.*;   import flash.text.*;     public class CheckBox extends Sprite {           private var _label:FormattedTextField;         private var _icon:CheckBoxIcon;         private var _isChecked:Boolean = false;                   [...]
Posted in ActionScript 3.0 | Tagged , , , , , | Leave a comment

How to Load External SWF into Flash – ActionScript 3.0

ActionScript 3.0   // Define a variable to reference your exported-for-actionscript // library element. Just create an empty movieclip and set its // export-for-actionscript property appropriately var header_mc:mc_holder = new mc_holder();       function init():void {     /////////////////////////////////////////// BEGIN Add Header     var loadHeader = new Loader(); // temporary variable to reference [...]
Posted in ActionScript 3.0 | Tagged , , , , | Leave a comment

Simple Timeline Preloader – ActionScript 3.0

ActionScript 3.0   stop();   this.addEventListener(Event.ENTER_FRAME, handleLoading);   function handleLoading(event:Event):void{                 var total:Number = event.currentTarget.loaderInfo.bytesTotal;         var loaded:Number = event.currentTarget.loaderInfo.bytesLoaded;           trace(int((loaded/total)*100)+ "%");                 if (loaded >= total){             [...]
Posted in ActionScript 3.0 | Tagged , , , , | Leave a comment

How to Control Volume with ActionScript 3.0

ActionScript 3.0   import flash.media.SoundMixer; import flash.media.SoundTransform;     //All sound channels SoundMixer.soundTransform = new SoundTransform(.5);       //Without a sound channel: var sTransform:SoundTransform = new SoundTransform(); sTransform.volume = volumeLevel; musicSoundChannel.soundTransform = sTransform;     //With a sound channel: protected static var musicSoundChannel:SoundChannel; … var urlRequest:URLRequest = new URLRequest(url); if (musicSoundChannel != null){   [...]
Posted in ActionScript 3.0 | Tagged , , , | Leave a comment