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

  1. global gFormat, imageMember
  2.  
  3. on generateProductPage aPath
  4.   member("comment").text = EMPTY
  5.   thePath = aPath
  6.   if baFileExists(thePath & "code.txt") = 0 then
  7.     alert("No code.txt found in: " & thePath)
  8.   else
  9.     if baFileExists(thePath & "shot.jpg") then
  10.       imageMember.fileName = thePath & "shot.jpg"
  11.       sprite(6).member = imageMember
  12.     end if
  13.     imageMember = member("imagebox")
  14.     pText = getNetText(thePath & "info.txt")
  15.     cText = getNetText(thePath & "code.txt")
  16.     if netDone(pText) then
  17.       textholder = netTextResult(pText)
  18.       header = textholder.line[1]
  19.       member("product_title").text = header
  20.       member("product_header").text = textholder.line[2]
  21.       delete textholder.line[1..3]
  22.       member("product_details").text = textholder
  23.       member("product_details").topSpacing = 0
  24.       member("product_details").fixedLineSpace = 12
  25.     end if
  26.     bCount = 1
  27.     if netDone(cText) then
  28.       codeHolder = netTextResult(cText)
  29.       lH = 400
  30.       lV = 520
  31.       cCount = 1
  32.       repeat with i = 100 to _movie.channel.count
  33.         sprite(i).scriptInstanceList = []
  34.         channel(i).removeScriptedSprite()
  35.       end repeat
  36.       repeat with i = 1 to codeHolder.line.count
  37.         if bCount = 2 then
  38.           lH = 560
  39.         end if
  40.         if bCount > 2 then
  41.           lV = 520
  42.         end if
  43.         if bCount = 3 then
  44.           lH = 400
  45.         end if
  46.         if bCount = 4 then
  47.           lH = 840
  48.           lV = 520
  49.         end if
  50.         case codeHolder.line[i].word[1] of
  51.           "<register>":
  52.             RegTarget = codeHolder.line[i].word[2]
  53.             cCount = cCount + 1
  54.             bCount = bCount + 1
  55.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  56.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  57.             _movie.sendSprite(100 + cCount, #Initialize, RegTarget, 100 + cCount, "register")
  58.             cCount = cCount + 1
  59.             channel(100 + cCount).makeScriptedSprite(member("register_text"), point(lH - 40, lV - 11))
  60.             sprite(100 + cCount).ink = 36
  61.           "<install_PC>":
  62.             InstallTarget = codeHolder.line[i].char[14..codeHolder.line[i].char.count]
  63.             cCount = cCount + 1
  64.             bCount = bCount + 1
  65.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  66.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  67.             _movie.sendSprite(100 + cCount, #Initialize, InstallTarget, 100 + cCount, "install_pc")
  68.             cCount = cCount + 1
  69.             channel(100 + cCount).makeScriptedSprite(member("Install_PC_text"), point(lH - 40, lV - 11))
  70.             sprite(100 + cCount).ink = 36
  71.           "<install_MAC>":
  72.             InstallTarget = codeHolder.line[i].char[15..codeHolder.line[i].char.count]
  73.             cCount = cCount + 1
  74.             bCount = bCount + 1
  75.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  76.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  77.             _movie.sendSprite(100 + cCount, #Initialize, InstallTarget, 100 + cCount, "install_mac")
  78.             cCount = cCount + 1
  79.             channel(100 + cCount).makeScriptedSprite(member("Install_MAC_text"), point(lH - 40, lV - 11))
  80.             sprite(100 + cCount).ink = 36
  81.           "<install>":
  82.             InstallTarget = codeHolder.line[i].char[11..codeHolder.line[i].char.count]
  83.             cCount = cCount + 1
  84.             bCount = bCount + 1
  85.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  86.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  87.             _movie.sendSprite(100 + cCount, #Initialize, InstallTarget, 100 + cCount, "install")
  88.             cCount = cCount + 1
  89.             channel(100 + cCount).makeScriptedSprite(member("Install_text"), point(lH - 40, lV - 11))
  90.             sprite(100 + cCount).ink = 36
  91.           "<folder>":
  92.             FolderTarget = codeHolder.line[i].char[10..codeHolder.line[i].char.count]
  93.             cCount = cCount + 1
  94.             bCount = bCount + 1
  95.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  96.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  97.             _movie.sendSprite(100 + cCount, #Initialize, FolderTarget, 100 + cCount, "folder")
  98.             cCount = cCount + 1
  99.             channel(100 + cCount).makeScriptedSprite(member("folder_text"), point(lH - 40, lV - 11))
  100.             sprite(100 + cCount).ink = 36
  101.           "<format>":
  102.             gFormat = codeHolder.line[i].char[10..codeHolder.line[i].char.count]
  103.           "<comment>":
  104.             gComment = codeHolder.line[i].char[11..codeHolder.line[i].char.count]
  105.             member("comment").text = gComment
  106.           "<Website>":
  107.             WebTarget = codeHolder.line[i].word[2]
  108.             cCount = cCount + 1
  109.             bCount = bCount + 1
  110.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  111.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  112.             _movie.sendSprite(100 + cCount, #Initialize, WebTarget, 100 + cCount, "website")
  113.             cCount = cCount + 1
  114.             channel(100 + cCount).makeScriptedSprite(member("website_text"), point(lH - 40, lV - 11))
  115.             sprite(100 + cCount).ink = 36
  116.           "<local_link>":
  117.             WebTarget = thePath & codeHolder.line[i].word[2..codeHolder.line[i].word.count]
  118.             cCount = cCount + 1
  119.             bCount = bCount + 1
  120.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  121.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  122.             _movie.sendSprite(100 + cCount, #Initialize, WebTarget, 100 + cCount, "local_link")
  123.             cCount = cCount + 1
  124.             channel(100 + cCount).makeScriptedSprite(member("website_text"), point(lH - 40, lV - 11))
  125.             sprite(100 + cCount).ink = 36
  126.           "<Serial>":
  127.             WebTarget = thePath & codeHolder.line[i].word[2..codeHolder.line[i].word.count]
  128.             cCount = cCount + 1
  129.             bCount = bCount + 1
  130.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  131.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  132.             _movie.sendSprite(100 + cCount, #Initialize, WebTarget, 100 + cCount, "local_link")
  133.             cCount = cCount + 1
  134.             channel(100 + cCount).makeScriptedSprite(member("Serial_Text"), point(lH - 40, lV - 11))
  135.             sprite(100 + cCount).ink = 36
  136.           "<Upgrade>":
  137.             WebTarget = codeHolder.line[i].word[2..codeHolder.line[i].word.count]
  138.             cCount = cCount + 1
  139.             bCount = bCount + 1
  140.             channel(100 + cCount).makeScriptedSprite(member("iNSTALLbUTTON"), point(lH, lV))
  141.             add(sprite(100 + cCount).scriptInstanceList, new(script("action_button_rollover"), 1))
  142.             _movie.sendSprite(100 + cCount, #Initialize, WebTarget, 100 + cCount, "website")
  143.             cCount = cCount + 1
  144.             channel(100 + cCount).makeScriptedSprite(member("Upgrade_Text"), point(lH - 40, lV - 11))
  145.             sprite(100 + cCount).ink = 36
  146.         end case
  147.       end repeat
  148.     end if
  149.   end if
  150. end
  151.