Search This Blog

Mind freaker Stuff

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

Thursday, June 7, 2012

How to create Styles for Android Button, UI (android Custom Button)

Android : How to create Style for Button which we can be use multiple time like CSS Classes in HTML  : Eclipse




1) Create Android Project  - Suppose we are creating a button style which has default blue color and on press orange color as shown in above image.




2) Create one android XML and select values as per shown in figure

Resource Type : Drawable
Root Element : Selector






 Add Folowing Code in bluebutton.XML



     
     
        
             
            
            
            
        
    
    
     
    
        
            
            
            
            
        
    





3)Create one more Android XML for styles  styles.xml  or you can use default string.xml

Resource Type : Values
Root Element : Resources



Add following Code in "Style.XML "




    




4) Add one Button in "main.xml" 






main.xml - 

  <Button
        android:id="@+id/button1"
        android:layout_width="250dp"
        android:layout_height="wrap_content"
        android:text="My Button" 
        style="@style/btnBlue"/>


Thats it !! 


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"