iceProjector / icePlayer > Sample 4. System tray icon
Sample & Tutorial
 

Fundamental
- iceProjector Help
FLA Samples
- 1. Window and Text box
- 2. Right mouse menu item
- 3. Sprite bound
- 4. System tray icon
- 5. Remote file download

Resources
- FAQ
- Support Forum
Submit yours
Submit your work. Chance to win free software from Flashants.

Contact
  Technical Support
  support@flashants.com
Marketing & Sales
  sales@flashants.com
Feedback & Suggestion
  feedback@flashants.com

Tray Clock - download this sample files
Supported by iceProjector V1.5

This sample shows how to add a system tray icon and the mouse-clicking menu in the tray icon to control the movie.

  1. In Frame 1, we add the menu items and declare the event handling frame label:

    // Add the system tray's icon
    fscommand("fas.systray.Show","clock.ico,Click here to open menu");
    // Add the system tray's left-mouse-click menu items
    // The command sequences decide the order of menu item
    fscommand("fas.systray.LMenuAddItem", "11,About flashants");
    fscommand("fas.systray.LMenuAddSeperator", "14");
    fscommand("fas.systray.LMenuAddItem", "12,Hide clock");
    fscommand("fas.systray.LMenuAddItem", "13,Show clock");
    // Add the system tray's left-mouse-click menu items
    // The command sequences decide the order of menu item
    fscommand("fas.systray.RMenuAddItem", "99,Quit");
    fscommand("fas.systray.RMenuAddSeperator", "14");
    fscommand("fas.systray.RMenuAddItem", "12,Hide Clock");
    fscommand("fas.systray.RMenuAddItem", "13,Show Clock");

    //Set default Check value

    _root.showFlag = false;
    fscommand("fas.taskbutton.hide","");
    fscommand("fas.rmenu.checkitem", "5,false");
    fscommand("fas.systray.RMenuCheckitem", "13,TRUE");
    fscommand("fas.systray.LMenuCheckitem", "13,TRUE");
    // The following command declares the menu event handler frame is labeled with menuEvent, and pass the cmdID as the identifier of the menu item clicked. Please note that whenever user click on menu item, iceProjector immediately executes the actionscripts in the labeled frame, but it doesn't really go to that frame.
    var cmdID;
    fscommand("fas.event.Menu", "_root.menuEvent,_root.cmdID");

  2. We put the clock's show and hide movie clips in the frame 2. And the maintimeline stop here.

  3. At frame 4, we give this frame label name as "menuEvent" which is same as we declare by the fscommand "fas.event.Menu" in frame 1. So whenever the menu items are clicked, iceProjector will execute the actionscripts in this frame.(But not really go to that frame)
  4. Add the actionscripts in frame 4 as below to handle the mouse click event in this frame. The variable "cmdID" denotes which menu item is clicked.
    switch (cmdID) {
    case "11" :
    getURL("www.flashants.com", "_blank");
    break;
    case "12" :
    fscommand("fas.systray.LMenuCheckItem", "12,TRUE");
    fscommand("fas.systray.RMenuCheckItem", "12,TRUE");
    fscommand("fas.systray.LMenuCheckItem", "13,FALSE");
    fscommand("fas.systray.RMenuCheckItem", "13,FALSE");
    clockMC.gotoAndPlay(2);
    break;
    case "13" :
    fscommand("fas.systray.LMenuCheckItem", "13,TRUE");
    fscommand("fas.systray.RMenuCheckItem", "13,TRUE");
    fscommand("fas.systray.LMenuCheckItem", "12,FALSE");
    fscommand("fas.systray.RMenuCheckItem", "12,FALSE");
    clockMC.gotoAndStop(1);
    break;
    case "99" :
    fscommand("QUIT");
    break;
    }