home *** CD-ROM | disk | FTP | other *** search
/ Click Press Kit / Click Press Kit.iso / pc / main.dxr / Internal_103_saved2FrameCode.ls < prev    next >
Encoding:
Text File  |  2006-05-31  |  5.6 KB  |  148 lines

  1. property pLeftArrowSprite, pPageSprite, pRightArrowSprite
  2. global gMaster, gSound, gTracker
  3.  
  4. on prepareFrame me
  5.   hideFlashDialog()
  6.   hideQuitDialog()
  7.   mResetRedRects(me)
  8.   mResetPushPins(me)
  9.   pLeftArrowSprite = 22
  10.   pPageSprite = 23
  11.   pRightArrowSprite = 24
  12. end
  13.  
  14. on enterFrame me
  15.   gMaster.pmarker = the frameLabel
  16.   gTracker.mAddSection(gMaster.pmarker)
  17.   sendAllSprites(#mSetUpGraphics)
  18. end
  19.  
  20. on exitFrame me
  21.   cursor(-1)
  22.   gSound.mResumeSound()
  23.   gMaster.pmarker = the frameLabel
  24.   gMaster.pSavedCount = value(gMaster.pmarker.char[5])
  25.   if gMaster.pSummaryList[gMaster.pSummaryList.count].pPage > 1 then
  26.     sprite(pLeftArrowSprite).visible = 1
  27.     sprite(pPageSprite).visible = 1
  28.     sprite(pRightArrowSprite).visible = 1
  29.     if gMaster.pSavedCount = 0 then
  30.       gMaster.pSavedCount = 1
  31.     end if
  32.     vSavedCount = gMaster.pSummaryList[gMaster.pSummaryList.count].pPage
  33.     vText = "Page " & gMaster.pSavedCount & " of " & vSavedCount
  34.     member("Page", "assets").text = vText
  35.   else
  36.     sprite(pLeftArrowSprite).loc = point(-2000, -2000)
  37.     sprite(pPageSprite).visible = point(-2000, -2000)
  38.     sprite(pRightArrowSprite).visible = point(-2000, -2000)
  39.   end if
  40.   gMaster.pSavedSummaryList = []
  41.   vTempNumber = 0
  42.   repeat with y = 1 to gMaster.pSummaryList.count
  43.     if gMaster.pSummaryList[y].pPage = gMaster.pSavedCount then
  44.       add(gMaster.pSavedSummaryList, gMaster.pSummaryList[y])
  45.       gMaster.pSavedSummaryList[gMaster.pSavedSummaryList.count].pRectSpriteSaved = gMaster.pRectangleSpriteStartNum + vTempNumber
  46.       gMaster.pSavedSummaryList[gMaster.pSavedSummaryList.count].pPhotoSpriteSaved = gMaster.pPhotoSpriteStartNum + vTempNumber
  47.       gMaster.pSavedSummaryList[gMaster.pSavedSummaryList.count].pPushPinSpriteSaved = gMaster.pPushPinSpriteStartNum + vTempNumber
  48.       vTempNumber = vTempNumber + 1
  49.     end if
  50.   end repeat
  51.   if gMaster.pSavedSummaryList.count = 0 then
  52.     alert("the gMaster.pSavedSummaryList list is empty")
  53.     exit
  54.   else
  55.     if gMaster.pSavedSettings.xyeffect = "TRUE" then
  56.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  57.       repeat with x = 1 to gMaster.pSavedSummaryList.count
  58.         sprite(vSpriteCount).member = member(gMaster.pSavedSummaryList[x].pSmallName, gMaster.pSavedSummaryList[x].pCastLibSmall)
  59.         sprite(vSpriteCount).loc = gMaster.pSavedSummaryList[x].pXYPosition
  60.         vMemberWidth = member(gMaster.pSavedSummaryList[x].pSmallName, gMaster.pSavedSummaryList[x].pCastLibSmall).width
  61.         vMemberHeight = member(gMaster.pSavedSummaryList[x].pSmallName, gMaster.pSavedSummaryList[x].pCastLibSmall).height
  62.         vWidth = vMemberWidth * float("." & gMaster.pSavedSettings.percentage)
  63.         vHeight = vMemberHeight * float("." & gMaster.pSavedSettings.percentage)
  64.         if gMaster.pSavedSettings.percentage = 100 then
  65.           sprite(vSpriteCount).width = vMemberWidth
  66.           sprite(vSpriteCount).height = vMemberHeight
  67.         else
  68.           sprite(vSpriteCount).width = vWidth
  69.           sprite(vSpriteCount).height = vHeight
  70.         end if
  71.         vSpriteCount = vSpriteCount + 1
  72.       end repeat
  73.       updateStage()
  74.     end if
  75.     if gMaster.pSavedSettings.blendeffect = "TRUE" then
  76.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  77.       repeat with x = 1 to gMaster.pSavedSummaryList.count
  78.         if gMaster.pSavedSummaryList[x].pSelected = "no" then
  79.           sprite(vSpriteCount).blend = 100
  80.         else
  81.           sprite(vSpriteCount).blend = gMaster.pSavedSettings.blendpercent
  82.         end if
  83.         vSpriteCount = vSpriteCount + 1
  84.       end repeat
  85.     end if
  86.     if gMaster.pSavedSettings.rectangles = "TRUE" then
  87.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  88.       vSpriteCount2 = gMaster.pRectangleSpriteStartNum
  89.       repeat with x = 1 to gMaster.pSavedSummaryList.count
  90.         if gMaster.pSavedSummaryList[x].pSelected = "no" then
  91.           sprite(vSpriteCount2).rect = rect(-2000, -2000, -1999, 1999)
  92.         else
  93.           vLeft = sprite(vSpriteCount).left - 2
  94.           vTop = sprite(vSpriteCount).top - 2
  95.           vRight = sprite(vSpriteCount).right + 2
  96.           vBottom = sprite(vSpriteCount).bottom + 2
  97.           sprite(vSpriteCount2).rect = rect(vLeft, vTop, vRight, vBottom)
  98.         end if
  99.         vSpriteCount = vSpriteCount + 1
  100.         vSpriteCount2 = vSpriteCount2 + 1
  101.       end repeat
  102.     end if
  103.     if gMaster.pSavedSettings.pushpin = "TRUE" then
  104.       vSpriteCount = gMaster.pPhotoSpriteStartNum
  105.       vSpriteCount2 = gMaster.pPushPinSpriteStartNum
  106.       repeat with x = 1 to gMaster.pSavedSummaryList.count
  107.         if gMaster.pSavedSummaryList[x].pSelected = "no" then
  108.           sprite(vSpriteCount2).loc = point(-2000, -2000)
  109.         else
  110.           vLeft = sprite(vSpriteCount).left + gMaster.pSavedSettings.pinoffset[1]
  111.           vTop = sprite(vSpriteCount).top + gMaster.pSavedSettings.pinoffset[2]
  112.           sprite(vSpriteCount2).loc = point(vLeft, vTop)
  113.         end if
  114.         vSpriteCount = vSpriteCount + 1
  115.         vSpriteCount2 = vSpriteCount2 + 1
  116.       end repeat
  117.     end if
  118.     vOK = "no"
  119.     repeat with y = 1 to gMaster.pSummaryList.count
  120.       if gMaster.pSummaryList[y].pSelected = "yes" then
  121.         vOK = "yes"
  122.         exit repeat
  123.       end if
  124.     end repeat
  125.     if vOK = "yes" then
  126.       sendSprite(9, #mSetOnStage)
  127.     else
  128.       sendSprite(9, #mSetOffStage)
  129.     end if
  130.   end if
  131. end
  132.  
  133. on mResetRedRects me
  134.   vSpriteCount2 = gMaster.pRectangleSpriteStartNum
  135.   repeat with x = 1 to 40
  136.     sprite(vSpriteCount2).rect = rect(-2000, -2000, -1999, 1999)
  137.     vSpriteCount2 = vSpriteCount2 + 1
  138.   end repeat
  139. end
  140.  
  141. on mResetPushPins me
  142.   vSpriteCount2 = gMaster.pPushPinSpriteStartNum
  143.   repeat with x = 1 to 40
  144.     sprite(vSpriteCount2).loc = point(-2000, -2000)
  145.     vSpriteCount2 = vSpriteCount2 + 1
  146.   end repeat
  147. end
  148.