Advertisement
MrCheeze

H*R faq decompilation

Jan 9th, 2021
4,918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function init()
  2. {
  3.    gCurrentPage = 1;
  4.    gAttachDepthCounter = 0;
  5.    gPageDepthCounter = 0;
  6.    initPageHolder(pageLeft_mc);
  7.    initPageHolder(pageRight_mc);
  8.    new Page(pageLeft_mc,pageLeft_mc);
  9.    drawContents();
  10.    drawPages();
  11.    applyPageNumbersToContents();
  12.    showPageAndPair(0);
  13.    next_btn.onRelease = nextButtonPressed;
  14.    prev_btn.onRelease = prevButtonPressed;
  15.    next2_btn.onRelease = nextButtonPressed;
  16.    prev2_btn.onRelease = prevButtonPressed;
  17.    var _loc1_ = 0;
  18.    while(_loc1_ <= 5)
  19.    {
  20.       infold_mc["var" + _loc1_].gotoAndStop(Math.ceil(Math.random() * infold_mc["var" + _loc1_]._totalframes));
  21.       _loc1_ = _loc1_ + 1;
  22.    }
  23. }
  24. function initPageHolder(page_mc)
  25. {
  26.    page_mc.hBound = page_mc._height;
  27.    page_mc.wBound = page_mc._width;
  28.    page_mc.pageBoundary_mc._visible = false;
  29.    page_mc._xscale = 100;
  30.    page_mc._yscale = 100;
  31. }
  32. function drawPages()
  33. {
  34.    trace("drawPages(): called");
  35.    var _loc4_ = 1;
  36.    var _loc3_ = undefined;
  37.    var _loc6_ = 0;
  38.    var _loc7_ = 0;
  39.    while(_loc7_ < gCategories.length)
  40.    {
  41.       _loc6_ = 0;
  42.       _loc4_ = gPages.length % 2 == 0?0:1;
  43.       _loc3_ = new Page(gPageClipNames[_loc4_],gPageClipNames[_loc4_]);
  44.       gCategories[_loc7_].pageNum = gPages.length - 1;
  45.       _loc3_.depthCounter = _loc3_.depthCounter + 1;
  46.       var _loc10_ = _loc3_.my_mc.attachMovie("categoryHeader_mc","categoryHeader_mc" + _loc3_.depthCounter,_loc3_.depthCounter);
  47.       _loc6_ = _loc6_ + _loc10_._height;
  48.       _loc10_.textbox_txt.text = gCategories[_loc7_].categoryName;
  49.       trace("drawPages(): gPageClipNames[currentPageParentDraw] " + gPageClipNames[_loc4_]._name + " " + _loc4_ + " " + gPageClipNames[_loc4_]);
  50.       var _loc5_ = 0;
  51.       while(_loc5_ < gCategories[_loc7_].questions.length)
  52.       {
  53.          trace("drawPages(): category " + _loc7_ + " question " + _loc5_);
  54.          _loc3_.depthCounter = _loc3_.depthCounter + 1;
  55.          var _loc2_ = _loc3_.my_mc.attachMovie("question_mc","question" + _loc3_.depthCounter,_loc3_.depthCounter);
  56.          var _loc8_ = _loc2_.textbox_txt.textHeight;
  57.          _loc2_.textbox_txt.wordWrap = true;
  58.          _loc2_.textbox_txt.autoSize = "left";
  59.          _loc2_.textbox_txt.multiline = true;
  60.          _loc2_.textbox_txt.text = "Q. " + gCategories[_loc7_].questions[_loc5_].questionText;
  61.          if(_loc2_.textbox_txt.textHeight > _loc8_)
  62.          {
  63.             _loc2_.textbox_txt.autoSize = false;
  64.             _loc2_.textbox_txt._height = _loc2_.textbox_txt._height + 16;
  65.          }
  66.          _loc2_._y = _loc6_;
  67.          _loc6_ = _loc6_ + (_loc2_._height - 5);
  68.          _loc3_.depthCounter = _loc3_.depthCounter + 1;
  69.          var _loc1_ = _loc3_.my_mc.attachMovie("answer_mc","answer" + _loc3_.depthCounter,_loc3_.depthCounter);
  70.          _loc8_ = _loc1_.textbox_txt.textHeight;
  71.          _loc1_.textbox_txt.wordWrap = true;
  72.          _loc1_.textbox_txt.autoSize = true;
  73.          _loc1_.textbox_txt.multiline = true;
  74.          _loc1_.textbox_txt.text = "A. " + gCategories[_loc7_].questions[_loc5_].answerText;
  75.          if(_loc1_.textbox_txt.textHeight > _loc8_)
  76.          {
  77.             var _loc9_ = (_loc1_.textbox_txt.textHeight - _loc8_) / 16;
  78.             _loc1_.textbox_txt.autoSize = false;
  79.             _loc1_.textbox_txt._height = _loc1_.textbox_txt._height + 16 * _loc9_;
  80.          }
  81.          _loc1_._y = _loc6_;
  82.          _loc6_ = _loc6_ + (_loc1_._height + SPACE_BETWEEN_ITEMS);
  83.          if(_loc6_ > gPageClipNames[_loc4_].hBound - 14)
  84.          {
  85.             _loc1_.removeMovieClip();
  86.             _loc2_.removeMovieClip();
  87.             _loc5_ = _loc5_ - 1;
  88.             _loc4_ = _loc4_ != 0?0:1;
  89.             _loc3_ = new Page(gPageClipNames[_loc4_],gPageClipNames[_loc4_]);
  90.             _loc6_ = 24;
  91.          }
  92.          _loc5_ = _loc5_ + 1;
  93.       }
  94.       _loc3_.my_mc._visible = false;
  95.       _loc7_ = _loc7_ + 1;
  96.    }
  97. }
  98. function drawContents()
  99. {
  100.    var _loc4_ = 0;
  101.    var _loc3_ = new Page(pageRight_mc,pageRight_mc);
  102.    currentPageParentDraw = 1;
  103.    _loc3_.depthCounter = _loc3_.depthCounter + 1;
  104.    var _loc5_ = _loc3_.my_mc.attachMovie("categoryHeader_mc","categoryHeader_mc" + _loc3_.depthCounter,_loc3_.depthCounter);
  105.    _loc4_ = _loc4_ + _loc5_._height;
  106.    _loc5_.textbox_txt.text = "In this issue:";
  107.    var _loc2_ = 0;
  108.    while(_loc2_ < gCategories.length)
  109.    {
  110.       _loc3_.depthCounter = _loc3_.depthCounter + 1;
  111.       var _loc1_ = _loc3_.my_mc.attachMovie("category_mc","category" + _loc3_.depthCounter,_loc3_.depthCounter);
  112.       gCategories[_loc2_].my_mc = _loc1_;
  113.       trace("drawContents(): temp_mc._name " + _loc1_._name);
  114.       _loc1_.textbox_txt.autoSize = true;
  115.       _loc1_.textbox_txt.text = _loc2_ + 1 + ". " + gCategories[_loc2_].categoryName;
  116.       trace("category page number: " + gCategories[_loc2_].pageNum);
  117.       _loc1_.page_txt.text = gCategories[_loc2_].pageNum;
  118.       _loc1_._y = _loc4_;
  119.       _loc4_ = _loc4_ + (_loc1_._height + SPACE_BETWEEN_ITEMS);
  120.       _loc1_.periodMask_mc._width = _loc1_.periodMask_mc._width - _loc1_.textbox_txt.textWidth;
  121.       _loc1_.periodMask_mc._x = _loc1_.textbox_txt.textWidth + 5;
  122.       _loc1_.category_btn.onRelease = categoryButtonPressed;
  123.       if(_loc4_ > gPageClipNames[currentPageParentDraw].hBound - 14)
  124.       {
  125.          currentPageParentDraw = currentPageParentDraw != 0?0:1;
  126.          _loc4_ = 0;
  127.          _loc3_ = new Page(gPageClipNames[currentPageParentDraw],gPageClipNames[currentPageParentDraw]);
  128.       }
  129.       _loc2_ = _loc2_ + 1;
  130.    }
  131.    _loc3_.my_mc._visible = false;
  132. }
  133. function applyPageNumbersToContents()
  134. {
  135.    var _loc1_ = 0;
  136.    while(_loc1_ < gCategories.length)
  137.    {
  138.       gCategories[_loc1_].my_mc.page_txt.text = gCategories[_loc1_].pageNum;
  139.       gCategories[_loc1_].my_mc.mID = gCategories[_loc1_].pageNum;
  140.       _loc1_ = _loc1_ + 1;
  141.    }
  142. }
  143. function hideAllPages()
  144. {
  145.    var _loc1_ = 0;
  146.    while(_loc1_ < gPages.length)
  147.    {
  148.       gPages[_loc1_].setVisible(false);
  149.       _loc1_ = _loc1_ + 1;
  150.    }
  151. }
  152. function showPageAndPair(pageNum)
  153. {
  154.    gCurrentPage = pageNum;
  155.    hideAllPages();
  156.    if(pageNum % 2 == 0)
  157.    {
  158.       gPages[pageNum].setVisible(true);
  159.       gPages[pageNum + 1].setVisible(true);
  160.    }
  161.    else
  162.    {
  163.       gPages[pageNum - 1].setVisible(true);
  164.       gPages[pageNum].setVisible(true);
  165.    }
  166.    if(pageNum % 2 != 0)
  167.    {
  168.       pageNum = pageNum - 1;
  169.    }
  170.    displayExtraContent();
  171.    if(gCurrentPage < 2)
  172.    {
  173.       prev_btn._visible = false;
  174.       prev2_btn._visible = false;
  175.    }
  176.    else
  177.    {
  178.       prev_btn._visible = true;
  179.       prev2_btn._visible = true;
  180.    }
  181.    trace("showPageAndPair()" + pageNum + "," + (gPages.length - 2));
  182.    if(gCurrentPage >= gPages.length - 2)
  183.    {
  184.       next_btn._visible = false;
  185.       next2_btn._visible = false;
  186.    }
  187.    else
  188.    {
  189.       next_btn._visible = true;
  190.       next2_btn._visible = true;
  191.    }
  192. }
  193. function displayExtraContent()
  194. {
  195.    infold_mc._visible = gCurrentPage == 0 || gCurrentPage == 1;
  196.    faces_mc._visible = gCurrentPage == 12 || gCurrentPage == 13;
  197.    page2_ornament._visible = gCurrentPage == 10 || gCurrentPage == 11;
  198.    colorforms_mc._visible = gCurrentPage == 12 || gCurrentPage == 13;
  199. }
  200. function nextButtonPressed()
  201. {
  202.    pageTurn_sound.start();
  203.    gCurrentPage = gCurrentPage + 2;
  204.    if(gCurrentPage > gPages.length)
  205.    {
  206.       gCurrentPage = gCurrentPage - 1;
  207.    }
  208.    if(gCurrentPage > gPages.length)
  209.    {
  210.       gCurrentPage = gCurrentPage - 1;
  211.    }
  212.    trace("nextButtonPressed(): " + gCurrentPage);
  213.    showPageAndPair(gCurrentPage);
  214. }
  215. function prevButtonPressed()
  216. {
  217.    pageTurn_sound.start();
  218.    gCurrentPage = gCurrentPage - 2;
  219.    if(gCurrentPage < 0)
  220.    {
  221.       gCurrentPage = 0;
  222.    }
  223.    trace("prevButtonPressed(): " + gCurrentPage);
  224.    showPageAndPair(gCurrentPage);
  225. }
  226. function categoryButtonPressed()
  227. {
  228.    trace("categoryButtonPressed(): " + this._parent.mID);
  229.    if(this._parent.mID % 2 == 0)
  230.    {
  231.       showPageAndPair(this._parent.mID);
  232.    }
  233.    else
  234.    {
  235.       showPageAndPair(this._parent.mID - 1);
  236.    }
  237.    pageTurn_sound.start();
  238. }
  239. function Category(categoryName)
  240. {
  241.    this.categoryName = categoryName;
  242.    this.pageNum = 0;
  243.    this.questions = new Array();
  244.    this.mID = gCategories.length;
  245.    this.startPageNum;
  246.    gCategories.push(this);
  247.    return this;
  248. }
  249. function Question(questionText, answerText)
  250. {
  251.    this.questionText = questionText;
  252.    this.answerText = answerText;
  253.    return this;
  254. }
  255. function Page(sideName, sideClip)
  256. {
  257.    this.sideName = sideName;
  258.    this.sideClip = sideClip;
  259.    this.depthCounter = 0;
  260.    this.my_mc = sideClip.attachMovie("empty_mc","empty_mc" + gPageDepthCounter,gPageDepthCounter++);
  261.    trace("Page(): " + sideClip._name + " " + this.my_mc._name);
  262.    trace("Page() creating: " + gPages.length);
  263.    if(gPages.length != 0)
  264.    {
  265.       this.depthCounter = this.depthCounter + 1;
  266.       var _loc2_ = this.my_mc.attachMovie("pageNumber_mc","pageNumber_mc" + this.depthCounter,this.depthCounter);
  267.       _loc2_.text_txt.text = "-" + gPages.length + "-";
  268.       _loc2_._x = sideClip.wBound / 2 - _loc2_.text_txt.textWidth / 2;
  269.       _loc2_._y = sideClip.hBound - _loc2_.text_txt.textHeight;
  270.    }
  271.    gPages.push(this);
  272.    return this;
  273. }
  274. function resetDepths()
  275. {
  276.    trace("resetting: " + cf.clips.length);
  277.    var _loc1_ = 0;
  278.    while(_loc1_ < cf.clips.length)
  279.    {
  280.       cf.clips[_loc1_].swapDepths(_loc1_);
  281.       _loc1_ = _loc1_ + 1;
  282.    }
  283.    _loc1_ = 0;
  284.    while(_loc1_ < cf.clips.length)
  285.    {
  286.       trace(cf.clips[_loc1_]._name + ":" + cf.clips[_loc1_].getDepth());
  287.       _loc1_ = _loc1_ + 1;
  288.    }
  289. }
  290. function promoteMe(clip_mc)
  291. {
  292.    trace("promoting: " + clip_mc._name);
  293.    var _loc1_ = 0;
  294.    while(_loc1_ < cf.clips.length)
  295.    {
  296.       if(clip_mc == cf.clips[_loc1_])
  297.       {
  298.          cf.clips.splice(_loc1_,1);
  299.          cf.clips.push(clip_mc);
  300.          break;
  301.       }
  302.       _loc1_ = _loc1_ + 1;
  303.    }
  304.    resetDepths();
  305. }
  306. function rotateCF(dir)
  307. {
  308.    if(!cf._visible)
  309.    {
  310.       return undefined;
  311.    }
  312.    clips[clips.length - 1]._rotation = clips[clips.length - 1]._rotation + 10 * dir;
  313. }
  314. function scaleCF(dir)
  315. {
  316.    if(!cf._visible)
  317.    {
  318.       return undefined;
  319.    }
  320.    if(!Key.isDown(17))
  321.    {
  322.       clips[clips.length - 1]._xscale = clips[clips.length - 1]._xscale + 5 * dir;
  323.    }
  324.    if(!Key.isDown(16))
  325.    {
  326.       clips[clips.length - 1]._yscale = clips[clips.length - 1]._yscale + 5 * dir;
  327.    }
  328. }
  329. var gCurrentPage;
  330. var gAttachDepthCounter;
  331. var gPageDepthCounter;
  332. var SPACE_BETWEEN_ITEMS = 2;
  333. var gListItems = new Array();
  334. var gCategories = new Array();
  335. var gPages = new Array();
  336. var gPageClipNames = new Array(pageLeft_mc,pageRight_mc);
  337. Category.prototype.addQuestion = function(questionText, answerText)
  338. {
  339.    trace("addQuestion(): called " + this.categoryName);
  340.    this.questions.push(new Question(questionText,answerText));
  341. };
  342. Page.prototype.setVisible = function(setValue)
  343. {
  344.    this.my_mc._visible = setValue;
  345. };
  346. trace("faq_list.as included");
  347. var toons = new Category("Cartoons & SB Emails");
  348. toons.addQuestion("Are the emails Strong Bad answers real?","Yes, all of em. Except \'Mile.\' The Cheat made that one up.");
  349. toons.addQuestion("How do I get my Strong Bad email answered?","Pure luck. (Or try renting \'Pure Luck\' with Danny Glover and Martin Short.)");
  350. toons.addQuestion("Is there gonna be a full-length Peasant\'s Quest movie or what?","There already is one. Its \'full length\' is 3 minutes.");
  351. toons.addQuestion("Where are all the old emails and cartoons?","Try the museum section. Just click on the H*R logo on any of the homepages. If you can\'t find a Strong Bad email, just use the sweet, sweet scroll buttons on the email menu to scroll down. Most of the emails mentioned in \'personal favorites\' were made up, so don\'t look for those so much.");
  352. toons.addQuestion("I noticed a mistake or inconsistency in one of your cartoons!! AHHH!","It was either done on purpose or it\'s just a cartoon and you probably shouldn\'t worry about it.");
  353. toons.addQuestion("What the crap is \'fhqwhgads\' from?","It\'s from the Strong Bad email called \'i love you\'. The Cheat also made a music video bout it. Check out the Powered by the Cheat section for that.");
  354. toons.addQuestion("Where are Jumping Jacks and the wrestling one?","They were taken down temporarily. Much like Frosty, they\'ll be back again someday.");
  355. toons.addQuestion("Why come the \'Joy of Painting\' cartoon on the Toons menu don\'t work?","Cause it\'s not a real cartoon. We just wanted to show Marzipan with an afro and a beard.");
  356. var games = new Category("Video Games of Distinction");
  357. games.addQuestion("There is a bug in the Games menu. My score never goes up.","The Games menu is a menu, not a real game. Try clicking on one of the ships to play a real game, some of which have working scoring systems.");
  358. games.addQuestion("I am stuck in Peasant\'s Quest or Thy Dungeonman. Help!","Maybe search the web for walkthroughs or hints. That\'s what we do.");
  359. games.addQuestion("Super Kingio Bros. is too hard. I can\'t even clear the first jump.","Keep trying. You might want to buy the Stragedy Guide.");
  360. games.addQuestion("Where can I buy the Super Kingio Bros. \'Stragedy Guide?\'","Keep trying. You might want to buy the Stragedy Guide strategy guide.");
  361. games.addQuestion("No seriously, what is the deal with Super Kingio Bros?","Okay you caught us. It was meant as a joke and you can\'t play it beyond the first screen. You get the persistence prize.");
  362. games.addQuestion("Level 27 of Trogdor: Intentionally unbeatable?","Non. Just broken. We fixed it just for you.");
  363. var products = new Category("Products");
  364. products.addQuestion("Will there be more DVDs? Like, ones with other cartoons on em?","Yeah! Totally. Totally yeah.");
  365. products.addQuestion("Are them puppets fer sale?","Nossir, they\'s one of kind.");
  366. products.addQuestion("I have questions about an order I placed or want to place. Who I talk to?","Head on over to store.yahoo.com/homestarrunner and click on \'Customer Service.\'");
  367. products.addQuestion("So wait, you guys make a living just by selling this crap?","Yup. Merch sales are fortunately enough to support ourselves and the site. Rock, rock on.");
  368. var tech = new Category("Tech support");
  369. tech.addQuestion("Who does your hosting?","The fine folks at Caro.net. They set us up real nice.");
  370. tech.addQuestion("Some cartoons or games won\'t load on my \'puter! What gives?","Make sure you have the latest version of the Flash player from Adobe.com. That usually helps.");
  371. tech.addQuestion("Your updates don\'t show up and I cleared my cache and hit refresh even!","Your internet provider might need to refresh their DNS or something like that. Leastways, that\'s what we been told.");
  372. tech.addQuestion("You dudes use Windas or Mac?","We use Windows machines except for video and DVD stuff. That\'s done on a Mac.");
  373. tech.addQuestion("Who does the voices for your dumb animal characters?","Matt does all the voices \'cept Marzipan, that\'s Missy. Mike does the voices when the Cheat makes his own cartoons.");
  374. tech.addQuestion("How do you make your cartoons? Like what software and hardware?","We draw and animate everything in Flash. We run a mic through a USB preamp and record sound in Adobe Audition (formerly Cool Edit Pro). Most of the music we make with old Casio keyboards or worse.");
  375. tech.addQuestion("I need help making my own Flash cartoons. Any advice?","Flashkit.com is a good resource for Flash help. Also, the \'Visual Quickstart Guide\' series of books on Flash are great.");
  376. tech.addQuestion("Will you link to my website?","There\'s no real place for that sorta thing on our website. We link to a couple sites here and there but only when it\'s appropriate.");
  377. tech.addQuestion("Can I hire you guys to make a special cartoon for me?","Homestar keeps us busy enough that we don\'t have time for freelance or personalized stuff. Thanks for thinking of us though.");
  378. var activity = new Category("Activity");
  379. var cf = colorforms_mc;
  380. cf.lastGuy = cf.cf1;
  381. cf.clips = new Array();
  382. var i = 0;
  383. while(i < 8)
  384. {
  385.    var clips = cf.clips;
  386.    var orig = cf["cf" + (i + 1)];
  387.    clips.push(orig.duplicateMovieClip("cf" + i + "real",i));
  388.    trace(i + "," + orig._name + "," + clips[i]._name);
  389.    clips[i]._x = orig._x;
  390.    clips[i]._y = orig._y;
  391.    clips[i]._yscale = orig._yscale;
  392.    clips[i]._xscale = orig._xscale;
  393.    clips[i]._rotation = orig._rotation;
  394.    orig._visible = false;
  395.    clips[i].onPress = function()
  396.    {
  397.       this.startDrag(false);
  398.       this.origX = this._x;
  399.       this.origY = this._y;
  400.       this._parent._parent.promoteMe(this);
  401.    };
  402.    clips[i].onRelease = clips[i].onReleaseOutside = function()
  403.    {
  404.       stopDrag();
  405.       var _loc2_ = new Object({x:this._x,y:this._y});
  406.       this._parent.localToGlobal(_loc2_);
  407.       if(_loc2_.x > 550 || _loc2_.y > 400 || _loc2_.x < 0 || _loc2_.y < 0)
  408.       {
  409.          this._x = this.origX;
  410.          this._y = this.origY;
  411.       }
  412.    };
  413.    i++;
  414. }
  415. init();
  416. stop();
  417.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement