Search This Blog

Mind freaker Stuff

Please Visit my new blog http://www.mindfreakerstuff.com for new articles related to web and mobile designing.
Showing posts with label flash. Show all posts
Showing posts with label flash. Show all posts

Friday, June 1, 2012

Fullscreen Toggle Button Action Script 2.0 : Flash

Add Action Script in Flash 

btn = "Button Instance Name"

Flash Action Script
stop();
Stage.displayState = "normal";
Stage.scaleMode = "noScale";
function toggleFullScreen ()
{
    trace ("::::::::::::::::::::::::::::::::::::::::");
    if (Stage.displayState == "normal")
    {
        Stage.displayState = "fullScreen";
    }
    else
    {
        Stage.displayState = "normal";
    }// end else if
}
btn.onRelease=function()
{
toggleFullScreen () 
}

HTML  Code : Replace your Swf file path with "index.swf"

 

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;