Monday, August 4, 2008

Digital clock

Used the step below :
  1. Insert 3 layers in your timeline window and name them :background text and actions


  2. Select Frame1 of background layer, Design the framework for your digital clock.
  3. Select frame2 and press F5

  4. Now go to Frame1 of your text layer and insert Dynamic text field in your work area. Select frame2 and press F5

    To insert a Dynamic text field- Select text tool from your tool box,
    Select Dynamic text from Text pop-up menu in the Property inspector.
    Click on your work area wherever you want the digital clock to appear.

  5. Nad then take a name this Dynamic text field instance as "clock_txt"
  6. On frame1 of actions layer,Insert the below mentioned script in the action panel

    time=new Date(); // time object
    var seconds = time.getSeconds()
    var minutes = time.getMinutes()
    var hours = time.getHours()
    if (hours<12)
    { ampm = "AM"; } else{ ampm = "PM"; }
    while(hours >12){
    hours = hours - 12;
    }
    if(hours<10)
    { hours = "0" + hours; }
    if(minutes<10)
    { minutes = "0" + minutes; }
    if(seconds<10)
    { seconds = "0" + seconds; }
    clock_txt.text = hours + ":"
    + minutes + ":"
    + seconds +" "
    + ampm;


  7. On frame2 of actions layer and press F6 to insert a new keyframe.
    Still keeping the play head on the frame2, go to action panel and copy paste the below mentioned script.

    gotoAndPlay(1);

It is very simple & now we can play movie

Sunday, August 3, 2008

Insert sound

Insert your sound to your flash !
  • File > Import to import a sound file. Locate the sound file and click Open. The sound file will be saved in the Library.
  • Click in the first frame of "Layer 1" in the Timeline. Choose Window > Panels > Sound from the top menu.
  • In the pop up window (Sound) choose the sound you imported in the Sound field. Choose Stream in the Sync field. Close the pop up window.
  • Go to frame 50 in the Timeline. Right click and choose Insert Frame.
  • Control > Test Movie from the top menu to test your Flash movie.
Lets try.....