home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2009 May / MAC_easy_05_2009.iso / Video-Tutorial / 9430830 / bookmarks.swf / scripts / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2009-03-23  |  30.9 KB  |  801 lines

  1. function setStartScreen()
  2. {
  3.    header_op.textColor = _root.parseColor(_root.submenu_header_color);
  4.    header_op.text = _root.my_bm_label;
  5.    subheader_op.textColor = _root.parseColor(_root.submenu_subheader_color);
  6.    setRGB(header_line_mc,_root.parseColor(_root.seperator_line_color));
  7.    header_line_mc._alpha = Number(_root.seperator_line_alpha);
  8.    info_mc.header_op.textColor = _root.parseColor(_root.teaser_header_color);
  9.    info_mc.header_op.text = _root.my_bm_teaser_info_label;
  10.    info_mc.subheader_op.textColor = _root.parseColor(_root.teaser_subheader_color);
  11.    info_mc.bm_header_op.textColor = _root.parseColor(_root.teaser_subheader2_color);
  12.    info_mc.bm_text_op.textColor = _root.parseColor(_root.teaser_text_color);
  13.    info_mc.bm_time_op.textColor = _root.parseColor(_root.teaser_text_color);
  14.    info_mc.bm_alert_op.textColor = _root.parseColor(_root.teaser_text_color);
  15.    setRGB(info_mc.info_v_line_mc,_root.parseColor(_root.seperator_line_color));
  16.    info_mc.info_v_line_mc._alpha = Number(_root.seperator_line_alpha);
  17.    setRGB(info_mc.info_line_mc,_root.parseColor(_root.seperator_line_color));
  18.    info_mc.info_line_mc._alpha = Number(_root.seperator_line_alpha);
  19.    setRGB(info_mc.footer_line_mc,_root.parseColor(_root.seperator_line_color));
  20.    info_mc.footer_line_mc._alpha = Number(_root.seperator_line_alpha);
  21.    setRGB(info_mc.bm_header_bg_mc,_root.parseColor(_root.form_highlight_color));
  22.    info_mc.bm_header_bg_mc._alpha = _root.form_highlight_alpha;
  23.    setRGB(info_mc.bm_text_bg_mc,_root.parseColor(_root.form_highlight_color));
  24.    info_mc.bm_text_bg_mc._alpha = _root.form_highlight_alpha;
  25.    legende_mc.text1_op.autoSize = true;
  26.    legende_mc.text1_op.textColor = _root.parseColor(_root.teaser_subheader_color);
  27.    legende_mc.text1_op.text = _root.my_bm_legend_desc;
  28.    legende_mc.text2_op.autoSize = true;
  29.    legende_mc.text2_op.textColor = _root.parseColor(_root.teaser_subheader_color);
  30.    legende_mc.text2_op.text = _root.my_bm_pd_legend_desc;
  31.    if(_root.my_bm_show_legend == "false")
  32.    {
  33.       legende_mc._visible = false;
  34.    }
  35.    else
  36.    {
  37.       if(v2b_so.data.my_bm_show_predefined_bm == undefined || v2b_so.data.my_bm_show_predefined_bm == true)
  38.       {
  39.          v2b_so.data.my_bm_show_predefined_bm = true;
  40.          v2b_so.flush();
  41.          show_predefined_bm = true;
  42.       }
  43.       else
  44.       {
  45.          show_predefined_bm = false;
  46.          legende_mc.check_box_mc.checked_mc._visible = false;
  47.       }
  48.       legende_mc.check_box_mc.onRelease = pdCheckBox_onClick;
  49.    }
  50. }
  51. function pdCheckBox_onClick()
  52. {
  53.    if(show_predefined_bm)
  54.    {
  55.       show_predefined_bm = false;
  56.       legende_mc.check_box_mc.checked_mc._visible = false;
  57.       v2b_so.data.my_bm_show_predefined_bm = false;
  58.    }
  59.    else
  60.    {
  61.       show_predefined_bm = true;
  62.       legende_mc.check_box_mc.checked_mc._visible = true;
  63.       v2b_so.data.my_bm_show_predefined_bm = true;
  64.    }
  65.    v2b_so.flush();
  66.    renderBookmarks();
  67. }
  68. function renderBookmarks()
  69. {
  70.    removeBookmarks();
  71.    var _loc10_ = 16;
  72.    var _loc15_ = 0;
  73.    i = 0;
  74.    while(i < video_array.length)
  75.    {
  76.       var _loc8_ = video_array[i].movie.split(".")[0];
  77.       var _loc9_ = _loc8_ + "_data";
  78.       var _loc5_ = new Array();
  79.       if(v2b_so.data[_loc9_].bookmarks != undefined && v2b_so.data[_loc9_].bookmarks.length > 0)
  80.       {
  81.          _loc5_ = v2b_so.data[_loc9_].bookmarks;
  82.       }
  83.       if(show_predefined_bm)
  84.       {
  85.          if(_root.pd_bm_object[_loc8_] != undefined && _root.pd_bm_object[_loc8_].length > 0)
  86.          {
  87.             _loc5_ = _loc5_.concat(_root.pd_bm_object[_loc8_]);
  88.             _loc5_.sortOn("sec",Array.NUMERIC);
  89.          }
  90.       }
  91.       if(_loc5_.length > 0)
  92.       {
  93.          var _loc6_ = bookmark_holder_mc.attachMovie("headline_mc","headline" + i,bookmark_holder_mc.getNextHighestDepth());
  94.          _loc6_.mc_type = "headline";
  95.          _loc6_._x = 0;
  96.          _loc6_._y = _loc10_;
  97.          _loc6_.original_text = video_array[i].movie_name;
  98.          _loc6_.chapter_op.textColor = _root.parseColor(_root.index_color);
  99.          _loc6_.chapter_op.text = video_array[i].chapter_id;
  100.          if(_loc6_.chapter_op.textWidth + 2 > _loc6_.chapter_op._width)
  101.          {
  102.             _loc6_.chapter_op.autoSize = true;
  103.             _loc6_.text_op._x = Math.ceil(_loc6_.chapter_op._x + _loc6_.chapter_op._width + 3);
  104.          }
  105.          _loc6_.text_op._width = max_content_width - _loc6_.text_op._x;
  106.          _loc6_.text_op.textColor = _root.parseColor(_root.submenu_color);
  107.          _loc6_.text_op.text = _loc6_.original_text;
  108.          _loc6_.text_op.stringCutter_advanced(" ...");
  109.          var _loc11_ = 0;
  110.          var _loc12_ = 0;
  111.          var _loc4_ = 0;
  112.          while(_loc4_ < _loc5_.length)
  113.          {
  114.             _loc15_ = _loc15_ + 1;
  115.             _loc10_ += bm_y_dis;
  116.             var _loc3_ = bookmark_holder_mc.attachMovie("bookmark_mc","bookmark" + i + "-" + _loc4_,bookmark_holder_mc.getNextHighestDepth());
  117.             _loc3_.mc_type = "bookmark";
  118.             _loc3_.movie_id = i;
  119.             if(_loc5_[_loc4_].pd == true)
  120.             {
  121.                _loc3_.pd = true;
  122.                _loc3_.array_id = _loc12_;
  123.                _loc3_.array_name = _loc8_;
  124.                _loc12_ = _loc12_ + 1;
  125.                _loc3_.edit_btn_mc._visible = false;
  126.                _loc3_.delete_btn_mc._visible = false;
  127.                setRGB(_loc3_.bm_icon_mc,3407871);
  128.             }
  129.             else
  130.             {
  131.                _loc3_.pd = false;
  132.                _loc3_.array_id = _loc11_;
  133.                _loc3_.array_name = _loc9_;
  134.                _loc11_ = _loc11_ + 1;
  135.             }
  136.             setRGB(_loc3_.bg_mc,_root.parseColor(_root.submenu_rollover_color));
  137.             _loc3_.bg_mc._alpha = 0;
  138.             setRGB(_loc3_.edit_btn_mc.bg_mc,_root.parseColor(_root.submenu_rollover_color));
  139.             _loc3_.edit_btn_mc.bg_mc._alpha = 0;
  140.             setRGB(_loc3_.delete_btn_mc.bg_mc,_root.parseColor(_root.submenu_rollover_color));
  141.             _loc3_.delete_btn_mc.bg_mc._alpha = 0;
  142.             _loc3_._x = 0;
  143.             _loc3_._y = _loc10_;
  144.             setBookmarkWidth(_loc3_,max_content_width,false);
  145.             _loc3_.original_text = _loc5_[_loc4_].description;
  146.             _loc3_.sec = _loc5_[_loc4_].sec;
  147.             _loc3_.text_op.textColor = _root.parseColor(_root.submenu_color);
  148.             _loc3_.text_op.text = _loc3_.original_text;
  149.             _loc3_.text_op.stringCutter_advanced(" ...");
  150.             _loc3_.date_op.textColor = _root.parseColor(_root.submenu_color);
  151.             if(_loc5_[_loc4_].bm_date != undefined)
  152.             {
  153.                _loc3_.date_op.text = _loc5_[_loc4_].bm_date;
  154.             }
  155.             else
  156.             {
  157.                _loc3_.date_op.text = "";
  158.             }
  159.             _loc3_.time_op.textColor = _root.parseColor(_root.submenu_color);
  160.             _loc3_.time_op.text = createTimeString(_loc5_[_loc4_].sec);
  161.             _loc3_.bg_mc.onRelease = function()
  162.             {
  163.                _root.killToolTip();
  164.                gotoBookmark(this._parent.movie_id,this._parent.array_name,this._parent.array_id,this._parent.pd);
  165.             };
  166.             _loc3_.bg_mc.onRollOver = _loc3_.bg_mc.onDragOver = function()
  167.             {
  168.                if(!editing_active)
  169.                {
  170.                   this._parent.bg_mc._alpha = Number(_root.submenu_rollover_alpha);
  171.                   this._parent.text_op.textColor = _root.parseColor(_root.submenu_rollover_color);
  172.                   this._parent.time_op.textColor = _root.parseColor(_root.submenu_rollover_color);
  173.                   this._parent.date_op.textColor = _root.parseColor(_root.submenu_rollover_color);
  174.                   var _loc3_ = {x:this._parent.bg_mc._x + this._parent.bg_mc._width - 26,y:0};
  175.                   this._parent.localToGlobal(_loc3_);
  176.                   local_root_mc.globalToLocal(_loc3_);
  177.                   _root.toolTip(_root.my_bm_start_video_desc,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
  178.                   infotext_delay = setTimeout(setBookmarkInfoText,250,this._parent.array_name,this._parent.array_id,this._parent.pd);
  179.                }
  180.             };
  181.             _loc3_.bg_mc.onRollOut = _loc3_.bg_mc.onDragOut = function()
  182.             {
  183.                _root.killToolTip();
  184.                if(!editing_active)
  185.                {
  186.                   this._parent.bg_mc._alpha = 0;
  187.                   this._parent.text_op.textColor = _root.parseColor(_root.submenu_color);
  188.                   this._parent.time_op.textColor = _root.parseColor(_root.submenu_color);
  189.                   this._parent.date_op.textColor = _root.parseColor(_root.submenu_color);
  190.                   hideBookmarkInfoText();
  191.                }
  192.             };
  193.             _loc3_.edit_btn_mc.onRelease = function()
  194.             {
  195.                _root.killToolTip();
  196.                if(!editing_active)
  197.                {
  198.                   selected_bookmark = this._parent;
  199.                   this.bg_mc._alpha = 0;
  200.                   openBookmarkEditField();
  201.                }
  202.             };
  203.             _loc3_.edit_btn_mc.onRollOver = _loc3_.edit_btn_mc.onDragOver = function()
  204.             {
  205.                if(!editing_active)
  206.                {
  207.                   _root.killToolTip();
  208.                   var _loc3_ = {x:0,y:0};
  209.                   this.localToGlobal(_loc3_);
  210.                   local_root_mc.globalToLocal(_loc3_);
  211.                   _root.toolTip(_root.edit_bookmark_desc,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
  212.                   this.bg_mc._alpha = Number(_root.submenu_rollover_alpha);
  213.                   infotext_delay = setTimeout(setBookmarkInfoText,250,this._parent.array_name,this._parent.array_id);
  214.                }
  215.             };
  216.             _loc3_.edit_btn_mc.onRollOut = _loc3_.edit_btn_mc.onDragOut = function()
  217.             {
  218.                _root.killToolTip();
  219.                this.bg_mc._alpha = 0;
  220.                if(!editing_active)
  221.                {
  222.                   hideBookmarkInfoText();
  223.                }
  224.             };
  225.             _loc3_.delete_btn_mc.onRelease = function()
  226.             {
  227.                _root.killToolTip();
  228.                if(!editing_active)
  229.                {
  230.                   selected_bookmark = this._parent;
  231.                   this.bg_mc._alpha = 0;
  232.                   openBookmarkDeleteField();
  233.                }
  234.             };
  235.             _loc3_.delete_btn_mc.onRollOver = _loc3_.delete_btn_mc.onDragOver = function()
  236.             {
  237.                if(!editing_active)
  238.                {
  239.                   _root.killToolTip();
  240.                   var _loc3_ = {x:0,y:0};
  241.                   this.localToGlobal(_loc3_);
  242.                   local_root_mc.globalToLocal(_loc3_);
  243.                   _root.toolTip(_root.bookmark_del_desc,local_root_mc,"right",- Math.round(_loc3_.x),- Math.round(_loc3_.y));
  244.                   this.bg_mc._alpha = Number(_root.submenu_rollover_alpha);
  245.                   infotext_delay = setTimeout(setBookmarkInfoText,250,this._parent.array_name,this._parent.array_id);
  246.                }
  247.             };
  248.             _loc3_.delete_btn_mc.onRollOut = _loc3_.delete_btn_mc.onDragOut = function()
  249.             {
  250.                _root.killToolTip();
  251.                this.bg_mc._alpha = 0;
  252.                if(!editing_active)
  253.                {
  254.                   hideBookmarkInfoText();
  255.                }
  256.             };
  257.             _loc4_ = _loc4_ + 1;
  258.          }
  259.          _loc10_ += hl_y_dis;
  260.       }
  261.       i++;
  262.    }
  263.    if(_loc15_ == 0)
  264.    {
  265.       subheader_op.text = _root.my_bm_no_bookmarks_desc;
  266.       info_mc.subheader_op.text = "";
  267.    }
  268.    else
  269.    {
  270.       bookmark_holder_mc.attachMovie("headline_mc","dummy",bookmark_holder_mc.getNextHighestDepth());
  271.       bookmark_holder_mc.dummy._y = _loc10_;
  272.       bookmark_holder_mc.dummy.text_op.autoSize = true;
  273.       subheader_op.text = _root.my_bm_desc;
  274.       info_mc.subheader_op.text = _root.my_bm_teaser_info_desc;
  275.    }
  276.    setTimeout(setBookmarkScrollerVisible,200);
  277. }
  278. function removeBookmarks()
  279. {
  280.    for(var _loc1_ in bookmark_holder_mc)
  281.    {
  282.       bookmark_holder_mc[_loc1_].removeMovieClip();
  283.    }
  284. }
  285. function reRenderBookmark(bm_mc)
  286. {
  287.    var _loc2_ = v2b_so.data[bm_mc.array_name].bookmarks;
  288.    bm_mc.original_text = _loc2_[selected_bookmark.array_id].description;
  289.    bm_mc.sec = _loc2_[selected_bookmark.array_id].sec;
  290.    bm_mc.text_op.text = bm_mc.original_text;
  291.    bm_mc.text_op.stringCutter_advanced(" ...");
  292.    if(_loc2_[selected_bookmark.array_id].bm_date != undefined)
  293.    {
  294.       bm_mc.date_op.text = _loc2_[selected_bookmark.array_id].bm_date;
  295.    }
  296.    else
  297.    {
  298.       bm_mc.date_op.text = "";
  299.    }
  300.    bm_mc.time_op.text = createTimeString(_loc2_[selected_bookmark.array_id].sec);
  301. }
  302. function setBookmarkInfoText(array_name, array_id, pd)
  303. {
  304.    var _loc2_ = undefined;
  305.    if(pd)
  306.    {
  307.       _loc2_ = _root.pd_bm_object[array_name][array_id];
  308.    }
  309.    else
  310.    {
  311.       _loc2_ = v2b_so.data[array_name].bookmarks[array_id];
  312.    }
  313.    info_mc.bm_header_op.text = _loc2_.description;
  314.    info_mc.bm_text_op._y = Math.round(info_mc.bm_header_op._y + info_mc.bm_header_op._height + 9);
  315.    info_mc.bm_text_op.text = _loc2_.memo;
  316.    if(info_mc.bm_text_op._y + info_mc.bm_text_op._height > parent_container_height - 150)
  317.    {
  318.       info_mc.bm_text_op.autoSize = false;
  319.       info_mc.bm_text_op._height = Math.max(17,parent_container_height - 150 - info_mc.bm_text_op._y);
  320.    }
  321.    info_mc.bm_time_op._y = Math.round(info_mc.bm_text_op._y + info_mc.bm_text_op._height + 18);
  322.    info_mc.bm_time_op.text = createTimeString(_loc2_.sec);
  323.    info_mc.footer_line_mc._y = info_mc.bm_time_op._y + 40;
  324.    info_mc.footer_line_mc._visible = true;
  325. }
  326. function hideBookmarkInfoText()
  327. {
  328.    clearInterval(infotext_delay);
  329.    info_mc.bm_header_op.text = "";
  330.    info_mc.bm_text_op.text = "";
  331.    info_mc.bm_text_op.autoSize = true;
  332.    info_mc.bm_time_op.text = "";
  333.    info_mc.footer_line_mc._visible = false;
  334.    info_mc.bm_text_op._width = 236;
  335.    info_mc.bm_text_bg_mc._visible = false;
  336.    info_mc.bm_header_bg_mc._visible = false;
  337.    info_mc.text_scroller.enabled = false;
  338.    info_mc.text_scroller._visible = false;
  339.    clearInterval(text_scroller_delay);
  340. }
  341. function disableBookmarks()
  342. {
  343.    for(var _loc1_ in bookmark_holder_mc)
  344.    {
  345.       if(bookmark_holder_mc[_loc1_].mc_type == "bookmark")
  346.       {
  347.          bookmark_holder_mc[_loc1_].bg_mc.enabled = false;
  348.          if(bookmark_holder_mc[_loc1_] != selected_bookmark)
  349.          {
  350.             bookmark_holder_mc[_loc1_]._alpha = 30;
  351.          }
  352.          bookmark_holder_mc[_loc1_].delete_btn_mc.enabled = false;
  353.          bookmark_holder_mc[_loc1_].edit_btn_mc.enabled = false;
  354.       }
  355.       else
  356.       {
  357.          bookmark_holder_mc[_loc1_]._alpha = 30;
  358.       }
  359.    }
  360. }
  361. function gotoBookmark(movie_id, array_name, array_id, pd)
  362. {
  363.    var _loc10_ = video_array[movie_id].movie_name;
  364.    var _loc8_ = video_array[movie_id].movie;
  365.    var _loc9_ = video_array[movie_id].chapter_id;
  366.    var _loc3_ = _loc9_.split(".");
  367.    if(_loc3_.length > 0 && isNaN(Number(_loc3_[_loc3_.length - 1])))
  368.    {
  369.       _loc3_.splice(_loc3_.length - 1,1);
  370.    }
  371.    var _loc4_ = _root.cd_content.firstChild;
  372.    if(_loc3_.length > 1)
  373.    {
  374.       var _loc2_ = 0;
  375.       while(_loc2_ < _loc3_.length - 1)
  376.       {
  377.          _loc4_ = _loc4_.childNodes[_loc3_[_loc2_] - 1];
  378.          _loc2_ = _loc2_ + 1;
  379.       }
  380.    }
  381.    var _loc6_ = 0;
  382.    var _loc5_ = undefined;
  383.    if(pd)
  384.    {
  385.       _loc5_ = _root.pd_bm_object[array_name][array_id];
  386.    }
  387.    else
  388.    {
  389.       _loc5_ = v2b_so.data[array_name].bookmarks[array_id];
  390.    }
  391.    if(_loc5_ != undefined)
  392.    {
  393.       _loc6_ = _loc5_.sec;
  394.    }
  395.    _root.renderVideoBookmark(_loc4_,_loc8_,_loc10_,_loc6_);
  396. }
  397. function openBookmarkEditField()
  398. {
  399.    editing_active = true;
  400.    clearInterval(infotext_delay);
  401.    disableBookmarks();
  402.    var _loc4_ = selected_bookmark.array_name;
  403.    var _loc6_ = v2b_so.data[_loc4_].bookmarks;
  404.    var _loc5_ = v2b_so.data[_loc4_].bookmarks[selected_bookmark.array_id];
  405.    info_mc.bm_header_op.text = _loc5_.description;
  406.    info_mc.bm_text_op.text = _loc5_.memo;
  407.    info_mc.bm_header_op.autoSize = false;
  408.    info_mc.bm_header_op._height = 37;
  409.    info_mc.bm_header_op.type = "input";
  410.    info_mc.bm_header_op.maxChars = 100;
  411.    info_mc.bm_header_op.selectable = true;
  412.    info_mc.bm_header_op.textColor = _root.parseColor(_root.form_text_color);
  413.    info_mc.bm_text_op.autoSize = false;
  414.    info_mc.bm_text_op._y = Math.round(info_mc.bm_header_op._y + info_mc.bm_header_op._height + 8);
  415.    info_mc.bm_text_op._height = 156;
  416.    info_mc.bm_text_op._width = 218;
  417.    info_mc.bm_text_op.type = "input";
  418.    info_mc.bm_text_op.maxChars = 500;
  419.    info_mc.bm_text_op.selectable = true;
  420.    info_mc.bm_text_op.textColor = _root.parseColor(_root.form_text_color);
  421.    info_mc.bm_header_bg_mc._x = info_mc.bm_header_op._x - 2;
  422.    info_mc.bm_header_bg_mc._y = info_mc.bm_header_op._y - 3;
  423.    info_mc.bm_header_bg_mc._width = Math.round(info_mc.bm_header_op._width + 4);
  424.    info_mc.bm_header_bg_mc._height = Math.round(info_mc.bm_header_op._height + 4);
  425.    info_mc.bm_header_bg_mc._visible = true;
  426.    info_mc.bm_text_bg_mc._x = info_mc.bm_text_op._x - 2;
  427.    info_mc.bm_text_bg_mc._y = info_mc.bm_text_op._y - 3;
  428.    info_mc.bm_text_bg_mc._width = Math.round(info_mc.bm_text_op._width + 6 + 16);
  429.    info_mc.bm_text_bg_mc._height = Math.round(info_mc.bm_text_op._height + 4);
  430.    info_mc.bm_text_bg_mc._visible = true;
  431.    text_scroller_delay = setTimeout(setTextScoller,200);
  432.    info_mc.bm_time_op._y = Math.round(info_mc.bm_text_op._y + info_mc.bm_text_op._height + 18);
  433.    info_mc.footer_line_mc._y = info_mc.bm_time_op._y + 40;
  434.    info_mc.footer_line_mc._visible = false;
  435.    var _loc2_ = info_mc.attachMovie("movie_navigation_btn","bookmark_save_btn",info_mc.getNextHighestDepth());
  436.    _loc2_._x = info_mc.bm_text_bg_mc._x;
  437.    _loc2_._y = info_mc.footer_line_mc._y;
  438.    _loc2_.text_op.autoSize = true;
  439.    _loc2_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  440.    _loc2_.text_op.text = _root.bookmark_save_button_desc;
  441.    _loc2_.btn_bg_mc._width = Math.round(info_mc.bm_text_bg_mc._width / 2) - 2;
  442.    _loc2_.btn_rollover_mc._width = _loc2_.btn_bg_mc._width;
  443.    _loc2_.btn_pressed_mc._width = _loc2_.btn_bg_mc._width;
  444.    _loc2_.text_op._x = Math.floor((_loc2_.btn_bg_mc._width - _loc2_.text_op.textWidth) / 2) - 2;
  445.    setRGB(_loc2_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  446.    _loc2_.btn_rollover_mc._alpha = 0;
  447.    _loc2_.btn_pressed_mc._alpha = 0;
  448.    _loc2_.onRelease = bookmarkEditField_onSave;
  449.    _loc2_.onRollOver = _loc2_.onDragOver = navigationButton_onRollOver;
  450.    _loc2_.onRollOut = _loc2_.onDragOut = navigationButton_onRollOut;
  451.    var _loc3_ = info_mc.attachMovie("movie_navigation_btn","bookmark_cancle_btn",info_mc.getNextHighestDepth());
  452.    _loc3_._x = _loc2_._x + _loc2_._width + 2;
  453.    _loc3_._y = info_mc.footer_line_mc._y;
  454.    _loc3_.text_op.autoSize = true;
  455.    _loc3_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  456.    _loc3_.text_op.text = _root.bookmark_cancle_button_desc;
  457.    _loc3_.btn_bg_mc._width = Math.round(info_mc.bm_text_bg_mc._width - _loc2_.btn_bg_mc._width - 2);
  458.    _loc3_.btn_rollover_mc._width = _loc3_.btn_bg_mc._width;
  459.    _loc3_.btn_pressed_mc._width = _loc3_.btn_bg_mc._width;
  460.    _loc3_.text_op._x = Math.floor((_loc3_.btn_bg_mc._width - _loc3_.text_op.textWidth) / 2) - 2;
  461.    setRGB(_loc3_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  462.    _loc3_.btn_rollover_mc._alpha = 0;
  463.    _loc3_.btn_pressed_mc._alpha = 0;
  464.    _loc3_.onRelease = bookmarkEditField_onClose;
  465.    _loc3_.onRollOver = _loc3_.onDragOver = navigationButton_onRollOver;
  466.    _loc3_.onRollOut = _loc3_.onDragOut = navigationButton_onRollOut;
  467. }
  468. function openBookmarkDeleteField()
  469. {
  470.    editing_active = true;
  471.    clearInterval(infotext_delay);
  472.    disableBookmarks();
  473.    info_mc.footer_line_mc._visible = false;
  474.    info_mc.bm_alert_op._y = info_mc.footer_line_mc._y;
  475.    info_mc.bm_alert_op.autoSize = true;
  476.    info_mc.bm_alert_op.multiline = true;
  477.    info_mc.bm_alert_op.wordWrap = true;
  478.    info_mc.bm_alert_op.text = _root.bookmark_del_question;
  479.    var _loc2_ = info_mc.attachMovie("movie_navigation_btn","bookmark_yes_btn",info_mc.getNextHighestDepth());
  480.    _loc2_._x = info_mc.footer_line_mc._x;
  481.    _loc2_._y = Math.round(info_mc.bm_alert_op._y + info_mc.bm_alert_op.textHeight + 15);
  482.    _loc2_.text_op.autoSize = true;
  483.    _loc2_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  484.    _loc2_.text_op.text = _root.bookmark_del_confirm;
  485.    _loc2_.btn_bg_mc._width = Math.round(info_mc.footer_line_mc._width / 2) - 2;
  486.    _loc2_.btn_rollover_mc._width = _loc2_.btn_bg_mc._width;
  487.    _loc2_.btn_pressed_mc._width = _loc2_.btn_bg_mc._width;
  488.    _loc2_.text_op._x = Math.floor((_loc2_.btn_bg_mc._width - _loc2_.text_op.textWidth) / 2) - 2;
  489.    setRGB(_loc2_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  490.    _loc2_.btn_rollover_mc._alpha = 0;
  491.    _loc2_.btn_pressed_mc._alpha = 0;
  492.    _loc2_.onRelease = bookmarkEditField_onDelete;
  493.    _loc2_.onRollOver = _loc2_.onDragOver = navigationButton_onRollOver;
  494.    _loc2_.onRollOut = _loc2_.onDragOut = navigationButton_onRollOut;
  495.    var _loc3_ = info_mc.attachMovie("movie_navigation_btn","bookmark_no_btn",info_mc.getNextHighestDepth());
  496.    _loc3_._x = _loc2_._x + _loc2_._width + 2;
  497.    _loc3_._y = _loc2_._y;
  498.    _loc3_.text_op.autoSize = true;
  499.    _loc3_.text_op.textColor = _root.parseColor(_root.btn_text_color);
  500.    _loc3_.text_op.text = _root.bookmark_del_negate;
  501.    _loc3_.btn_bg_mc._width = Math.round(info_mc.footer_line_mc._width - _loc2_.btn_bg_mc._width - 2);
  502.    _loc3_.btn_rollover_mc._width = _loc3_.btn_bg_mc._width;
  503.    _loc3_.btn_pressed_mc._width = _loc3_.btn_bg_mc._width;
  504.    _loc3_.text_op._x = Math.floor((_loc3_.btn_bg_mc._width - _loc3_.text_op.textWidth) / 2) - 2;
  505.    setRGB(_loc3_.btn_rollover_mc,_root.parseColor(_root.btn_rollover_color));
  506.    _loc3_.btn_rollover_mc._alpha = 0;
  507.    _loc3_.btn_pressed_mc._alpha = 0;
  508.    _loc3_.onRelease = bookmarkEditField_onClose;
  509.    _loc3_.onRollOver = _loc3_.onDragOver = navigationButton_onRollOver;
  510.    _loc3_.onRollOut = _loc3_.onDragOut = navigationButton_onRollOut;
  511. }
  512. function bookmarkEditField_onSave()
  513. {
  514.    var _loc2_ = selected_bookmark.array_name;
  515.    var _loc1_ = v2b_so.data[_loc2_].bookmarks;
  516.    if(_loc1_ != undefined && _loc1_[selected_bookmark.array_id].sec == selected_bookmark.sec)
  517.    {
  518.       _loc1_[selected_bookmark.array_id].description = info_mc.bm_header_op.text;
  519.       _loc1_[selected_bookmark.array_id].memo = info_mc.bm_text_op.text;
  520.       _loc1_[selected_bookmark.array_id].bm_date = createDateString(new Date());
  521.       v2b_so.data[_loc2_].bookmarks = _loc1_;
  522.       v2b_so.flush();
  523.       reRenderBookmark(selected_bookmark);
  524.    }
  525.    else
  526.    {
  527.       renderBookmarks();
  528.    }
  529.    bookmarkEditField_onClose();
  530. }
  531. function bookmarkEditField_onDelete()
  532. {
  533.    var _loc2_ = selected_bookmark.array_name;
  534.    var _loc1_ = v2b_so.data[_loc2_].bookmarks;
  535.    if(_loc1_ != undefined && _loc1_[selected_bookmark.array_id].sec == selected_bookmark.sec)
  536.    {
  537.       _loc1_.splice(selected_bookmark.array_id,1);
  538.       v2b_so.data[_loc2_].bookmarks = new Array();
  539.       if(_loc1_.length > 0)
  540.       {
  541.          v2b_so.data[_loc2_].bookmarks = _loc1_;
  542.       }
  543.       v2b_so.flush();
  544.    }
  545.    bookmarkEditField_onClose();
  546.    renderBookmarks();
  547. }
  548. function bookmarkEditField_onClose()
  549. {
  550.    for(var _loc2_ in bookmark_holder_mc)
  551.    {
  552.       if(bookmark_holder_mc[_loc2_].mc_type == "bookmark")
  553.       {
  554.          bookmark_holder_mc[_loc2_].bg_mc.enabled = true;
  555.          bookmark_holder_mc[_loc2_]._alpha = 100;
  556.          bookmark_holder_mc[_loc2_].delete_btn_mc.enabled = true;
  557.          bookmark_holder_mc[_loc2_].edit_btn_mc.enabled = true;
  558.       }
  559.       else
  560.       {
  561.          bookmark_holder_mc[_loc2_]._alpha = 100;
  562.       }
  563.    }
  564.    info_mc.bookmark_cancle_btn.removeMovieClip();
  565.    info_mc.bookmark_save_btn.removeMovieClip();
  566.    info_mc.bookmark_yes_btn.removeMovieClip();
  567.    info_mc.bookmark_no_btn.removeMovieClip();
  568.    hideBookmarkInfoText();
  569.    info_mc.bm_header_op.autoSize = true;
  570.    info_mc.bm_header_op.type = "dynamic";
  571.    info_mc.bm_header_op.background = false;
  572.    info_mc.bm_header_op.textColor = _root.parseColor(_root.teaser_subheader2_color);
  573.    info_mc.bm_header_op.selectable = false;
  574.    info_mc.bm_text_op.autoSize = true;
  575.    info_mc.bm_text_op.type = "dynamic";
  576.    info_mc.bm_text_op.background = false;
  577.    info_mc.bm_text_op.textColor = _root.parseColor(_root.teaser_text_color);
  578.    info_mc.bm_text_op.selectable = false;
  579.    info_mc.bm_alert_op.text = "";
  580.    editing_active = false;
  581.    selected_bookmark = undefined;
  582. }
  583. function navigationButton_onRollOver()
  584. {
  585.    this.btn_rollover_mc._alpha = 100;
  586. }
  587. function navigationButton_onRollOut()
  588. {
  589.    this.btn_rollover_mc._alpha = 0;
  590. }
  591. function setVisibility(value)
  592. {
  593.    if(value)
  594.    {
  595.       renderBookmarks();
  596.       bookmarkEditField_onClose();
  597.       Mouse.removeListener(ftScrollBarMouseListener);
  598.       Mouse.addListener(ftScrollBarMouseListener);
  599.    }
  600.    else
  601.    {
  602.       bookmarkEditField_onClose();
  603.       Mouse.removeListener(ftScrollBarMouseListener);
  604.       bm_scroller.scrollPercentage = 0;
  605.    }
  606.    this._visible = value;
  607. }
  608. function setLocalPos()
  609. {
  610.    if(local_root_mc._visible)
  611.    {
  612.       if(local_test)
  613.       {
  614.          parent_container_width = Stage.width;
  615.          parent_container_height = Stage.height;
  616.       }
  617.       else
  618.       {
  619.          parent_container_width = _root.content_pos_mc.content_panel_mc._width;
  620.          parent_container_height = _root.content_pos_mc.content_panel_mc._height;
  621.       }
  622.       max_content_width = Math.floor(parent_container_width - info_container_width - 40);
  623.       visible_scroller_height = Math.floor(parent_container_height - bm_scroller._y);
  624.       bm_scroller.viewAreaWidth = parent_container_width - 293;
  625.       bm_scroller.viewAreaHeight = Math.floor(visible_scroller_height);
  626.       bm_scroller._x = parent_container_width - 291;
  627.       clearInterval(update_scroller_delay);
  628.       update_scroller_delay = setTimeout(updateScroller,250);
  629.       info_mc._x = Math.floor(parent_container_width - info_container_width);
  630.       info_mc.info_v_line_mc._height = parent_container_height + 2;
  631.       header_line_mc._width = max_content_width;
  632.       legende_mc._x = Math.round(header_line_mc._x + header_line_mc._width - legende_mc._width);
  633.       header_op._width = legende_mc._x - header_op._x - 20;
  634.       subheader_op._width = legende_mc._x - subheader_op._x - 20;
  635.       for(var _loc2_ in bookmark_holder_mc)
  636.       {
  637.          if(bookmark_holder_mc[_loc2_].mc_type == "headline")
  638.          {
  639.             setHeaderWidth(bookmark_holder_mc[_loc2_],max_content_width);
  640.          }
  641.          else if(bookmark_holder_mc[_loc2_].mc_type == "bookmark")
  642.          {
  643.             setBookmarkWidth(bookmark_holder_mc[_loc2_],max_content_width,true);
  644.          }
  645.       }
  646.    }
  647. }
  648. function updateScroller()
  649. {
  650.    if(visible_scroller_height < bookmark_holder_mc._height || bm_scroller.visible)
  651.    {
  652.       bm_scroller.setSize(15,visible_scroller_height);
  653.    }
  654. }
  655. function setBookmarkWidth(mc, bm_width, cut_text)
  656. {
  657.    mc.delete_btn_mc._x = bm_width - 22;
  658.    mc.edit_btn_mc._x = bm_width - 44;
  659.    var _loc2_ = bm_width - 44;
  660.    mc.bg_mc._width = _loc2_;
  661.    mc.play_btn_mc._x = _loc2_ - 22;
  662.    mc.time_op._x = _loc2_ - 110;
  663.    mc.date_op._x = _loc2_ - 220;
  664.    mc.text_op._width = Math.max(0,_loc2_ - 220 - mc.text_op._x - 10);
  665.    if(cut_text)
  666.    {
  667.       mc.text_op.text = mc.original_text;
  668.       clearInterval(mc.cut_delay);
  669.       if(mc.text_op._width > 0)
  670.       {
  671.          mc.cut_delay = setTimeout(mc.text_op,"stringCutter_advanced",200," ...");
  672.       }
  673.    }
  674. }
  675. function setHeaderWidth(mc, bm_width, cut_text)
  676. {
  677.    mc.text_op._width = Math.max(0,bm_width - mc.text_op._x);
  678.    if(cut_text)
  679.    {
  680.       mc.text_op.text = mc.original_text;
  681.       clearInterval(mc.cut_delay);
  682.       if(mc.text_op._width > 0)
  683.       {
  684.          mc.cut_delay = setTimeout(mc.text_op,"stringCutter_advanced",200," ...");
  685.       }
  686.    }
  687. }
  688. function createDateString(_date)
  689. {
  690.    var _loc1_ = "";
  691.    if(_date.getDate() >= 10)
  692.    {
  693.       _loc1_ += String(_date.getDate()) + ".";
  694.    }
  695.    else
  696.    {
  697.       _loc1_ += "0" + String(_date.getDate()) + ".";
  698.    }
  699.    if(_date.getMonth() >= 10)
  700.    {
  701.       _loc1_ += String(_date.getMonth()) + ".";
  702.    }
  703.    else
  704.    {
  705.       _loc1_ += "0" + String(_date.getMonth()) + ".";
  706.    }
  707.    _loc1_ += String(_date.getFullYear());
  708.    return _loc1_;
  709. }
  710. function createTimeString(_sec)
  711. {
  712.    var _loc1_ = "";
  713.    var _loc2_ = Math.floor(_sec / 60);
  714.    var _loc3_ = _sec - _loc2_ * 60;
  715.    if(_loc2_ >= 10)
  716.    {
  717.       _loc1_ += String(_loc2_) + ":";
  718.    }
  719.    else
  720.    {
  721.       _loc1_ += "0" + String(_loc2_) + ":";
  722.    }
  723.    if(_loc3_ >= 10)
  724.    {
  725.       _loc1_ += String(_loc3_);
  726.    }
  727.    else
  728.    {
  729.       _loc1_ += "0" + String(_loc3_);
  730.    }
  731.    return _loc1_;
  732. }
  733. function setRGB(mc, color)
  734. {
  735.    var _loc1_ = new flash.geom.ColorTransform();
  736.    _loc1_.rgb = color;
  737.    var _loc2_ = new flash.geom.Transform(mc);
  738.    _loc2_.colorTransform = _loc1_;
  739. }
  740. function setBookmarkScrollerVisible()
  741. {
  742.    bm_scroller._visible = true;
  743. }
  744. function setTextScoller()
  745. {
  746.    info_mc.text_scroller.enabled = true;
  747.    info_mc.text_scroller._visible = true;
  748.    info_mc.text_scroller._x = info_mc.bm_text_bg_mc._x + info_mc.bm_text_bg_mc._width - 16;
  749.    info_mc.text_scroller._y = info_mc.bm_text_bg_mc._y + 2;
  750. }
  751. var local_root_mc = this;
  752. var local_test = false;
  753. var contPath = "config/content.xml";
  754. var video_array = new Array();
  755. var v2b_so = SharedObject.getLocal(_root.so_name,"/");
  756. var bm_y_dis = 25;
  757. var hl_y_dis = 50;
  758. var show_predefined_bm = true;
  759. var parent_container_width = 1025;
  760. var parent_container_heigt = 626;
  761. var info_container_width = 277;
  762. var max_content_width = 720;
  763. var editing_active = false;
  764. var selected_bookmark;
  765. var ftScrollBarMouseListener = new Object();
  766. var visible_scroller_height;
  767. var bmPanelListener = new Object();
  768. info_mc.footer_line_mc._visible = false;
  769. info_mc.bm_header_op.wordWrap = true;
  770. info_mc.bm_header_op.autoSize = true;
  771. info_mc.bmtext_op.wordWrap = true;
  772. info_mc.bm_text_op.autoSize = true;
  773. bm_scroller._visible = false;
  774. info_mc.text_scroller.enabled = false;
  775. info_mc.text_scroller._visible = false;
  776. info_mc.bm_text_bg_mc._visible = false;
  777. info_mc.bm_header_bg_mc._visible = false;
  778. ftScrollBarMouseListener.onMouseWheel = function(delta, scrollTarget)
  779. {
  780.    if(local_root_mc._visible && bm_scroller.enabled)
  781.    {
  782.       if(bm_scroller.oSipDWs.hitTest(_root._xmouse,_root._ymouse,false))
  783.       {
  784.          var _loc3_ = Math.floor(parent_container_height - bm_scroller._y);
  785.          var _loc2_ = Math.ceil(100 * bm_y_dis / (bookmark_holder_mc._height - _loc3_));
  786.          if(_loc2_ > 0)
  787.          {
  788.             if(delta < 1)
  789.             {
  790.                bm_scroller.scrollPercentage = Math.min(100,bm_scroller.scrollPercentage + _loc2_);
  791.             }
  792.             else
  793.             {
  794.                bm_scroller.scrollPercentage = Math.max(0,bm_scroller.scrollPercentage - _loc2_);
  795.             }
  796.          }
  797.       }
  798.    }
  799. };
  800. Mouse.addListener(ftScrollBarMouseListener);
  801.