home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2009 May / MAC_easy_05_2009.iso / Video-Tutorial / start.swf / scripts / frame_1 / DoAction_6.as < prev    next >
Encoding:
Text File  |  2009-03-18  |  11.4 KB  |  399 lines

  1. function setWindowInterfacePos()
  2. {
  3.    faktor1 = Stage.width / bg_mc._width;
  4.    faktor2 = Stage.height / bg_mc._height;
  5.    if(faktor1 > faktor2)
  6.    {
  7.       ratio = faktor1;
  8.    }
  9.    else
  10.    {
  11.       ratio = faktor2;
  12.    }
  13.    bg_mc._width *= ratio;
  14.    bg_mc._height *= ratio;
  15.    size_mc._x = Math.round(Stage.width - 14);
  16.    size_mc._y = Math.round(Stage.height - 14);
  17.    application_border_mc._width = Stage.width - 1;
  18.    application_border_mc._height = Stage.height - 1;
  19.    if(!live_mode)
  20.    {
  21.       dragbar_mc._width = Stage.width;
  22.    }
  23.    tools_mc._x = Stage.width - 53;
  24. }
  25. function setPos()
  26. {
  27.    stage_width = Stage.width;
  28.    stage_height = Stage.height;
  29.    content_pos_mc.tab_navigation_mc.tab_navigation_bg_mc._visible = true;
  30.    if(_root.useFSP_path == "false")
  31.    {
  32.       var _loc2_ = 25;
  33.    }
  34.    else
  35.    {
  36.       application_title_op._visible = true;
  37.       if(stage_height > minimum_stage_height)
  38.       {
  39.          _loc2_ = 49;
  40.       }
  41.       else if(live_mode)
  42.       {
  43.          _loc2_ = 49;
  44.       }
  45.       else
  46.       {
  47.          _loc2_ = 25;
  48.       }
  49.    }
  50.    if(live_mode)
  51.    {
  52.       content_bg_width = Number(livemode_width);
  53.       content_bg_height = Number(livemode_height);
  54.       content_pos_mc.content_bg_mc._y = -25;
  55.    }
  56.    else if(fullscreen)
  57.    {
  58.       content_bg_width = stage_width;
  59.       content_bg_height = stage_height;
  60.       content_pos_mc.content_bg_mc._y = 0;
  61.    }
  62.    else
  63.    {
  64.       content_bg_width = stage_width;
  65.       content_bg_height = stage_height;
  66.       if(video_mode && full_video_mode_display == "true")
  67.       {
  68.          content_pos_mc.content_bg_mc._y = 0;
  69.       }
  70.       else
  71.       {
  72.          content_pos_mc.content_bg_mc._y = 25;
  73.       }
  74.       if(stage_width > Number(default_stage_width))
  75.       {
  76.          content_bg_width = Number(default_stage_width);
  77.       }
  78.       if(stage_height > Number(default_stage_height))
  79.       {
  80.          content_bg_height = Number(default_stage_height);
  81.       }
  82.       if(stage_width < Number(minimum_stage_width))
  83.       {
  84.          content_bg_width = Number(minimum_stage_width);
  85.       }
  86.       if(stage_height < Number(minimum_stage_height))
  87.       {
  88.          content_bg_height = Number(minimum_stage_height);
  89.       }
  90.    }
  91.    content_pos_mc.content_bg_mc._width = content_bg_width;
  92.    if(fullscreen)
  93.    {
  94.       content_pos_mc.content_bg_mc._height = content_bg_height;
  95.    }
  96.    else if(live_mode)
  97.    {
  98.       content_pos_mc.content_bg_mc._height = content_bg_height + 2;
  99.    }
  100.    else if(video_mode && full_video_mode_display == "true")
  101.    {
  102.       content_pos_mc.content_bg_mc._height = content_bg_height - _loc2_ + 25;
  103.    }
  104.    else
  105.    {
  106.       content_pos_mc.content_bg_mc._height = content_bg_height - _loc2_;
  107.    }
  108.    content_pos_x = Math.round(stage_width / 2 - content_bg_width / 2);
  109.    if(content_pos_x < 0)
  110.    {
  111.       content_pos_x = 0;
  112.    }
  113.    content_pos_y = Math.round(stage_height / 2 - content_bg_height / 2);
  114.    if(_root.useFSP_path == "false")
  115.    {
  116.       if(content_pos_y < 0)
  117.       {
  118.          content_pos_y = 0;
  119.       }
  120.    }
  121.    else if(fullscreen)
  122.    {
  123.       if(content_pos_y < 0)
  124.       {
  125.          content_pos_y = 0;
  126.       }
  127.       dragbar_mc._height = 23;
  128.    }
  129.    else if(live_mode)
  130.    {
  131.       content_pos_y = 25;
  132.       dragbar_mc._height = 25;
  133.    }
  134.    else
  135.    {
  136.       if(content_pos_y < 24)
  137.       {
  138.          content_pos_y = 24;
  139.       }
  140.       dragbar_mc._height = 23;
  141.    }
  142.    content_pos_mc._x = content_pos_x;
  143.    content_pos_mc._y = content_pos_y;
  144.    content_pos_mc.content_panel_mc._width = content_bg_width - 4;
  145.    if(video_mode)
  146.    {
  147.       if(live_mode)
  148.       {
  149.          content_pos_mc.content_panel_mc._y = 2;
  150.          content_pos_mc.video_mc._y = 2;
  151.          content_pos_mc.content_panel_mc._height = content_bg_height - _loc2_ - 4;
  152.       }
  153.       else if(fullscreen)
  154.       {
  155.          content_pos_mc.content_panel_mc._y = 2;
  156.          content_pos_mc.video_mc._y = 2;
  157.          content_pos_mc.content_panel_mc._height = content_bg_height - 29;
  158.       }
  159.       else if(full_video_mode_display == "true")
  160.       {
  161.          content_pos_mc.content_panel_mc._y = 27;
  162.          content_pos_mc.video_mc._y = 27;
  163.          content_pos_mc.content_panel_mc._height = content_bg_height - 29 - _loc2_;
  164.       }
  165.       else
  166.       {
  167.          content_pos_mc.content_panel_mc._y = 52;
  168.          content_pos_mc.video_mc._y = 52;
  169.          content_pos_mc.content_panel_mc._height = content_bg_height - 54 - _loc2_;
  170.       }
  171.    }
  172.    else
  173.    {
  174.       content_pos_mc.content_panel_mc._y = 27;
  175.       content_pos_mc.content_panel_mc._height = content_bg_height - 61 - _loc2_;
  176.    }
  177.    if(saved_panel_width != content_pos_mc.content_panel_mc._width or saved_panel_height != content_pos_mc.content_panel_mc._height)
  178.    {
  179.       content_pos_mc.content_panel_mc.broadcastMessage("onCustomResize");
  180.    }
  181.    saved_panel_width = content_pos_mc.content_panel_mc._width;
  182.    saved_panel_height = content_pos_mc.content_panel_mc._height;
  183.    content_pos_mc.bottom_mc.bottom_bg_mc._width = content_pos_mc.content_panel_mc._width;
  184.    content_pos_mc.bottom_mc._x = 2;
  185.    content_pos_mc.bottom_mc._y = content_pos_mc.content_panel_mc._y + content_pos_mc.content_panel_mc._height + 2;
  186.    content_pos_mc.bottom_mc.logo_bottom_holder_mc._x = content_pos_mc.bottom_mc.bottom_bg_mc._width - content_pos_mc.bottom_mc.logo_bottom_holder_mc._width - 10;
  187.    content_pos_mc.bottom_mc.logo_bottom_holder_mc._y = Math.round(content_pos_mc.bottom_mc.bottom_bg_mc._height / 2 - content_pos_mc.bottom_mc.logo_bottom_holder_mc._height / 2) - 3;
  188.    if(special_pos_mc.inlay_video_mc)
  189.    {
  190.       special_pos_mc.inlay_video_mc.setLocalPos();
  191.       inlay_video_mc_x = Math.round(Stage.width / 2 - special_pos_mc.inlay_video_mc._width / 2);
  192.       inlay_video_mc_y = Math.round(Stage.height / 2 - special_pos_mc.inlay_video_mc._height / 2);
  193.       if(inlay_video_mc_x <= 0)
  194.       {
  195.          inlay_video_mc_x = 0;
  196.       }
  197.       if(_root.useFSP_path == "true")
  198.       {
  199.          if(inlay_video_mc_y < 24)
  200.          {
  201.             inlay_video_mc_y = 24;
  202.          }
  203.       }
  204.       else if(inlay_video_mc_y <= 0)
  205.       {
  206.          inlay_video_mc_y = 0;
  207.       }
  208.       special_pos_mc.inlay_video_mc._x = inlay_video_mc_x;
  209.       special_pos_mc.inlay_video_mc._y = inlay_video_mc_y;
  210.    }
  211. }
  212. function maximizeApplication()
  213. {
  214.    if(maximized)
  215.    {
  216.       tools_mc.gotoAndStop(1);
  217.       if(client_os == "Windows")
  218.       {
  219.          mdm.Forms.MainForm.restore();
  220.       }
  221.       else
  222.       {
  223.          mdm.Forms.MainForm.showFullScreen(false);
  224.       }
  225.       application_border_mc._visible = true;
  226.       maximized = false;
  227.       size_mc._visible = true;
  228.       if(saved_premaximize_width == undefined || saved_premaximize_width == client_res_x)
  229.       {
  230.          mdm.Forms.MainForm.width = client_res_x - 20;
  231.          mdm.Forms.MainForm.height = client_res_y - 20 - mac_margin;
  232.          mdm.Forms.MainForm.x = Math.round(client_res_x / 2 - mdm.Forms.MainForm.width / 2);
  233.          mdm.Forms.MainForm.y = Math.round(client_res_y / 2 - mdm.Forms.MainForm.height / 2);
  234.       }
  235.    }
  236.    else
  237.    {
  238.       tools_mc.gotoAndStop(2);
  239.       application_border_mc._visible = false;
  240.       saved_premaximize_width = mdm.Forms.MainForm.width;
  241.       saved_premaximize_height = mdm.Forms.MainForm.height;
  242.       if(client_os == "Windows")
  243.       {
  244.          mdm.Forms.MainForm.maximize();
  245.       }
  246.       else
  247.       {
  248.          mdm.Forms.MainForm.showFullScreen(true);
  249.       }
  250.       maximized = true;
  251.       size_mc._visible = false;
  252.    }
  253.    setPos();
  254. }
  255. function minimizeApplication()
  256. {
  257.    mdm.Forms.MainForm.minimize();
  258. }
  259. function openApplication()
  260. {
  261.    if(client_os == "Windows")
  262.    {
  263.       mdm.Forms.SplashForm.callFunction("output","Opening..","");
  264.    }
  265.    if(saved_app_resolution_x)
  266.    {
  267.       var _loc2_ = saved_app_resolution_x;
  268.    }
  269.    else
  270.    {
  271.       _loc2_ = client_res_x;
  272.    }
  273.    if(saved_app_resolution_y)
  274.    {
  275.       var _loc1_ = saved_app_resolution_y;
  276.    }
  277.    else
  278.    {
  279.       _loc1_ = client_res_y - mac_margin;
  280.    }
  281.    if(_loc2_ > client_res_x)
  282.    {
  283.       _loc2_ = client_res_x;
  284.    }
  285.    if(_loc1_ > client_res_y)
  286.    {
  287.       _loc1_ = client_res_y - mac_margin;
  288.    }
  289.    if(_loc2_ == client_res_x && _loc1_ == client_res_y)
  290.    {
  291.       mdm.Forms.MainForm.width = client_res_x - 20;
  292.       mdm.Forms.MainForm.height = client_res_y - 20 - mac_margin;
  293.       main_form_x = Math.round(client_res_x / 2 - mdm.Forms.MainForm.width / 2);
  294.       main_form_y = Math.round(client_res_y / 2 - mdm.Forms.MainForm.height / 2);
  295.       if(main_form_x <= 0)
  296.       {
  297.          main_form_x = 0;
  298.       }
  299.       if(main_form_y <= 0)
  300.       {
  301.          main_form_y = 0;
  302.       }
  303.       mdm.Forms.MainForm.x = main_form_x;
  304.       mdm.Forms.MainForm.y = main_form_y;
  305.       maximizeApplication();
  306.    }
  307.    else
  308.    {
  309.       mdm.Forms.MainForm.width = _loc2_;
  310.       mdm.Forms.MainForm.height = _loc1_;
  311.       main_form_x = Math.round(client_res_x / 2 - _loc2_ / 2);
  312.       main_form_y = Math.round(client_res_y / 2 - _loc1_ / 2);
  313.       if(main_form_x <= 0)
  314.       {
  315.          main_form_x = 0;
  316.       }
  317.       if(main_form_y <= 0)
  318.       {
  319.          main_form_y = 0;
  320.       }
  321.       mdm.Forms.MainForm.x = main_form_x;
  322.       mdm.Forms.MainForm.y = main_form_y;
  323.    }
  324.    setPos();
  325.    mdm.Forms.MainForm.visible = true;
  326.    if(client_os == "Windows")
  327.    {
  328.       mdm.Forms.SplashForm.callFunction("output","Initialising","");
  329.    }
  330.    mdm.Forms.SplashForm.close();
  331.    clearInterval(main_timeout);
  332.    main_timeout = setTimeout(renderMain,250);
  333. }
  334. function renderExit()
  335. {
  336.    v2b_system_so.data.resultion = [mdm.Forms.MainForm.width,mdm.Forms.MainForm.height];
  337.    killInlayVideo();
  338.    content_pos_mc._visible = false;
  339.    dragbar_mc._visible = false;
  340.    tools_mc._visible = false;
  341.    size_mc._visible = false;
  342.    application_title_op._visible = false;
  343.    bg_mc._alpha = 35;
  344.    special_pos_mc._x = 0;
  345.    special_pos_mc._y = 0;
  346.    special_pos_mc.attachMovie("exit_mc","exit_mc",1);
  347.    content_pos_mc.video_mc.flv_player.pause();
  348. }
  349. function renderMCT(__file)
  350. {
  351.    destroyBacktoVideoButton();
  352.    video_mode = true;
  353.    mct_mode = true;
  354.    content_pos_mc.bottom_mc._visible = false;
  355.    if(full_video_mode_display == "true")
  356.    {
  357.       content_pos_mc.tab_navigation_mc._visible = false;
  358.    }
  359.    i = 0;
  360.    while(i < used_tab_arr.length)
  361.    {
  362.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  363.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  364.       if(used_tab_arr[i][2])
  365.       {
  366.          content_pos_mc.content_mc[used_tab_arr[i][1]]._visible = false;
  367.       }
  368.       i++;
  369.    }
  370.    mct_info = __file;
  371.    content_pos_mc.mct_mc.createEmptyMovieClip("mct_holder_mc",1);
  372.    loadClip(fsp_path + folder + mct_core,content_pos_mc.mct_mc.mct_holder_mc,null,null,false,false,false,false,true,true,null);
  373.    setPos();
  374. }
  375. function killMCT()
  376. {
  377.    mct_mode = false;
  378.    video_mode = false;
  379.    content_pos_mc.mct_mc.mct_holder_mc.removeMovieClip();
  380.    mct_info = undefined;
  381.    content_pos_mc.tab_navigation_mc._visible = true;
  382.    renderContent(last_visible_content);
  383.    content_pos_mc.bottom_mc._visible = true;
  384.    setPos();
  385. }
  386. function printOverview()
  387. {
  388.    my_print = new PrintJob();
  389.    var _loc2_ = my_print.start();
  390.    i = 1;
  391.    while(i <= p_num)
  392.    {
  393.       my_print.addPage("overview_mc_print" + i,null,{printAsBitmap:false},1);
  394.       i++;
  395.    }
  396.    my_print.send();
  397.    delete my_print;
  398. }
  399.