home *** CD-ROM | disk | FTP | other *** search
/ Dermatology Step by Step / Dermatology Step by Step.iso / pc / Media / Dermatology / AlgorithmInf.swf / scripts / frame_1 / DoAction.as < prev   
Encoding:
Text File  |  2001-02-15  |  1.4 KB  |  58 lines

  1. function maxChar(str, nbC)
  2. {
  3.    return nbC < str.length ? str.substr(0,nbC - 2) + "..." : str;
  4. }
  5. function displayDialog()
  6. {
  7.    if(_level0.algorithmInf.myMoviePath == "help")
  8.    {
  9.       _root.gotoAndPlay("infoHelp");
  10.       _root._visible = true;
  11.    }
  12.    else
  13.    {
  14.       myData.targetFrame = _level0.algorithmInf.myFrame;
  15.       myData.moviePath = _level0.algorithmInf.myMoviePath;
  16.       myData.loadVariables(_level0.algorithmInf.myDataFile);
  17.       _level0.algorithmInf.myCaller.freeze();
  18.    }
  19. }
  20. function doClose()
  21. {
  22.    _root.unloadMovie();
  23.    _level0.algorithmInf.myCaller.unfreeze();
  24. }
  25. function getPictures()
  26. {
  27.    myPicture = [];
  28.    var n = 1;
  29.    var file = myData["pict_" + n];
  30.    var path = myData.moviePath;
  31.    while(0 < file.length)
  32.    {
  33.       myPicture.push(path + file);
  34.       n++;
  35.       file = myData["pict_" + n];
  36.    }
  37.    _root.mc_btnMorePictures._visible = 2 < myPicture.length;
  38.    if(myPicture.length == 0 && myData.targetFrame == "infoQ")
  39.    {
  40.       myData.targetFrame = "infoQS";
  41.    }
  42. }
  43. function showPictures(pairNo)
  44. {
  45.    var pict1 = myPicture[Number(pairNo * 2 - 2)];
  46.    var pict2 = myPicture[Number(pairNo * 2 - 1)];
  47.    if(0 < pict1.length)
  48.    {
  49.       mc_pict1.display.loadMovie(pict1,mc_pict1.display);
  50.    }
  51.    if(0 < pict1.length)
  52.    {
  53.       mc_pict2.display.loadMovie(pict2,mc_pict2.display);
  54.    }
  55.    mc_pict1._visible = 0 < pict1.length;
  56.    mc_pict2._visible = 0 < pict2.length;
  57. }
  58.