Search This Blog

Mind freaker Stuff

Please Visit my new blog http://www.mindfreakerstuff.com for new articles related to web and mobile designing.

Sunday, November 27, 2011

Number (Numeric) Input Field : Flash Action Script 2

Add following code to flash Action Script will restrict user to input only Numeric Values 

textField_IntanceName.restrict = "0-9"


 following code allows A-Z except R and K:

textField_IntanceName.restrict = "A-Z^RK";


// Example 1: Allow only uppercase A-Z, spaces, and digits 0-9.
my_ti.restrict = "A-Z 0-9";


 // Example 3: Allow only digits 0-9, dash (-), ^, and \
my_ti.restrict = "0-9\\-\\^\\\\";


//Example 1: Allow only uppercase A-Z, spaces, and digits 0-9.
my_ti.restrict = "A-Z 0-9";

Vertical Text Alignment for Dynamic Text Field Flash Action script 2

This is a simple Hack for flash Dynamic Text Field  With AS2 Where  Vertical Text Align is not supported.
Instated of setting Text Vertically  align we can position Text Field vertically Center by Y axis Position  .

Steps : Add Follwing code in on layer action

//To get Empty text field height 
blank_height  = TextField_instance._height;


//Setting Text to text field 
TextField_instance.text = "This text is vertically align";

//Adding autosize to text field  
TextField_instance.autoSize = "center";


//for Vertical Alignment
TextField_instance._y = TextField_instance._y + (blank_height  -TextField_instance._height) / 2;

Thanks,
Cheers....  :)

Set Focus to Dynamic Textfeild and Tab Index in Flash Action Script 2



To Set Focus 

Selection.setFocus(textfeild_Instrance_name);

Adding Tab Index To flash Form


textfeild_Instrance_name.tabIndex = 1;
textfeild_Instrance_name2.tabIndex = 2;

Wednesday, November 23, 2011

Clear float without extra tag with CSS


CSS for all browsers  --------------------------------------------


.clearfix:before,
.clearfix:after {
  display: table;
  line-height: 0;
  content: " ";
}

.clearfix:after {
  clear: both;
}



CSS for IE 6, 7 ----------------------------------------------

 .clearfix {
    *zoom: 1;     /* triggers hasLayout */
    display: block;     /* resets display for IE/Win */
 }  

HTML (For IE 6,7)--------------------------------------------

<!--[if lte IE 7]>
<link href="css/ie.css" rel="stylesheet" type="text/css" />
<![endif]-->

Friday, November 18, 2011

Blank " href " alternative javascript code ( href=" " )

<a href="JavaScript:void(0);" onclick="alert('Well done!')">Click Me!</a> 

To avoid page refresh for blank herf="";

Friday, November 4, 2011

CSS Reset From Eric Meyer and Yahoo

/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
 margin: 0;
 padding: 0;
 border: 0;
 font-size: 100%;
 font: inherit;
 vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section {
 display: block;
}
body {
 line-height: 1;
}
ol, ul {
 list-style: none;
}
blockquote, q {
 quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
 content: '';
 content: none;
}
table {
 border-collapse: collapse;
 border-spacing: 0;
}
 
 
CSS Reset from Yahoo

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td { 
 margin:0;
 padding:0;
}
table {
 border-collapse:collapse;
 border-spacing:0;
}
fieldset,img { 
 border:0;
}
address,caption,cite,code,dfn,em,strong,th,var {
 font-style:normal;
 font-weight:normal;
}
ol,ul {
 list-style:none;
}
caption,th {
 text-align:left;
}
h1,h2,h3,h4,h5,h6 {
 font-size:100%;
 font-weight:normal;
}
q:before,q:after {
 content:'';
}
abbr,acronym { border:0;
}