home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 136 / MOBICLIC136.ISO / pc / DATA / HOTE / prod_gen_JLM / moteur.swf / scripts / __Packages / prod / moteur / V014_GereTextes.as < prev   
Text File  |  2011-07-20  |  22KB  |  673 lines

  1. class prod.moteur.V014_GereTextes
  2. {
  3.    function V014_GereTextes(movieRoot, moduleInfo)
  4.    {
  5.       this.movieRoot = movieRoot;
  6.       this.moduleInfo = moduleInfo;
  7.       this.policeBase = "";
  8.       this.positionIB = 0;
  9.       this.gFmtBase = new TextFormat();
  10.       this.gListeLMTemp = new Array();
  11.    }
  12.    function getTextById(myXML, attributeValue)
  13.    {
  14.       this.myStyle = undefined;
  15.       this.myText = undefined;
  16.       this.myText = this.recusiveGetTextByAttribute(myXML,"id",attributeValue);
  17.       if(this.myText == undefined)
  18.       {
  19.          trace(attributeValue + " n\'existe pas dans XML");
  20.       }
  21.       return this.myText;
  22.    }
  23.    function recusiveGetTextByAttribute(node, attribute, attributeValue)
  24.    {
  25.       var _loc2_ = 0;
  26.       while(_loc2_ < node.childNodes.length)
  27.       {
  28.          if(node.childNodes[_loc2_].attributes[attribute] == attributeValue)
  29.          {
  30.             this.myText = node.childNodes[_loc2_].firstChild.nodeValue;
  31.             if(node.childNodes[_loc2_].attributes.style !== undefined)
  32.             {
  33.                this.myStyle = node.childNodes[_loc2_].attributes.style;
  34.             }
  35.             break;
  36.          }
  37.          if(node.childNodes[_loc2_].hasChildNodes())
  38.          {
  39.             this.recusiveGetTextByAttribute(node.childNodes[_loc2_],attribute,attributeValue);
  40.          }
  41.          _loc2_ = _loc2_ + 1;
  42.       }
  43.       return this.myText;
  44.    }
  45.    function appliqueStyle(myNodeName, myValue, lBoldItalic, myClipText, myClipFond)
  46.    {
  47.       switch(myNodeName)
  48.       {
  49.          case "police":
  50.             this.policeBase = String(myValue);
  51.             break;
  52.          case "bold":
  53.             lBoldItalic = String(myValue) + lBoldItalic.charAt(1);
  54.             break;
  55.          case "italic":
  56.             lBoldItalic = lBoldItalic.charAt(0) + String(myValue);
  57.             break;
  58.          case "corps":
  59.             this.gFmtBase.size = Number(myValue);
  60.             break;
  61.          case "justify":
  62.             this.gFmtBase.align = String(myValue);
  63.             myClipText.autoSize = String(myValue);
  64.             break;
  65.          case "underline":
  66.             if(Number(myValue) == 1)
  67.             {
  68.                this.gFmtBase.underline = true;
  69.             }
  70.             else
  71.             {
  72.                this.gFmtBase.underline = false;
  73.             }
  74.             break;
  75.          case "couleurT":
  76.             myClipText.textColor = String(myValue);
  77.             break;
  78.          case "couleurF":
  79.             var _loc6_ = new Color(myClipFond);
  80.             _loc6_.setRGB(Number(myValue));
  81.             break;
  82.          case "couleurRollT":
  83.             myClipText._parent._parent.couleurRollT = String(myValue);
  84.             break;
  85.          case "couleurRollF":
  86.             myClipText._parent._parent.couleurRollF = String(myValue);
  87.             break;
  88.          case "opaciteF":
  89.             myClipFond._alpha = Number(myValue);
  90.             break;
  91.          case "position":
  92.             this.positionIB = Number(myValue);
  93.             break;
  94.          case "action":
  95.             var _loc7_ = myClipText._parent._parent;
  96.             this.movieRoot.myValue(_loc7_);
  97.             break;
  98.          case "lien":
  99.             if(Number(myValue) !== 0)
  100.             {
  101.                myClipFond.onRollOver = function()
  102.                {
  103.                   myClipText.textColor = String("0x6633FF");
  104.                   _global.gereCursor(2);
  105.                };
  106.                myClipFond.onRollOut = function()
  107.                {
  108.                   myClipText.textColor = String("0x0000FF");
  109.                   _global.gereCursor(1);
  110.                };
  111.                myClipFond.onPress = function()
  112.                {
  113.                   _global.gereCursor(1);
  114.                };
  115.                break;
  116.             }
  117.       }
  118.       return lBoldItalic;
  119.    }
  120.    function attribueStyle(myXmlStyle, myID, myClipText, myClipFond, myType, myTextRepere)
  121.    {
  122.       var _loc19_ = 0;
  123.       this.gFmtBase = new TextFormat();
  124.       var _loc8_ = new XML();
  125.       var _loc6_ = "00";
  126.       var _loc2_ = 0;
  127.       while(_loc2_ < myXmlStyle.childNodes.length)
  128.       {
  129.          if(myXmlStyle.childNodes[_loc2_].attributes.id == myType)
  130.          {
  131.             var _loc7_ = 0;
  132.             while(_loc7_ < myXmlStyle.childNodes[_loc2_].childNodes.length)
  133.             {
  134.                var _loc5_ = myXmlStyle.childNodes[_loc2_].childNodes[_loc7_].nodeName;
  135.                var _loc4_ = myXmlStyle.childNodes[_loc2_].childNodes[_loc7_].firstChild.nodeValue;
  136.                _loc6_ = this.appliqueStyle(_loc5_,_loc4_,_loc6_,myClipText,myClipFond);
  137.                _loc7_ = _loc7_ + 1;
  138.             }
  139.          }
  140.          else
  141.          {
  142.             if(myXmlStyle.childNodes[_loc2_].attributes.id == myID)
  143.             {
  144.                _loc8_ = myXmlStyle.childNodes[_loc2_];
  145.                break;
  146.             }
  147.             if(myXmlStyle.childNodes[_loc2_].attributes.id == this.myStyle)
  148.             {
  149.                _loc8_ = myXmlStyle.childNodes[_loc2_];
  150.                break;
  151.             }
  152.          }
  153.          _loc2_ = _loc2_ + 1;
  154.       }
  155.       if(_loc8_.childNodes.length !== 0)
  156.       {
  157.          _loc7_ = 0;
  158.          while(_loc7_ < _loc8_.childNodes.length)
  159.          {
  160.             _loc5_ = _loc8_.childNodes[_loc7_].nodeName;
  161.             _loc4_ = _loc8_.childNodes[_loc7_].firstChild.nodeValue;
  162.             _loc6_ = this.appliqueStyle(_loc5_,_loc4_,_loc6_,myClipText,myClipFond);
  163.             _loc7_ = _loc7_ + 1;
  164.          }
  165.       }
  166.       switch(_loc6_)
  167.       {
  168.          case "00":
  169.             this.policeBase += "_p";
  170.             break;
  171.          case "10":
  172.             this.policeBase += "_b";
  173.             break;
  174.          case "11":
  175.             this.policeBase += "_bi";
  176.             break;
  177.          case "01":
  178.             this.policeBase += "_i";
  179.       }
  180.       if(myClipFond !== undefined)
  181.       {
  182.          this.gFmtBase.font = this.policeBase;
  183.          myClipText.embedFonts = 1;
  184.       }
  185.       var _loc12_ = "";
  186.       var _loc9_ = this.myText.split("┬º")[0];
  187.       if(_loc9_ == this.myText)
  188.       {
  189.          myClipText.text = this.myText;
  190.       }
  191.       else
  192.       {
  193.          _loc2_ = 0;
  194.          while(_loc9_ != undefined)
  195.          {
  196.             _loc9_ = this.myText.split("┬º")[_loc2_];
  197.             if(_loc9_ != undefined)
  198.             {
  199.                _loc12_ = _loc12_ + _loc9_ + "\n";
  200.             }
  201.             _loc2_ = _loc2_ + 1;
  202.          }
  203.          myClipText.text = _loc12_;
  204.          if(myTextRepere !== undefined)
  205.          {
  206.             var _loc17_ = myTextRepere.getTextFormat();
  207.             this.gFmtBase.leading = _loc17_.leading;
  208.          }
  209.       }
  210.       if(myClipText.Leading != undefined)
  211.       {
  212.          this.gFmtBase.leading = myClipText.Leading;
  213.       }
  214.       myClipText.setTextFormat(this.gFmtBase);
  215.       var _loc16_ = myClipText._parent._parent._parent;
  216.       _loc16_.createTextField("texte_test_" + myID,this.movieRoot.chercheDepthPlus(_loc16_,0),0,0,50,30);
  217.       var _loc14_ = _loc16_["texte_test_" + myID];
  218.       _loc14_.text = "fog";
  219.       _loc14_.setTextFormat(this.gFmtBase);
  220.       myClipText._parent.lH = _loc14_._height;
  221.       _loc14_.removeTextField();
  222.    }
  223.    function recupFormatTextFla(mcText, mcTextRepere, mcFond)
  224.    {
  225.       var _loc2_ = mcTextRepere.getTextFormat();
  226.       this.gFmtBase = new TextFormat();
  227.       this.gFmtBase.size = _loc2_.size;
  228.       this.gFmtBase.align = _loc2_.align;
  229.       this.gFmtBase.underline = _loc2_.underline;
  230.       this.policeBase = _loc2_.font;
  231.       if(_loc2_.bold == true && _loc2_.italic == true)
  232.       {
  233.          this.policeBase += "_bi";
  234.       }
  235.       else if(_loc2_.bold == false && _loc2_.italic == false)
  236.       {
  237.          this.policeBase += "_p";
  238.       }
  239.       else if(_loc2_.bold == true && _loc2_.italic == false)
  240.       {
  241.          this.policeBase += "_b";
  242.       }
  243.       else
  244.       {
  245.          this.policeBase += "_i";
  246.       }
  247.       this.gFmtBase.font = this.policeBase;
  248.       mcText.embedFonts = true;
  249.       mcText.autoSize = mcTextRepere.autoSize;
  250.       mcText.textColor = mcTextRepere.textColor;
  251.       mcText.setTextFormat(this.gFmtBase);
  252.       mcFond._alpha = 0;
  253.    }
  254.    function afficheST(myST)
  255.    {
  256.       var _loc6_ = this.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesST");
  257.       var _loc7_ = this.moduleInfo.returnNodeByPath("Module." + this.movieRoot.gLangue + ".Sous-Titres");
  258.       this.movieRoot.createEmptyMovieClip("STitres",15900);
  259.       this.movieRoot.STitres.attachMovie("ST","STT_",2);
  260.       var _loc2_ = this.movieRoot.STitres;
  261.       var _loc3_ = _loc2_.STT_.texte;
  262.       var _loc4_ = _loc2_.STT_.fond;
  263.       var _loc5_ = String(myST.split("_").splice(2).join("_"));
  264.       this.myText = "";
  265.       this.myText = this.getTextById(_loc7_,_loc5_);
  266.       this.attribueStyle(_loc6_,_loc5_,_loc3_,_loc4_,"ST");
  267.       _loc2_._x = 140;
  268.       _loc2_._y = 600 - _loc3_.textHeight - 3;
  269.       _loc4_._height = _loc3_.textHeight + 10;
  270.       this.movieRoot.gSousTitre = 1;
  271.    }
  272.    function masqueST()
  273.    {
  274.       removeMovieClip(this.movieRoot.STitres);
  275.       this.movieRoot.gSousTitre = 0;
  276.    }
  277.    function afficheTE(myTE)
  278.    {
  279.       var _loc7_ = this.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesTE");
  280.       var _loc6_ = this.moduleInfo.returnNodeByPath("Module." + this.movieRoot.gLangue + ".Titres");
  281.       this.movieRoot.createEmptyMovieClip("Titres",15050);
  282.       this.movieRoot.Titres.attachMovie("TE","TE",2);
  283.       var _loc3_ = this.movieRoot.Titres;
  284.       var _loc5_ = _loc3_.TE.texte;
  285.       var _loc4_ = _loc3_.TE.fond;
  286.       this.myText = "";
  287.       this.myText = this.getTextById(_loc6_,myTE);
  288.       this.attribueStyle(_loc7_,myTE,_loc5_,_loc4_,"TE");
  289.       _loc3_.TE._x = 400;
  290.       _loc4_._x = 400 - _loc5_.textWidth - 30;
  291.       if(this.movieRoot.substr(0,3) == "TCH")
  292.       {
  293.          this.movieRoot.Titres.onRollOver = function()
  294.          {
  295.             if(this.movieRoot.vocabJeu == 1)
  296.             {
  297.                if(this.movieRoot.dialogue == 0)
  298.                {
  299.                   this.useHandCursor = 1;
  300.                   this.movieRoot.joueSon(_root,"TE",0);
  301.                }
  302.                else
  303.                {
  304.                   this.useHandCursor = 0;
  305.                }
  306.             }
  307.             else
  308.             {
  309.                this.useHandCursor = 0;
  310.             }
  311.          };
  312.          this.movieRoot.Titres.onRollOut = function()
  313.          {
  314.             if(this.movieRoot.vocabJeu == 1)
  315.             {
  316.                if(this.movieRoot.gCommentOn == 1)
  317.                {
  318.                   this.movieRoot.stopSon(this.movieRoot);
  319.                }
  320.             }
  321.          };
  322.       }
  323.    }
  324.    function masqueTE()
  325.    {
  326.       removeMovieClip(this.movieRoot.Titres);
  327.    }
  328.    function afficheLM(p)
  329.    {
  330.       var _loc2_ = p.codeLM;
  331.       if(p.mc == undefined)
  332.       {
  333.          var _loc3_ = this.movieRoot;
  334.       }
  335.       else
  336.       {
  337.          _loc3_ = p.mc;
  338.       }
  339.       if(p.numR !== undefined)
  340.       {
  341.          var _loc15_ = p.numR;
  342.       }
  343.       if(p.X !== undefined)
  344.       {
  345.          var _loc11_ = p.X;
  346.          var _loc10_ = p.Y;
  347.          var _loc8_ = p.width;
  348.          var _loc9_ = p.height;
  349.          var _loc12_ = 1;
  350.       }
  351.       var _loc13_ = this.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesLM");
  352.       var _loc16_ = this.moduleInfo.returnNodeByPath("Module." + this.movieRoot.gLangue + ".LegendesMedias");
  353.       if(_loc3_[_loc2_] == undefined)
  354.       {
  355.          _loc3_.createEmptyMovieClip(_loc2_,this.movieRoot.chercheDepthPlus(_loc3_,0));
  356.          _loc3_[_loc2_].attachMovie("LM","LM",_loc3_[_loc2_].getNextHighestDepth());
  357.          var _loc14_ = _loc3_[_loc2_].LM;
  358.          var _loc6_ = _loc14_.texte;
  359.          var _loc7_ = _loc14_.fond;
  360.          this.myText = "";
  361.          this.myText = this.getTextById(_loc16_,_loc2_);
  362.          if(p.texte_LM != undefined)
  363.          {
  364.             var _loc5_ = _loc3_[p.texte_LM];
  365.          }
  366.          else if(_loc3_["texte_" + _loc2_] == undefined)
  367.          {
  368.             if(_loc2_.split("")[3] == "Q")
  369.             {
  370.                if(_loc2_.split("")[4] !== "I")
  371.                {
  372.                   this.gListeLMTemp.push(_loc3_[_loc2_]);
  373.                   _loc5_ = _loc3_.texte_LMQ;
  374.                }
  375.             }
  376.             if(_loc2_.split("")[3] == "R")
  377.             {
  378.                if(_loc2_.split("")[4] !== "I")
  379.                {
  380.                   this.gListeLMTemp.push(_loc3_[_loc2_]);
  381.                   _loc5_ = _loc3_["texte_LMR" + _loc15_];
  382.                }
  383.             }
  384.             if(_loc2_.split("")[3] == "T")
  385.             {
  386.                this.gListeLMTemp.push(_loc3_[_loc2_]);
  387.                _loc5_ = _loc3_.texte_LMT;
  388.             }
  389.             if(_loc2_.split("")[3] == "C")
  390.             {
  391.                this.gListeLMTemp.push(_loc3_[_loc2_]);
  392.                _loc5_ = _loc3_.texte_LMC;
  393.             }
  394.             if(_loc5_ == undefined)
  395.             {
  396.                trace("la LM " + _loc2_ + " est envoy├⌐e de director ou de flash avec des coordonnees et dimensions");
  397.                _loc3_.createTextField("texte_" + _loc2_,this.movieRoot.chercheDepthPlus(_loc3_,0),_loc11_,_loc10_,_loc8_,_loc9_);
  398.                _loc5_ = _loc3_["texte_" + _loc2_];
  399.                _loc5_.text = this.myText;
  400.                this.attribueStyle(_loc13_,_loc2_,_loc5_,undefined,"LM",undefined);
  401.                _loc5_._x = _loc11_;
  402.                _loc5_._y = _loc10_;
  403.                _loc5_._width = _loc8_;
  404.             }
  405.          }
  406.          else
  407.          {
  408.             _loc5_ = _loc3_["texte_" + _loc2_];
  409.          }
  410.          _loc6_.Leading = p.leading;
  411.          if(p.use_TXT_FLA == undefined)
  412.          {
  413.             this.attribueStyle(_loc13_,_loc2_,_loc6_,_loc7_,"LM",_loc5_);
  414.          }
  415.          else
  416.          {
  417.             this.recupFormatTextFla(_loc6_,_loc5_,_loc7_);
  418.          }
  419.          if(_loc12_ == undefined)
  420.          {
  421.             _loc3_[_loc2_]._x = _loc5_._x;
  422.             _loc3_[_loc2_]._y = _loc5_._y;
  423.             _loc6_._width = _loc5_._width;
  424.             _loc6_._height = _loc5_._height;
  425.             _loc7_._width = _loc5_._width;
  426.             _loc7_._height = _loc5_._height;
  427.          }
  428.          else
  429.          {
  430.             _loc3_[_loc2_]._x = _loc11_;
  431.             _loc3_[_loc2_]._y = _loc10_;
  432.             _loc6_._width = _loc8_;
  433.             _loc7_._width = _loc8_;
  434.             if(_loc6_._height > _loc9_)
  435.             {
  436.                _loc7_._height = _loc6_._height;
  437.             }
  438.             else
  439.             {
  440.                _loc7_._height = _loc9_;
  441.             }
  442.          }
  443.          _loc5_._visible = 0;
  444.          _loc12_ = undefined;
  445.       }
  446.    }
  447.    function masqueLM(p)
  448.    {
  449.       var _loc3_ = p.codeLM;
  450.       if(p.mc == undefined)
  451.       {
  452.          var _loc2_ = this.movieRoot;
  453.       }
  454.       else
  455.       {
  456.          _loc2_ = p.mc;
  457.       }
  458.       removeMovieClip(_loc2_[_loc3_]);
  459.    }
  460.    function videLM()
  461.    {
  462.       if(this.gListeLMTemp.length !== 0)
  463.       {
  464.          var _loc2_ = 0;
  465.          while(_loc2_ < this.gListeLMTemp.length)
  466.          {
  467.             removeMovieClip(this.gListeLMTemp[_loc2_]);
  468.             _loc2_ = _loc2_ + 1;
  469.          }
  470.       }
  471.       this.gListeLMTemp = new Array();
  472.    }
  473.    function init_gListeLM(my_array)
  474.    {
  475.       this.gListeLMTemp = my_array;
  476.    }
  477.    function afficheIB(p)
  478.    {
  479.       var _loc5_ = p.codeIB;
  480.       if(p.mc !== undefined)
  481.       {
  482.          var _loc8_ = p.mc;
  483.       }
  484.       else if(p.X !== undefined)
  485.       {
  486.          var _loc7_ = p.X;
  487.          var _loc11_ = p.Y;
  488.       }
  489.       else
  490.       {
  491.          trace("le positionnement de l\'IB " + _loc5_ + " necessite soit un clip de reference, soit une position x et y");
  492.       }
  493.       var _loc10_ = this.moduleInfo.returnNodeByPath("Module.StylesTextes.StylesIB");
  494.       var _loc9_ = this.moduleInfo.returnNodeByPath("Module." + this.movieRoot.gLangue + ".InfoBulles");
  495.       this.movieRoot.createEmptyMovieClip("IB",this.movieRoot.getNextHighestDepth());
  496.       this.movieRoot.IB.attachMovie("IB","IB",4);
  497.       var _loc3_ = this.movieRoot.IB;
  498.       var _loc6_ = _loc3_.IB.texte;
  499.       var _loc2_ = _loc3_.IB.fond;
  500.       this.myText = "";
  501.       this.myText = this.getTextById(_loc9_,_loc5_);
  502.       this.attribueStyle(_loc10_,_loc5_,_loc6_,_loc2_,"IB");
  503.       _loc2_._width = _loc6_.textWidth + 10;
  504.       _loc2_._height = _loc6_.textHeight + 10;
  505.       _loc2_._x = -2.5;
  506.       _loc2_._y = -2.5;
  507.       if(_loc7_ == undefined)
  508.       {
  509.          this.placeIB(_loc8_,_loc3_,_loc2_);
  510.       }
  511.       else
  512.       {
  513.          _loc3_._x = _loc7_;
  514.          _loc3_._y = _loc11_;
  515.       }
  516.    }
  517.    function masqueIB()
  518.    {
  519.       removeMovieClip(this.movieRoot.IB);
  520.    }
  521.    function placeIB(mcReference, myClip, myClipFond)
  522.    {
  523.       var _loc13_ = mcReference.getBounds(mcReference);
  524.       var _loc5_ = mcReference._width;
  525.       var _loc8_ = mcReference._height;
  526.       var _loc12_ = {x:0,y:0};
  527.       _loc12_ = this.movieRoot.ConvertCoord(mcReference,this.movieRoot);
  528.       var _loc6_ = _loc12_.x;
  529.       var _loc9_ = _loc12_.x + mcReference._width;
  530.       var _loc7_ = _loc12_.y;
  531.       var _loc11_ = _loc12_.y + mcReference._height;
  532.       var _loc4_ = (_loc5_ / 2 + _loc8_ / 2) / 3;
  533.       switch(this.positionIB)
  534.       {
  535.          case 0:
  536.             myClip._x = _loc5_ / 2 + _loc6_ - myClipFond._width / 2;
  537.             myClip._y = _loc8_ / 2 + _loc7_ - myClipFond._height / 2;
  538.             break;
  539.          case 1:
  540.             if(_loc4_ >= _loc5_ / 2)
  541.             {
  542.                myClip._x = _loc9_;
  543.                myClip._y = _loc8_ / 2 + _loc7_ - _loc4_ * 2 - myClipFond._height / 2;
  544.             }
  545.             else
  546.             {
  547.                myClip._x = _loc5_ / 2 + _loc6_ + _loc4_;
  548.                myClip._y = _loc7_ - myClipFond._height / 2;
  549.             }
  550.             break;
  551.          case 2:
  552.             if(_loc4_ * 2 >= _loc5_ / 2)
  553.             {
  554.                myClip._x = _loc9_;
  555.                myClip._y = _loc8_ / 2 + _loc7_ - _loc4_ - myClipFond._height / 2;
  556.             }
  557.             else
  558.             {
  559.                myClip._x = _loc5_ / 2 + _loc6_ + _loc4_ * 2;
  560.                myClip._y = _loc7_ - myClipFond._height / 2;
  561.             }
  562.             break;
  563.          case 3:
  564.             myClip._x = _loc9_;
  565.             myClip._y = _loc8_ / 2 + _loc7_ - myClipFond._height / 2;
  566.             break;
  567.          case 4:
  568.             if(_loc4_ * 2 >= _loc5_ / 2)
  569.             {
  570.                myClip._x = _loc9_;
  571.                myClip._y = _loc8_ / 2 + _loc7_ + _loc4_ - myClipFond._height / 2;
  572.             }
  573.             else
  574.             {
  575.                myClip._x = _loc5_ / 2 + _loc6_ + _loc4_ * 2;
  576.                myClip._y = _loc11_;
  577.             }
  578.             break;
  579.          case 5:
  580.             if(_loc4_ >= _loc5_ / 2)
  581.             {
  582.                myClip._x = _loc9_;
  583.                myClip._y = _loc8_ / 2 + _loc7_ + _loc4_ * 2 - myClipFond._height / 2;
  584.             }
  585.             else
  586.             {
  587.                myClip._x = _loc5_ / 2 + _loc6_ + _loc4_;
  588.                myClip._y = _loc11_;
  589.             }
  590.             break;
  591.          case 6:
  592.             myClip._x = _loc5_ / 2 + _loc6_ - myClipFond._width / 2;
  593.             myClip._y = _loc11_;
  594.             break;
  595.          case 7:
  596.             if(_loc4_ >= _loc5_ / 2)
  597.             {
  598.                myClip._x = _loc6_ - myClipFond._width;
  599.                myClip._y = _loc8_ / 2 + _loc7_ + _loc4_ * 2 - myClipFond._height / 2;
  600.             }
  601.             else
  602.             {
  603.                myClip._x = _loc5_ / 2 + _loc6_ - _loc4_ - myClipFond._width;
  604.                myClip._y = _loc11_;
  605.             }
  606.             break;
  607.          case 8:
  608.             if(_loc4_ * 2 >= _loc5_ / 2)
  609.             {
  610.                myClip._x = _loc6_ - myClipFond._width;
  611.                myClip._y = _loc8_ / 2 + _loc7_ + _loc4_ - myClipFond._height / 2;
  612.             }
  613.             else
  614.             {
  615.                myClip._x = _loc5_ / 2 + _loc6_ - _loc4_ * 2 - myClipFond._width;
  616.                myClip._y = _loc11_;
  617.             }
  618.             break;
  619.          case 9:
  620.             myClip._x = _loc6_ - myClipFond._width;
  621.             myClip._y = _loc8_ / 2 + _loc7_ - myClipFond._height / 2;
  622.             break;
  623.          case 10:
  624.             if(_loc4_ * 2 >= _loc5_ / 2)
  625.             {
  626.                myClip._x = _loc6_ - myClipFond._width;
  627.                myClip._y = _loc8_ / 2 + _loc7_ - _loc4_ - myClipFond._height / 2;
  628.             }
  629.             else
  630.             {
  631.                myClip._x = _loc5_ / 2 + _loc6_ - _loc4_ * 2 - myClipFond._width;
  632.                myClip._y = _loc7_ - myClipFond._height / 2;
  633.             }
  634.             break;
  635.          case 11:
  636.             if(_loc4_ >= _loc5_ / 2)
  637.             {
  638.                myClip._x = _loc6_ - myClipFond._width;
  639.                myClip._y = _loc8_ / 2 + _loc7_ - _loc4_ * 2 - myClipFond._height;
  640.             }
  641.             else
  642.             {
  643.                myClip._x = _loc5_ / 2 + _loc6_ - _loc4_;
  644.                myClip._y = _loc7_ - myClipFond._height / 2;
  645.             }
  646.             break;
  647.          case 12:
  648.             myClip._x = _loc5_ / 2 + _loc6_ - myClipFond._width / 2;
  649.             myClip._y = _loc7_ - myClipFond._height;
  650.             break;
  651.          case 13:
  652.             myClip._x = _xmouse;
  653.             myClip._y = _ymouse;
  654.       }
  655.       if(myClip._x < 10)
  656.       {
  657.          myClip._x = 10;
  658.       }
  659.       else if(myClip._x > 800 - myClipFond._width)
  660.       {
  661.          myClip._x = 800 - myClipFond._width;
  662.       }
  663.       if(myClip._y < 10)
  664.       {
  665.          myClip._y = 10;
  666.       }
  667.       else if(myClip._y > 600 - myClipFond._height)
  668.       {
  669.          myClip._y = 600 - myClipFond._height;
  670.       }
  671.    }
  672. }
  673.