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

  1. function renderVideoDataArray(nodes_array, depth_array)
  2. {
  3.    var _loc1_ = 0;
  4.    while(_loc1_ < nodes_array.length)
  5.    {
  6.       depth_array[depth_array.length - 1] += 1;
  7.       var _loc4_ = depth_array.join(".") + ".";
  8.       nodes_array[_loc1_].attributes.index = _loc4_;
  9.       if(nodes_array[_loc1_].attributes.type == "movie")
  10.       {
  11.          video_array.push({chapter_id:_loc4_,movie_name:nodes_array[_loc1_].attributes.name,movie:nodes_array[_loc1_].attributes.movie});
  12.       }
  13.       if(nodes_array[_loc1_].hasChildNodes())
  14.       {
  15.          renderVideoDataArray(nodes_array[_loc1_].childNodes,depth_array.concat([0]));
  16.       }
  17.       _loc1_ = _loc1_ + 1;
  18.    }
  19.    if(depth_array.length == 1)
  20.    {
  21.       openApplication();
  22.    }
  23. }
  24. function renderSettings()
  25. {
  26.    if(client_os == "Windows")
  27.    {
  28.       mdm.Forms.SplashForm.callFunction("output","Rendering settings..","");
  29.    }
  30.    var _loc2_ = settings.firstChild.childNodes[0];
  31.    while(_loc2_ != null)
  32.    {
  33.       _root[_loc2_.nodeName] = _loc2_.firstChild.nodeValue;
  34.       _loc2_ = _loc2_.nextSibling;
  35.    }
  36.    _loc2_ = styles.firstChild.childNodes[0];
  37.    while(_loc2_ != null)
  38.    {
  39.       _root[_loc2_.nodeName] = _loc2_.firstChild.nodeValue;
  40.       _loc2_ = _loc2_.nextSibling;
  41.    }
  42.    if(default_stage_width > client_res_x)
  43.    {
  44.       default_stage_width = client_res_x;
  45.    }
  46.    if(default_stage_height > client_res_y)
  47.    {
  48.       default_stage_height = client_res_y;
  49.    }
  50.    if(allow_bookmarks != "true")
  51.    {
  52.       tab_bookmarks = undefined;
  53.    }
  54.    tab_arr.push([tab_home,"home_mc",false]);
  55.    tab_arr.push([tab_dvd_content,"dvd_content_mc",false]);
  56.    tab_arr.push([tab_bookmarks,"bookmarks_mc",false]);
  57.    tab_arr.push([tab_online,"online_mc",false]);
  58.    tab_arr.push([tab_help,"help_mc",false]);
  59.    tab_arr.push([tab_setup,"setup_mc",false]);
  60.    i = 0;
  61.    while(i < tab_arr.length)
  62.    {
  63.       if(!(tab_arr[i][0] == "" or tab_arr[i][0] == null or tab_arr[i][0] == undefined))
  64.       {
  65.          used_tab_arr.push(tab_arr[i]);
  66.       }
  67.       i++;
  68.    }
  69.    if(moviefolder_1280 == "" or moviefolder_1280 == null or moviefolder_1280 == undefined or moviefolder_1280 == "null" or moviefolder_1280 == "undefined")
  70.    {
  71.       moviefolder_1280 = moviefolder_1024;
  72.    }
  73.    if(moviefolder_1024 == "" or moviefolder_1024 == null or moviefolder_1024 == undefined or moviefolder_1024 == "null" or moviefolder_1024 == "undefined")
  74.    {
  75.       moviefolder_1024 = moviefolder_1280;
  76.    }
  77.    if(max_video_res == 1280)
  78.    {
  79.       moviefolder = moviefolder_1280;
  80.    }
  81.    else if(max_video_res == 1024)
  82.    {
  83.       moviefolder = moviefolder_1024;
  84.    }
  85.    moviepath_info = folder + moviefolder;
  86.    if(wfiles_folder == undefined)
  87.    {
  88.       wfiles_folder = "";
  89.    }
  90.    if(client_res_y <= 768)
  91.    {
  92.       full_video_mode_display = "true";
  93.    }
  94.    if(videojump_ondrag_allowed == "true")
  95.    {
  96.       videojump_ondrag_allowed = true;
  97.    }
  98.    else
  99.    {
  100.       videojump_ondrag_allowed = false;
  101.    }
  102.    apptitle = vendor_name + " - " + app_name;
  103.    application_title_op.autoSize = true;
  104.    application_title_op.text = apptitle;
  105.    mdm.Application.title = apptitle;
  106.    so_name = "v2b" + unique_app_code;
  107.    v2b_so = SharedObject.getLocal(so_name,"/");
  108.    if(v2b_so.data.last_seen_movie)
  109.    {
  110.       last_seen_movie_xml_node = new XML(v2b_so.data.last_seen_movie[0]);
  111.    }
  112.    tmp_header_info = header_start_info;
  113.    if(debug == "true")
  114.    {
  115.       renderDebugger();
  116.    }
  117.    loadContent();
  118. }
  119. function renderDebugger()
  120. {
  121.    test_op._y = 200;
  122.    _root.attachMovie("debug_mc","debug_mc_attached",5500);
  123.    debug_mc_attached.debug_op.text = os_info + "\n" + os_string[0];
  124.    debug_mc_attached.debug_op.text += "\n" + fsp_path;
  125. }
  126. function renderMain()
  127. {
  128.    loadClip(fsp_path + folder + bg_image,bg_mc,null,null,"fullfixed",true,undefined,false,true);
  129.    content_pos_mc._x = 0;
  130.    content_pos_mc._y = 0;
  131.    content_pos_mc.attachMovie("content_bg_mc","content_bg_mc",content_pos_mc.getNextHighestDepth());
  132.    content_pos_mc.content_bg_mc._y = 25;
  133.    content_pos_mc.attachMovie("bottom_mc","bottom_mc",content_pos_mc.getNextHighestDepth());
  134.    content_pos_mc.bottom_mc._x = 2;
  135.    content_pos_mc.bottom_mc._y = 2;
  136.    content_pos_mc.bottom_mc.app_header_text_mc.text_op.autoSize = true;
  137.    content_pos_mc.bottom_mc.app_header_text_mc.text_op.text = app_name;
  138.    content_pos_mc.bottom_mc.app_header_reflex_mc.text_op.autoSize = true;
  139.    content_pos_mc.bottom_mc.app_header_reflex_mc.text_op.text = app_name;
  140.    content_pos_mc.bottom_mc.header_reflexion_mc._width = Math.round(content_pos_mc.bottom_mc.app_header_reflex_mc.text_op._width + 10);
  141.    content_pos_mc.bottom_mc.createEmptyMovieClip("logo_bottom_holder_mc",1);
  142.    loadClip(fsp_path + folder + logo_bottom,content_pos_mc.bottom_mc.logo_bottom_holder_mc,null,null,null,false,setPos,false,true);
  143.    content_pos_mc.attachMovie("tab_navigation_mc","tab_navigation_mc",content_pos_mc.getNextHighestDepth());
  144.    content_pos_mc.tab_navigation_mc._y = 0;
  145.    content_pos_mc.tab_navigation_mc.attachMovie("tab_navigation_bg_mc","tab_navigation_bg_mc",content_pos_mc.tab_navigation_mc.getNextHighestDepth());
  146.    content_pos_mc.tab_navigation_mc.tab_navigation_bg_mc._height = 25;
  147.    i = 0;
  148.    while(i < used_tab_arr.length)
  149.    {
  150.       content_pos_mc.tab_navigation_mc.attachMovie("tab_navigation_item_mc","tab_item_mc" + i,content_pos_mc.tab_navigation_mc.getNextHighestDepth());
  151.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].item_id = i;
  152.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_rollover_mc._visible = false;
  153.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op._x = 20;
  154.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.autoSize = true;
  155.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.textColor = parseColor(tabnavigator_text_color);
  156.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.text = used_tab_arr[i][0].toUpperCase();
  157.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_bg_mc._width = Math.round(content_pos_mc.tab_navigation_mc["tab_item_mc" + i].text_op.textWidth + 47);
  158.       if(i == 0)
  159.       {
  160.          content_pos_mc.tab_navigation_mc["tab_item_mc" + i]._x = 2;
  161.       }
  162.       else
  163.       {
  164.          content_pos_mc.tab_navigation_mc["tab_item_mc" + i]._x = Math.round(content_pos_mc.tab_navigation_mc["tab_item_mc" + (i - 1)]._x + content_pos_mc.tab_navigation_mc["tab_item_mc" + (i - 1)]._width + 2);
  165.       }
  166.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i]._y = 2;
  167.       drawBox(content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_rollover_mc,content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_bg_mc._width,23,parseColor(tabnavigator_rollover_color),parseColor(tabnavigator_rollover_color),100,100,"linear");
  168.       drawBox(content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc,content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_bg_mc._width,25,parseColor(tabnavigator_pressed_color),parseColor(tabnavigator_pressed_color),100,100,"linear");
  169.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onRollOver = function()
  170.       {
  171.          this.tab_navigation_item_rollover_mc._visible = true;
  172.       };
  173.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onRollOut = content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onReleaseOutside = function()
  174.       {
  175.          this.tab_navigation_item_rollover_mc._visible = false;
  176.       };
  177.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].onRelease = function()
  178.       {
  179.          renderContent(this.item_id);
  180.       };
  181.       i++;
  182.    }
  183.    content_pos_mc.tab_navigation_mc.tab_navigation_bg_mc._width = Math.round(content_pos_mc.tab_navigation_mc._width + 2);
  184.    content_pos_mc.attachMovie("content_panel_mc","content_panel_mc",content_pos_mc.getNextHighestDepth());
  185.    AsBroadcaster.initialize(content_pos_mc.content_panel_mc);
  186.    content_pos_mc.content_panel_mc._x = 2;
  187.    content_pos_mc.content_panel_mc._y = 27;
  188.    content_pos_mc.createEmptyMovieClip("content_mc",content_pos_mc.getNextHighestDepth());
  189.    content_pos_mc.content_mc._x = 2;
  190.    content_pos_mc.content_mc._y = 27;
  191.    content_pos_mc.attachMovie("video_mc","video_mc",content_pos_mc.getNextHighestDepth());
  192.    content_pos_mc.video_mc._x = 2;
  193.    content_pos_mc.video_mc._y = 52;
  194.    loadClip(fsp_path + folder + "vcore.swf",content_pos_mc.video_mc,null,null,null,false,false,false,false,true);
  195.    content_pos_mc.attachMovie("mct_mc","mct_mc",content_pos_mc.getNextHighestDepth());
  196.    content_pos_mc.mct_mc._x = 0;
  197.    if(full_video_mode_display == "true")
  198.    {
  199.       content_pos_mc.mct_mc._y = 27;
  200.    }
  201.    else
  202.    {
  203.       content_pos_mc.mct_mc._y = 52;
  204.    }
  205.    setPos();
  206.    renderContent(0);
  207. }
  208. function renderContent(arg)
  209. {
  210.    if(video_mode)
  211.    {
  212.       if(mct_mode)
  213.       {
  214.          killMCT();
  215.       }
  216.       else if(content_pos_mc.video_mc.flv_player_state == "stopped")
  217.       {
  218.          killMovie();
  219.       }
  220.       else
  221.       {
  222.          pauseMovie();
  223.       }
  224.    }
  225.    i = 0;
  226.    while(i < used_tab_arr.length)
  227.    {
  228.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].tab_navigation_item_active_mc._visible = false;
  229.       content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].text_op.textColor = parseColor(tabnavigator_text_color);
  230.       content_pos_mc.tab_navigation_mc["tab_item_mc" + i].enabled = true;
  231.       if(used_tab_arr[i][2])
  232.       {
  233.          content_pos_mc.content_mc[used_tab_arr[i][1]].setVisibility(false);
  234.       }
  235.       i++;
  236.    }
  237.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].tab_navigation_item_rollover_mc._visible = false;
  238.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].tab_navigation_item_active_mc._visible = true;
  239.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].text_op.textColor = parseColor(tabnavigator_text_pressed_color);
  240.    content_pos_mc.tab_navigation_mc["tab_item_mc" + arg].enabled = false;
  241.    if(used_tab_arr[arg][2])
  242.    {
  243.       content_pos_mc.content_mc[used_tab_arr[arg][1]].setVisibility(true);
  244.    }
  245.    else
  246.    {
  247.       content_pos_mc.content_mc.attachMovie(used_tab_arr[arg][1],used_tab_arr[arg][1],arg);
  248.       used_tab_arr[arg][2] = true;
  249.    }
  250.    last_visible_content = arg;
  251. }
  252.