home *** CD-ROM | disk | FTP | other *** search
/ 3D World 110 / 3DW_110.iso / mac / Menu / Scenes / home.dir / 00079_Script_gallery_button < prev    next >
Text File  |  2008-09-12  |  3KB  |  135 lines

  1. global gRootPath
  2. global gDiv
  3. global gMenuList
  4. global rollcolor
  5. global SectionNumber
  6. global SectionPath
  7. global gFullPath
  8. property Sp
  9. property myEntry
  10.  
  11. on Initialize me, aNumber, aListEntry, aItemTitle
  12.   Sp = sprite(aNumber)
  13.   myTitle = aItemTitle
  14.   myEntry = aListEntry
  15. end
  16.  
  17. on mouseEnter me
  18.   cursor 280
  19.   Sp.color = rollcolor
  20. end
  21.  
  22. on mouseLeave me
  23.   cursor -1
  24.   Sp.color = rgb(0,0,0)
  25. end
  26.  
  27. on mouseUp me
  28.   aPath = gMenuList[SectionNumber].itemList[myEntry].itemPath
  29.   
  30.   me.GenerateGallery(aPath)
  31.   
  32. end
  33.  
  34. on GenerateGallery me, aPath
  35.   repeat with i = 200 to 250
  36.     sprite(i).visible = false
  37.     sprite(199).visible = True
  38.   end repeat
  39.   
  40.   _movie.updatestage()
  41.   
  42.   fullPath = gRootPath & "DiscContent" & gDiv & SectionPath & gDiv & aPath & gDiv
  43.   
  44.   gFullPath = fullPath
  45.   
  46.   
  47.   generateProductPage(fullPath)
  48.   sendsprite(7, #pFormat, 7)
  49.   found = false
  50.   
  51.   galleryLoc = point(460,120)
  52.   put fullPath & "images.cst"
  53.   if baFileExists(fullPath & "images.cst") then
  54.     pTime = the milliseconds
  55.     castlib("images").filename = fullPath & "images.cst"
  56.     galPath = fullPath & "images.cst"
  57.     found = True
  58.     pTime = the milliseconds - pTime
  59.   else if baFileExists(fullPath & "images.cxt") then
  60.     castlib("images").filename = fullPath & "images.cxt"
  61.     galPath = fullPath & "images.cxt"
  62.     found = True
  63.   end if
  64.   
  65.   if found = True then
  66.     repeat with k = 1 to the number of members of castlib "images"
  67.       member(k, "images").regPoint = point(0,0)
  68.       
  69.     end repeat
  70.   end if
  71.   
  72.   
  73.   
  74.   
  75.   if found = True then
  76.     repeat with j = 200 to 250
  77.       sprite(j).scriptinstancelist = []
  78.       channel(j).removescriptedsprite()
  79.     end repeat
  80.     
  81.     
  82.     
  83.     
  84.     --    repeat with i = 1 to the number of members of castlib "images"
  85.     --      x = new(#bitmap, castlib("sounds"), 100, 80)
  86.     --      
  87.     --      xImage = x.image
  88.     --      im = member(i, "images").image.duplicate()
  89.     --      wd = member(i, "images").width / 2
  90.     --      ht = member(i, "images").height / 2
  91.     --      
  92.     --      xImage.copypixels(im, im.rect, x.rect)
  93.     --
  94.     --      x.regpoint = point(0,0)
  95.     --    end repeat
  96.     
  97.     chn = 200
  98.     
  99.     cnt = 0
  100.     chans = []
  101.     
  102.     repeat with i = 1 to the number of members of castlib "images"
  103.       member(i, "images").regpoint = point(0,0)
  104.       cnt = cnt + 1
  105.       chans.add(chn)
  106.       sprite(chn).visible = false
  107.       channel(chn).makescriptedsprite(member(i, "images"), galleryLoc)
  108.       sprite(chn).rect = rect(galleryLoc.loch, galleryLoc.locV, galleryLoc.locH + 100, galleryLoc.locV + 80)
  109.       sprite(chn).scriptinstancelist.add(script("galleryThumb").new())
  110.       sendsprite(chn, #init, chn, i, galPath)
  111.       chn = chn + 1
  112.       galleryLoc.loch = galleryLoc.loch + 108
  113.       
  114.       if cnt = 3 then
  115.         galleryLoc.locH = 460
  116.         galleryLoc.locV = galleryLoc.locV + 100
  117.         cnt = 0
  118.       end if
  119.       
  120.       
  121.     end repeat
  122.     
  123.     repeat with i = 1 to chans.count
  124.       if sprite(chans[i]).member.regpoint = point(0,0) then
  125.         sprite(chans[i]).visible = True
  126.       end if 
  127.     end repeat
  128.     sprite(199).visible = false
  129.     
  130.     
  131.   end if
  132.   
  133.   member("product_title").text = Sp.member.text
  134. end
  135.