home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
3D World 111
/
3DW_111.iso
/
pc
/
Menu
/
Scenes
/
home.dir
/
00079_Script_gallery_button
< prev
next >
Wrap
Text File
|
2008-09-12
|
3KB
|
135 lines
global gRootPath
global gDiv
global gMenuList
global rollcolor
global SectionNumber
global SectionPath
global gFullPath
property Sp
property myEntry
on Initialize me, aNumber, aListEntry, aItemTitle
Sp = sprite(aNumber)
myTitle = aItemTitle
myEntry = aListEntry
end
on mouseEnter me
cursor 280
Sp.color = rollcolor
end
on mouseLeave me
cursor -1
Sp.color = rgb(0,0,0)
end
on mouseUp me
aPath = gMenuList[SectionNumber].itemList[myEntry].itemPath
me.GenerateGallery(aPath)
end
on GenerateGallery me, aPath
repeat with i = 200 to 250
sprite(i).visible = false
sprite(199).visible = True
end repeat
_movie.updatestage()
fullPath = gRootPath & "DiscContent" & gDiv & SectionPath & gDiv & aPath & gDiv
gFullPath = fullPath
generateProductPage(fullPath)
sendsprite(7, #pFormat, 7)
found = false
galleryLoc = point(460,120)
put fullPath & "images.cst"
if baFileExists(fullPath & "images.cst") then
pTime = the milliseconds
castlib("images").filename = fullPath & "images.cst"
galPath = fullPath & "images.cst"
found = True
pTime = the milliseconds - pTime
else if baFileExists(fullPath & "images.cxt") then
castlib("images").filename = fullPath & "images.cxt"
galPath = fullPath & "images.cxt"
found = True
end if
if found = True then
repeat with k = 1 to the number of members of castlib "images"
member(k, "images").regPoint = point(0,0)
end repeat
end if
if found = True then
repeat with j = 200 to 250
sprite(j).scriptinstancelist = []
channel(j).removescriptedsprite()
end repeat
-- repeat with i = 1 to the number of members of castlib "images"
-- x = new(#bitmap, castlib("sounds"), 100, 80)
--
-- xImage = x.image
-- im = member(i, "images").image.duplicate()
-- wd = member(i, "images").width / 2
-- ht = member(i, "images").height / 2
--
-- xImage.copypixels(im, im.rect, x.rect)
--
-- x.regpoint = point(0,0)
-- end repeat
chn = 200
cnt = 0
chans = []
repeat with i = 1 to the number of members of castlib "images"
member(i, "images").regpoint = point(0,0)
cnt = cnt + 1
chans.add(chn)
sprite(chn).visible = false
channel(chn).makescriptedsprite(member(i, "images"), galleryLoc)
sprite(chn).rect = rect(galleryLoc.loch, galleryLoc.locV, galleryLoc.locH + 100, galleryLoc.locV + 80)
sprite(chn).scriptinstancelist.add(script("galleryThumb").new())
sendsprite(chn, #init, chn, i, galPath)
chn = chn + 1
galleryLoc.loch = galleryLoc.loch + 108
if cnt = 3 then
galleryLoc.locH = 460
galleryLoc.locV = galleryLoc.locV + 100
cnt = 0
end if
end repeat
repeat with i = 1 to chans.count
if sprite(chans[i]).member.regpoint = point(0,0) then
sprite(chans[i]).visible = True
end if
end repeat
sprite(199).visible = false
end if
member("product_title").text = Sp.member.text
end