home *** CD-ROM | disk | FTP | other *** search
/ 3D World 113 / 3DW_113.iso / pc / Menu / Scenes / home.dir / Internal_79_gallery_button.ls < prev    next >
Encoding:
Text File  |  2008-09-12  |  2.5 KB  |  90 lines

  1. property Sp, myEntry
  2. global gRootPath, gDiv, gMenuList, rollcolor, SectionNumber, SectionPath, gFullPath
  3.  
  4. on Initialize me, aNumber, aListEntry, aItemTitle
  5.   Sp = sprite(aNumber)
  6.   myTitle = aItemTitle
  7.   myEntry = aListEntry
  8. end
  9.  
  10. on mouseEnter me
  11.   cursor(280)
  12.   Sp.color = rollcolor
  13. end
  14.  
  15. on mouseLeave me
  16.   cursor(-1)
  17.   Sp.color = rgb(0, 0, 0)
  18. end
  19.  
  20. on mouseUp me
  21.   aPath = gMenuList[SectionNumber].ItemList[myEntry].ItemPath
  22.   me.GenerateGallery(aPath)
  23. end
  24.  
  25. on GenerateGallery me, aPath
  26.   repeat with i = 200 to 250
  27.     sprite(i).visible = 0
  28.     sprite(199).visible = 1
  29.   end repeat
  30.   _movie.updateStage()
  31.   fullPath = gRootPath & "DiscContent" & gDiv & SectionPath & gDiv & aPath & gDiv
  32.   gFullPath = fullPath
  33.   generateProductPage(fullPath)
  34.   sendSprite(7, #pFormat, 7)
  35.   found = 0
  36.   galleryLoc = point(460, 120)
  37.   put fullPath & "images.cst"
  38.   if baFileExists(fullPath & "images.cst") then
  39.     pTime = the milliSeconds
  40.     castLib("images").fileName = fullPath & "images.cst"
  41.     galPath = fullPath & "images.cst"
  42.     found = 1
  43.     pTime = the milliSeconds - pTime
  44.   else
  45.     if baFileExists(fullPath & "images.cxt") then
  46.       castLib("images").fileName = fullPath & "images.cxt"
  47.       galPath = fullPath & "images.cxt"
  48.       found = 1
  49.     end if
  50.   end if
  51.   if found = 1 then
  52.     repeat with k = 1 to the number of castMembers of castLib "images"
  53.       member(k, "images").regPoint = point(0, 0)
  54.     end repeat
  55.   end if
  56.   if found = 1 then
  57.     repeat with j = 200 to 250
  58.       sprite(j).scriptInstanceList = []
  59.       channel(j).removeScriptedSprite()
  60.     end repeat
  61.     chn = 200
  62.     cnt = 0
  63.     chans = []
  64.     repeat with i = 1 to the number of castMembers of castLib "images"
  65.       member(i, "images").regPoint = point(0, 0)
  66.       cnt = cnt + 1
  67.       chans.add(chn)
  68.       sprite(chn).visible = 0
  69.       channel(chn).makeScriptedSprite(member(i, "images"), galleryLoc)
  70.       sprite(chn).rect = rect(galleryLoc.locH, galleryLoc.locV, galleryLoc.locH + 100, galleryLoc.locV + 80)
  71.       sprite(chn).scriptInstanceList.add(script("galleryThumb").new())
  72.       sendSprite(chn, #init, chn, i, galPath)
  73.       chn = chn + 1
  74.       galleryLoc.locH = galleryLoc.locH + 108
  75.       if cnt = 3 then
  76.         galleryLoc.locH = 460
  77.         galleryLoc.locV = galleryLoc.locV + 100
  78.         cnt = 0
  79.       end if
  80.     end repeat
  81.     repeat with i = 1 to chans.count
  82.       if sprite(chans[i]).member.regPoint = point(0, 0) then
  83.         sprite(chans[i]).visible = 1
  84.       end if
  85.     end repeat
  86.     sprite(199).visible = 0
  87.   end if
  88.   member("product_title").text = Sp.member.text
  89. end
  90.