home *** CD-ROM | disk | FTP | other *** search
- -- 2000.03.10
- -- Clive Green <clivegreen@atlas.co.uk>
-
- ------------------------------------------------------------------------------------------------------
-
- -- this sets up the programme and provides access to the main codebase object;
- -- it also relays glue calls to the codebase - including those made from (say) Flash movies
-
- ------------------------------------------------------------------------------------------------------
-
- -- declare globals:
- global gRoot -- the stub/projector's parent directory path
- global gMain -- a persistent reference to an object representing the entire programme
-
- ------------------------------------------------------------------------------------------------------
-
- on setupMain
-
- -- called by startMovie:
-
- -- attempt to initialise the programme - supply the root path within an arguments listing:
- m = new(script "main",[#rootPath:gRoot])
-
- -- any luck?
- if (ilk(m) <> #instance) then
-
- beep 3--DEV
- exit
-
- end if
-
- --------------------
-
- -- store main object:
- gMain = m
-
- -- try for logo and feedback display windows -
- -- note that we don't care about the result returned:
- gMain.showMiaws()
-
- -- check for existence of the correct CD-ROM:
- gMain.checkForCDROM()
-
- ----------------------------------------------------------------------------------------------------
-
- on clearMain
-
- -- called by stopMovie:
-
- -- clean up only as needed:
- if (ilk(gMain) <> #instance) then return gMain
-
- --------------------
-
- -- any miaws (movies-in-a-window) will need to be dismissed:
- gMain.clearMiaws()
-
- -- close all sound channels:
- repeat with i = 1 to 8
-
- sound stop i
-
- end repeat
-
- ----------------------------------------------------------------------------------------------------
-
- on glue g
-
- -- called from outside Director - relay the glue message g:
-
- -- codebase is required:
- if (ilk(gMain) <> #instance) then return gMain
-
- --------------------
-
- -- relay the message:
- L = gMain.glue(symbol(g))
-
- -- compile a string from the result returned:
- s = g & ":" && string(L)
-
- -- print feedback string:
- um = gMain.getUtilityMethods()
- um.printStr(s)
-
- -- provide a result to the caller:
- return L
-
- ----------------------------------------------------------------------------------------------------