Search This Blog

Thursday, June 16, 2011

Android

Using lg optimus

Friday, April 22, 2011

Learning AS3

Load Movie() in AS3

var swfToLoad: String = "mySwf.swf";
var loader: Loader = new Loader();
loader.load(new URLRequest(swfToLoad));
addChild(loader);

var myLoader:Loader = new Loader();
myLoader.load(new URLRequest("load.swf"));

------------------------------------------------------------------------------------------------
Load Movie using BUTTONS and Progress BAR

import fl.controls.ProgressBar;
import fl.controls.Button;

var my_loader:Loader = new Loader();


var my_btn:Button = new Button();
my_btn.label = "Load Image";

my_btn.x = 100;
my_btn.y = 200;
addChild (my_btn);


var my_pb:ProgressBar = new ProgressBar();
my_pb.source = my_loader.contentLoaderInfo;

my_pb.x = 100;
my_pb.y = 200;


my_btn.addEventListener(MouseEvent.CLICK, startLoading);
function startLoading(e:MouseEvent):void{

my_loader.load(new URLRequest("myPhoto.jpg"));
addChild(my_pb);
removeChild(my_btn);
my_btn=null;
}


my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading);
function finishLoading(e:Event):void{

addChild(my_loader);
removeChild(my_pb);
my_pb = null;
}


------------------------------------------------------------------------------------------------

Add mouse click event to SimpleButton

package {
  import flash.display.*;
  import flash.events.*;


  public class SimpleButtonDemo extends Sprite {
    public function SimpleButtonDemo(  ) {
      var button:SimpleButton = new SimpleButton(  );
      button.x = 20;
      button.y = 20;
      
      button.upState = createCircle( 0x00FF00, 15 );
      button.overState = createCircle( 0xFFFFFF, 16 );
      button.downState = createCircle( 0xCCCCCC, 15 );


      button.hitTestState = createCircle( 0x000000, 50 );
      
      button.addEventListener( MouseEvent.CLICK, handleClick );
      
      addChild( button );  
    }
    
    private function createCircle( color:uint, radius:Number ):Shape {
      var circle:Shape = new Shape(  );
      circle.graphics.lineStyle( 1, 0x000000 );
      circle.graphics.beginFill( color );
      circle.graphics.drawCircle( 0, 0, radius );
      circle.graphics.endFill(  );
      return circle;
    }
    
    private function handleClick( event:MouseEvent ):void {
      trace( "Mouse clicked on the button" );  
    }
  }
}


--------------------------------------------------------------------
 Load and Save in AS3
 var buttonShape:Shape = new Shape();
buttonShape.graphics.beginFill(0x336699);
buttonShape.graphics.drawCircle(50, 50, 25);
var button = new SimpleButton(buttonShape,
 buttonShape, buttonShape, buttonShape);
addChild(button);


var fileRef:FileReference= new FileReference();
button.addEventListener(MouseEvent.CLICK, onButtonClick);


function onButtonClick(e:MouseEvent):void {
fileRef.browse([new FileFilter("Text", "*.jpg;*.gif;*.png")]);
fileRef.addEventListener(Event.SELECT, onFileSelected);
}


function onFileSelected(e:Event):void {
fileRef.addEventListener(Event.COMPLETE, onFileLoaded);
fileRef.load();
}


function onFileLoaded(e:Event):void {
var loader:Loader = new Loader();
loader.loadBytes(e.target.data);
addChild(loader);
}


var MyTextField:TextField = new TextField();
var MyButtonField:TextField = new TextField();
var MyFile:FileReference = new FileReference();


MyTextField.border = true;
MyTextField.type = TextFieldType.INPUT;
MyTextField.y=100


MyButtonField.background = true;
MyButtonField.backgroundColor = 0x339933;
MyButtonField.x = 150;
MyButtonField.height = 20;
MyButtonField.text = "Click here to save";


addChild(MyTextField);
addChild(MyButtonField);
MyButtonField.addEventListener(MouseEvent.CLICK, clickhandler);


function clickhandler(e:MouseEvent): void {
    MyFile.save(MyTextField.text);
}
 ------------------------------------------------------------------

Switch Case for Buttons


but1.addEventListener(MouseEvent.CLICK, clickHandler);
but2.addEventListener(MouseEvent.CLICK, clickHandler);
but3.addEventListener(MouseEvent.CLICK, clickHandler);


function clickHandler(event:MouseEvent):void
{


switch (event.currentTarget.name)
{
case "but1" :
trace("you chose a red Papa Smurf");
break;
case "but2" :
trace("you chose a green Papa Smurf");
break;
case "but3" :
trace("you chose a blue Papa Smurf");
break;


}
}

Wednesday, January 12, 2011

How to Track Visitors to a Blogger Blog Using Google Analytics

If you want to track visitors to your Blogger blog, you can use the free tool offered by Google Analytics. You can even sign up using the Google Blogger account name and password you use to access your Blogger account.
Difficulty: Moderately Easy

Instructions

Things You'll Need:

  • Internet access
  • Blogger account
  1. 1
    Go to Google Analytics (see Resources below).
  2. 2
    Log in with your Google Blogger account name and password.
  3. 3
    Click on "Sign Up for Google Analytics."
  4. 4
    Enter your Blogger URL and blog name when prompted.
  5. 5
    Enter your name and phone number.
  6. 6
    Copy the code that's generated. You will paste this code into your blog template.
  7. 7
    Log in to your Blogger account and click on "Template."
  8. 8
    Click on "Add a Page Element."
  9. 9
    Select the "Add to Blog" button under "HTML/JavaScript" on the New Page Element window.
  10. 10
    Paste the code you copied into the content block and select "Save Changes."
  11. 11
    Go back to your Google Analytics page and click to test whether you've properly installed the code.
  12. 12
    Track the number of visitors to your blog, as well as other visit statistics, by clicking "View Reports" on the Google Analytics menu bar.

Read more: How to Track Visitors to a Blogger Blog Using Google Analytics | eHow.com http://www.ehow.com/how_2019724_google-analytics-blogger.html#ixzz1Atgo1HNj

Thursday, November 11, 2010

Friday, July 2, 2010

Dos Command useful for Projects to handle files and folders

 Create List of folders from Dos Command from notepad
Click Start / run / cmd {OK}
make it happen by typing this command:
> for /F "tokens=*" %* in (c:\folders.txt) do @md "D:\My Folders\%*"
> {Enter}



.bat files copy and paste file into multiple folders windows xp
(3* for folder start with 3) 
@echo off
for /f %%j in ('dir /B /AD  E:\<target path to paste>3*') do (
copy <target filename for folder> <
target path >\%%j)
pause