home *** CD-ROM | disk | FTP | other *** search
- global gNullCastNum, gLHiliteList, gRHiliteList, gLeftGoToList, gRightGoToList, gPictInAStringL, gPictInAStringR, gLastRollover, gLastPiePiece, printer, gPropFont, gMonoFont, gXObjFile
-
- on startMovie
- set the centerStage to 1
- setGlobals()
- if the machineType = 256 then
- set gPropFont to "arial"
- set gMonoFont to "courier new"
- set gXObjFile to "pmatic.dll"
- else
- set gPropFont to "helvetica"
- set gMonoFont to "courier"
- set gXObjFile to "pmatic.xobj"
- end if
- if not objectp(printer) then
- openXLib(gXObjFile)
- set printer to PrintOMatic(mnew)
- end if
- if not objectp(printer) then
- alert("There is no printer currently selected. Printing features are disabled.")
- else
- end if
- end
-
- on stopMovie
- PupsOff()
- if objectp(printer) then
- printer(mdispose)
- end if
- closeXLib(gXObjFile)
- end
-
- on setGlobals
- set gPictInAStringL to the text of cast "Left Mask Text"
- set gPictInAStringR to the text of cast "Right Mask Text"
- set gLHiliteList to []
- set gRHiliteList to []
- repeat with x = 1 to 18
- add(gLHiliteList, the number of cast ("Left Hilite" && string(x)))
- add(gRHiliteList, the number of cast ("Right Hilite" && string(x)))
- end repeat
- add(gLHiliteList, the number of cast "Null Hilite")
- add(gRHiliteList, the number of cast "Null Hilite")
- set gNullCastNum to the number of cast "Null Hilite"
- set gLeftGoToList to ["Phones", "Sci-Fi", "Human", "Swishes", "Industrial", "Vehicles", "Water", "Weather", "Whooshes", "Textures", "Household", "Squeaks", "Impacts", "Switches", "Liquids", "Media", "Monsters", "Office", "RightChoice"]
- set gRightGoToList to ["Creaks", "Comedy", "Crowds", "Computers", "Doors", "Electrics", "Animals", "Fire", "Explosions", "Bells", "Alarms", "Ambience", "Beeps", "Arcade", "Guns", "Camera", "Buttons", "Gore", "LeftChoice"]
- set gLastPiePiece to 0
- end
-
- on GrayMatterPrint
- global printer
- if not objectp(printer) then
- alert("There is no printer currently selected. Printing features are disabled.")
- else
- cursor(4)
- printer(mReset)
- set m to (printer(mGetPaperWidth) - 330) / 2
- printer(mSetMargins, m, 48, 48, 48)
- printer(mNewPage)
- printer(mPicture, the picture of cast "Logo", 0, 12, 330, 70)
- printer(mTextBox, 0, 48, 330, 70, 0)
- printer(mSetTextJust, "center")
- AppendStyledText(printer, the number of cast "header", 0)
- printer(mSetTextJust, "left")
- printer(mTextBox, 0, 70, printer(mGetPageWidth), 220, 0)
- AppendStyledText(printer, the number of cast "name&address", 0)
- printer(mTextBox, 0, 220, printer(mGetPageWidth), 450, 0)
- AppendStyledText(printer, the number of cast "productCol", 0)
- set r to rect(212, 220, 322, 450)
- set vLine to the left of r + 60
- set hLine to the top of r + 34
- set leading to 15
- printer(mTextBox, the left of r, the top of r, printer(mGetPageWidth), the bottom of r + 10, 0)
- AppendStyledText(printer, the number of cast "priceCol", 0)
- printer(mTextBox, vLine + 5, the top of r, printer(mGetPageWidth), the bottom of r + 10, 0)
- AppendStyledText(printer, the number of cast "quantityCol", 0)
- printer(mLine, vLine, the top of r, vLine, the bottom of r)
- repeat with cnt = 1 to the number of lines in field "productCol" - 2
- printer(mLine, the left of r, hLine, the right of r, hLine)
- set hLine to hLine + leading
- end repeat
- TotalField(rect(242, 450, 322, 470), "subtotalField", 1)
- TotalField(rect(242, 473, 322, 493), "taxField", 1)
- set the top of r to 500
- set the bottom of r to 560
- set hLine to the top of r + 30
- set leading to 15
- printer(mTextBox, the left of r - 60, the top of r, the right of r, the bottom of r + 20, 0)
- AppendStyledText(printer, the number of cast "shipCol1", 0)
- printer(mTextBox, the left of r, the top of r, the right of r, the bottom of r + 10, 0)
- AppendStyledText(printer, the number of cast "shipCol2", 0)
- printer(mTextBox, vLine + 5, the top of r, printer(mGetPageWidth), the bottom of r + 10, 0)
- AppendStyledText(printer, the number of cast "shipCol3", 0)
- printer(mLine, vLine, the top of r, vLine, the bottom of r)
- repeat with cnt = 1 to the number of lines in field "shipCol2" - 2
- printer(mLine, the left of r, hLine, the right of r, hLine)
- set hLine to hLine + leading
- end repeat
- printer(mTextBox, 0, 460, the left of r - 70, 622, 0)
- AppendStyledText(printer, the number of cast "instructions", 0)
- TotalField(rect(242, 580, 322, 600), "shippingField", 1)
- TotalField(rect(242, 603, 322, 623), "totalField", 2)
- printer(mTextBox, 0, 632, the right of r, printer(mgetpageheight), 0)
- printer(mSetTextJust, "center")
- AppendStyledText(printer, the number of cast "footer", 0)
- if printer(mDoJobSetup) = 1 then
- updateStage()
- printer(mPrint)
- end if
- cursor(-1)
- end if
- end
-
- on TotalField r, txtCast, wt
- global printer
- printer(mSetPenSize, wt, wt)
- printer(mStrokedRoundRect, the left of r, the top of r, the right of r, the bottom of r, (the bottom of r - the top of r) / 2)
- printer(mSetTextFont, the textFont of char 1 of cast txtCast)
- printer(mSetTextSize, the textSize of char 1 of cast txtCast)
- printer(mSetTextStyle, the textStyle of char 1 of cast txtCast)
- printer(mSetTextJust, "right")
- printer(mDrawText, the text of field txtCast, the left of r - 6, the bottom of r - 5)
- printer(mSetTextJust, "left")
- end
-
- on initText
- set gLastRollover to 48
- repeat with channel = 10 to 14
- puppetSprite(channel, 1)
- end repeat
- end
-
- on PupsOff
- puppetSound(0)
- repeat with channel = 10 to 21
- puppetSprite(channel, 0)
- end repeat
- updateStage()
- end
-
- on checkRoll
- repeat with spriteCounter = 10 to 14
- set gLastRollover to 48
- if rollOver(spriteCounter) and (spriteCounter <> gLastRollover) then
- set gLastRollover to spriteCounter
- puppetSound(0)
- if not soundBusy(1) then
- set theSound to "word" & spriteCounter
- puppetSound(theSound)
- end if
- set the castNum of sprite spriteCounter to the number of cast (spriteCounter & "hi")
- updateStage()
- repeat while rollOver(spriteCounter) and the mouseUp
- end repeat
- set the castNum of sprite spriteCounter to the number of cast (gLastRollover & "or")
- updateStage()
- end if
- end repeat
- end
-
- on LeftSide
- set whichOne to FindColorOfPixelUnderCursorL()
- if whichOne <> gLastPiePiece then
- if whichOne = 0 then
- set the castNum of sprite 2 to gNullCastNum
- else
- if whichOne = 19 then
- set the castNum of sprite 2 to gNullCastNum
- updateStage()
- go(getAt(gLeftGoToList, whichOne))
- else
- puppetSound("click1.aif")
- set the castNum of sprite 2 to getAt(gLHiliteList, whichOne)
- set gLastPiePiece to whichOne
- updateStage()
- end if
- end if
- end if
- end
-
- on RightSide
- set whichOne to FindColorOfPixelUnderCursorR()
- if whichOne <> gLastPiePiece then
- if whichOne = 0 then
- set the castNum of sprite 2 to gNullCastNum
- else
- if whichOne = 19 then
- set the castNum of sprite 2 to gNullCastNum
- updateStage()
- go(getAt(gRightGoToList, whichOne))
- else
- puppetSound("click1.aif")
- set the castNum of sprite 2 to getAt(gRHiliteList, whichOne)
- set gLastPiePiece to whichOne
- updateStage()
- end if
- end if
- end if
- end
-
- on LaunchLeftChoice
- set whichOne to FindColorOfPixelUnderCursorL()
- if whichOne = 0 then
- exit
- else
- if whichOne <> 19 then
- set the loc of sprite 2 to point(-1000, -1000)
- end if
- go(getAt(gLeftGoToList, whichOne))
- end if
- end
-
- on LauchRightChoice
- set whichOne to FindColorOfPixelUnderCursorR()
- if whichOne = 0 then
- exit
- else
- if whichOne <> 19 then
- set the loc of sprite 2 to point(-1000, -1000)
- end if
- go(getAt(gRightGoToList, whichOne))
- end if
- end
-
- on initRollOvers
- puppetSprite(2, 1)
- end
-
- on LoadRawPictIntoString
- if objectp(myObj) then
- myObj(mdispose)
- end if
- end
-
- on FindColorOfPixelUnderCursorL
- set x to the mouseH / 4
- set y to the mouseV / 4
- set locOfPixelInString to (y * 160) + x + 1
- return charToNum(char locOfPixelInString of gPictInAStringL)
- end
-
- on FindColorOfPixelUnderCursorR
- set x to the mouseH / 4
- set y to the mouseV / 4
- set locOfPixelInString to (y * 160) + x + 1
- return charToNum(char locOfPixelInString of gPictInAStringR)
- end
-