home *** CD-ROM | disk | FTP | other *** search
/ 1&1 Multimedia Trend 1996 10 B / MM_TREND.ISO / prog / isdn / shared.dir / 00300_Script_300 next >
Text File  |  1996-08-18  |  12KB  |  482 lines

  1. -- Init
  2. -- vars + screen
  3. -- deklaration hier, dann gilt es fⁿr alle procs in diesem script
  4.  
  5. global gsCRLF, gsExchData
  6.  
  7. -- flags
  8. global gbDebug
  9. global gbAnimation  -- True, bei animationsfolge fⁿr slider
  10. global gbGoto, gsGoFrame  -- global goto kennungen in IDLE
  11. global gbSldOpen  -- flag, ob slider offen sind 
  12. global giBlinkCast,gbDoBlink, gBlink -- Rolloverallg,  blinken
  13. global gbDoTheMouse  -- flag fⁿr rollover in idle zztnicht
  14. global giDownFlag  -- Flag (0..Spn) fⁿr MouseDwon in ExecRollover
  15. global gbInitFrame  -- damit ein Frames nur einmal init
  16. global gbISDN   -- flag fⁿr Init und Funktionen
  17. global gbIsPC   -- PC oder Mac
  18. global gbQuitWait  -- abbruch von busywait
  19. global gb1u1Logo
  20.  
  21. -- files
  22. global gsIniFile,gsExtension, gsMoviePath 
  23.  
  24. -- screen vars und listen
  25. global glParamList
  26. global glSpriteRoll, glCastOfSprite, glOrigOfSprite
  27. global glHideSprite -- die zu versteckenden
  28. global glAction  -- liste der MousUp Actions script 306
  29. global glStatus  -- zustand der Slider
  30. global glBsListe -- namen der screen im movie (init in start-movie)
  31. global glGotoListe   -- vor/rⁿck/inhalt
  32. global glBsFrame  -- die framenummern der Marker
  33. global glActiveRoll  -- aktive sprites bei offenem slider
  34.  
  35. global giDummySliderId, giDummySliderHomeId -- puppet dummy slider
  36. global giLastSprite  -- letztes rollover
  37. global giBsIndex  -- aktuelle screen
  38. global giSliderID  -- Nr des ge÷ffneten slider Oder Null (Flag)
  39. global giMovieNr  -- sprite nummer von movies fⁿr ausblenden
  40. global gsLastMovie  -- name fⁿr test bei rⁿckkehr aus filmen
  41. global giExtraAction  -- zusatz aktionen im einzen movie
  42. global gsApp
  43.  
  44.  
  45. -- ************************************************************
  46. -- ************************************************************
  47. on InitAll
  48.   -- In Star-tMovie des Intros wird InitAll aufgerufen
  49.   -- die folgenden Movies greifen auf die Globals zu
  50.   
  51.   InitVars 
  52.   InitSystem  -- Script 303
  53.   InitPath
  54.   InitParams  -- script 304
  55.   InitScreen
  56.   InitTheMac  -- script 307
  57. end InitAll
  58.  
  59. on InitAll2
  60.   -- In Star-tMovie des Intros wird InitAll aufgerufen
  61.   -- die folgenden Movies greifen auf die Globals zu
  62.   
  63.   InitVars 
  64.   InitSystem  -- Script 303
  65.   InitPath
  66.   InitParams  -- script 304
  67.   --InitScreen
  68.   InitTheMac  -- script 307
  69. end InitAll
  70. -- ************************************************************
  71. -- ************************************************************
  72.  
  73.  
  74.  
  75. on InitVars
  76.   -- Variablen 
  77.   --debug "proc: init vars in frame " & the frame
  78.   
  79.   set gsCRLF = numToChar(13) & numToChar(10) 
  80.   set gsIniFile = "1u1.ini"
  81.   
  82.   set gbSldOpen = false
  83.   set gbDoBlink = true
  84.   set gbDoTheMouse = false
  85.   
  86.   set gBlink = 0
  87.   set giDownFlag = 0
  88.   
  89.   set giLastSprite = 0
  90.   set gsExtension = ".dir"
  91.   set gbAnimation = false
  92.   set giBsIndex = 1
  93.   set gbGoto = false
  94.   set gbDebug = false 
  95.   set gsGoFrame = ""
  96.   set giMovieNr = 0
  97.   set gbInitFrame = false
  98.   set gbIsPC = true
  99.   set giExtraAction = 0
  100.   set gbQuitWait = false
  101.   set gb1u1Logo = false
  102.   set gsApp = ""
  103.   
  104.   -- listen 
  105.   set glSpriteRoll = []  -- init Flags, welche sprites bei rollover
  106.   set glCastOfSprite = []  -- initiieren der castnummern
  107.   set GlOrigOfSprite = []  -- fⁿr stop movie
  108.   set glAction = []  -- init die liste der procs dor MousUpScript
  109.   set glStatus = []  -- status der slider (1...4)
  110.   set glBsliste = []  -- Liste der Frame fⁿr GoPrev, Next
  111.   set glGotoListe = [] 
  112.   set glActiveRoll = []
  113.   
  114.   -- ----------- check maschine -----------
  115.   
  116.   -- check the machine below
  117.   -- kann von initbasics ⁿberschrieben werden
  118.   
  119.   put (the machineType > 255) into gbIsPC
  120.   --debug "PC:" && gbIsPc
  121.   
  122.   -- ----- unterscied ISDN / T-Online ------------------
  123.   
  124.   set gbISDN = false     
  125.   set giBlinkCast = 358
  126.   if (the moviePath contains "ISDN") then
  127.     set gbISDN = true
  128.     set giBlinkCast = 420
  129.   end if
  130.   --debug "ISDN: "& gbISDN
  131.   --debug "proc: .......  ok"
  132.   --debug "Memory: " & the freebytes /1024
  133.   
  134. end
  135.  
  136.  
  137.  
  138. -- ************************************************************
  139. on InitScreen
  140.   --debug "proc: init screen"
  141.   
  142.   set giDummySliderId = 47
  143.   set giDummySliderHomeId = 40
  144.   
  145.   
  146.   
  147.   -- lass die puppen tanzen
  148.   -- einzeln ??
  149.   --debug "  puppet"
  150.   
  151.   if gbISDN = true then
  152.     preloadcast  316 , 400
  153.   else
  154.     preloadcast  400 , 450 
  155.   end if
  156.   
  157.   repeat with i= 26 to 46
  158.     puppetsprite i, true
  159.   end repeat
  160.   
  161.   updatestage
  162.   
  163.   
  164.   -- liste der sprites die am anfang versteckt werden
  165.   --  slider und die buttons auf den slidern
  166.   
  167.   --debug " hide.."
  168.   set glHideSprite =[29, 30,31,32,33,34,35,36,37,38,39,45]
  169.   repeat with i= 1 to count (glHideSprite)
  170.     set the visible of sprite getAt (glHideSprite, i) to false
  171.   end repeat
  172.   
  173.   updatestage
  174.   
  175.   --debug "  listen"
  176.   -- erzeuge eine Liste, dei fⁿr jeden sprite die orginal CastNummer
  177.   -- zuerst  alles auf 0 
  178.   set glSpriteRoll = [0,0,0,0,0,0,0,0,0,0  ,0,0,0,0,0,0,0,0,0,0,¼
  179.       0,0,0,0,0,0,0,0,0,0  ,0,0,0,0,0,0,0,0,0,0  ,0,0,0,0,0,0,0,0]
  180.   
  181.   set glCastOfSprite = [0,0,0,0,0,0,0,0,0,0  ,0,0,0,0,0,0,0,0,0,0,¼
  182.       0,0,0,0,0,0,0,0,0,0  ,0,0,0,0,0,0,0,0,0,0  ,0,0,0,0,0,0,0,0]
  183.   
  184.   -- fⁿr ISDN und TONLINE getrennt
  185.   
  186.   if gbISDN = false then 
  187.     set glOrigOfSprite = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,¼
  188.       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,¼
  189.       0, 0, 0, 0, 0, 316, 319, 322, 391, 311,¼
  190.      312, 313, 314, 331, 334, 340, 337, 349, 385, 358,¼
  191.     364, 370, 376, 396, 399, 327, 0, 0]
  192.   else
  193.     --set glOrigOfSprite = glCastOfSprite
  194.     set glOrigOfSprite = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,¼
  195.       0, 0, 0, 0, 0, 0, 0, 0, 0, 0,¼
  196.       0, 0, 0, 0, 0, 410, 413, 416, 391, 0,¼
  197.      401, 402, 403, 0, 404, 340, 337, 349, 385, 0,¼
  198.     420, 426, 432, 447, 450, 407,0, 0]
  199.   end if
  200.   
  201.   
  202.   
  203.   --debug "  spriteroll"
  204.   
  205.   -- jetzt cast nur auf orginal
  206.   repeat with i= 1 to 48 
  207.     put GetAt (glOrigOfSprite, i) into x
  208.     setAt glCastOfSprite, i , x
  209.   end repeat
  210.   
  211.   
  212.   
  213.   -- einzeln die gewⁿnschten sprites setzen, die aktiv werden
  214.   -- vor, rⁿck,inhalt
  215.   setAt glSpriteRoll, 26, 1
  216.   setAt glSpriteRoll, 27, 1
  217.   setAt glSpriteRoll, 28, 1
  218.   
  219.   -- buttons auf slider
  220.   setAt glSpriteRoll, 34, 1
  221.   setAt glSpriteRoll, 35, 1
  222.   setAt glSpriteRoll, 36, 1
  223.   setAt glSpriteRoll, 37, 1
  224.   setAt glSpriteRoll, 38, 1
  225.   setAt glSpriteRoll, 39, 1
  226.   set the constraint of sprite 39 to 29  -- linie fⁿr regler
  227.   
  228.   
  229.   -- die SliderCheck Buttons,2= sonder funktion
  230.   if gbISDN = false then
  231.     setAt glSpriteRoll, 40, 2  --tonsline inst
  232.   end if
  233.   
  234.   setAt glSpriteRoll, 41, 2
  235.   setAt glSpriteRoll, 42, 2
  236.   setAt glSpriteRoll, 43, 2
  237.   
  238.   setAt glSpriteRoll, 44, 1
  239.   setAt glSpriteRoll, 45, 1
  240.   setAt glSpriteRoll, 46, 1 -- ende
  241.   
  242.   
  243.   -- status der buttons 
  244.   -- 0 = Nicht sichtbar, 1 =sichtbar, 2..5 = Buttons
  245.   -- index =1 .. 4 fⁿr die slider
  246.   repeat with i= 1 to 4
  247.     append glStatus, 0
  248.   end repeat
  249.   set giSliderID = 0
  250.   
  251.   
  252.   -- ==================  global script !!! ==================
  253.   -- Die Aktioen die im MausUp/Down Script aufgerufen werden
  254.   -- liegen im script 306
  255.   
  256.   --set the mouseDownScript  to  "MyMouseDown"
  257.   --set the mouseUpScript  to  "MyMouseUp"
  258.   
  259.   -- ------------------------------------------------------
  260.   
  261.   --debug "  actionprocs"
  262.   
  263.   repeat with i= 1 to 48  
  264.     append glAction, "DummyAction"   -- init mit dummy
  265.   end repeat
  266.   -- jetzt einzeln setzen
  267.   setAt glAction, 25,"Check" --dummy
  268.   
  269.   setAt glAction, 26,"GoPrev"
  270.   setAt glAction, 27,"GoNext"
  271.   setAt glAction, 28,"GoMenu"
  272.   
  273.   setAt glAction, 34,"Install"
  274.   setAt glAction, 35,"Antrag"
  275.   setAt glAction, 36,"SetAutoNein"
  276.   setAt glAction, 37,"SetAutoJa"
  277.   setAt glAction, 38,"SetSound"      -- an/aus
  278.   setAt glAction, 39,"SetSndLevel"   --regler
  279.   
  280.   if gbISDN = false then
  281.     setAt glAction, 40,"escInst"
  282.   end if
  283.   
  284.   setAt glAction, 41,"escAntrag"
  285.   setAt glAction, 42,"escAuto"
  286.   setAt glAction, 43,"escSound"
  287.   
  288.   --setAt glAction, 44,"EinsInfo"
  289.   
  290.   setAt glAction, 46,"Finished"
  291.   
  292.   
  293.   --debug "  hide48"
  294.   -- ⁿbergelagerter sprite
  295.   -- evtl. mit spritebox kleiner machen
  296.   
  297.   set ok = not (the moviename contains "MENU")
  298.   if (the castnum of sprite 48 > 0) and ok then
  299.     puppetsprite 48 , true
  300.     --set the castnum of sprite 48 to 395
  301.     set the visible of sprite 48 to false
  302.     updatestage
  303.   end if
  304.   
  305.   --debug "init ok"
  306. end initscreen
  307.  
  308.  
  309. -- ************************************************************
  310. on ResetScreen
  311.   -- in stop movie
  312.   
  313.   --debug "------ STOP MOVIE --------------"
  314.   
  315.   if count (glOrigOfSprite) > 47 then
  316.     -- nur wenn init screen vorher
  317.     repeat with i= 26 to 46 
  318.       put GetAt(glOrigOfSprite, i) into x
  319.       set the castnum of sprite i = x
  320.     end repeat
  321.     updatestage
  322.   end if
  323.   
  324.   repeat with i= 26 to 46 
  325.     if the puppet of sprite i = true then
  326.       puppetsprite i, false  
  327.     end if
  328.   end repeat
  329.   
  330.   unload
  331.   Sound Stop 1
  332.   set the volume of sound 1 to 255
  333.   
  334.   Sound Stop 2
  335.   set the volume of sound 2 to 255
  336.   
  337.   puppetsound 0
  338.   
  339.   ClearSystem  -- dll's
  340.   ResetTheMac
  341.   --debug "Memory: " & the freebytes / 1024
  342.   
  343.   
  344. end ResetScreen
  345.  
  346.  
  347. -- ************************************************************
  348. -- ************************************************************
  349. on ResetScreen2
  350.   -- in stop movie
  351.   
  352.   --debug "------ STOP MOVIE --------------"
  353.   
  354.   if count (glOrigOfSprite) > 47 then
  355.     -- nur wenn init screen vorher
  356.     repeat with i= 26 to 46 
  357.       put GetAt(glOrigOfSprite, i) into x
  358.       set the castnum of sprite i = x
  359.     end repeat
  360.     updatestage
  361.   end if
  362.   
  363.   repeat with i= 26 to 46 
  364.     if the puppet of sprite i = true then
  365.       puppetsprite i, false  
  366.     end if
  367.   end repeat
  368.   
  369.   unload
  370.   --Sound Stop 1
  371.   set the volume of sound 1 to 255
  372.   
  373.   --Sound Stop 2
  374.   set the volume of sound 2 to 255
  375.   
  376.   --puppetsound 0
  377.   
  378.   ClearSystem  -- dll's
  379.   ResetTheMac
  380.   --debug "Memory: " & the freebytes / 1024
  381.   
  382.   
  383. end ResetScreen
  384.  
  385.  
  386. -- ************************************************************
  387. on InitBsFrame 
  388.   -- Roll=true, falls rollover screen
  389.   
  390.   global glBsListe, glBsFrame, gbAnimation, gbInitFrame
  391.   
  392.   set glBsFrame = []
  393.   repeat with i = 1 to count (glBsListe)
  394.     put getAt (glBsListe, i) into x
  395.     append glBsFrame, label (x)  -- frame nummer des labels  
  396.   end repeat
  397.   -- dmit das nur einmal aufgerufen wird
  398.   set gbInitFrame = true 
  399. end
  400.  
  401.  
  402.  
  403. -- ************************************************************
  404. on SetData x
  405.   -- Austausch zwischen Movies
  406.   -- ⁿber extra proc, damit die adten evtl auch in eine datei
  407.   -- zwischen gespeichert werden k÷nnen
  408.   
  409.   put x into gsData
  410. end
  411.  
  412.  
  413. -- ************************************************************
  414. on GetData 
  415.   return gsData  -- which is global btw.
  416.   
  417. end
  418.  
  419.  
  420. -- ************************************************************
  421.  
  422. on InitPath
  423.   -- redefinition der pafdnamen der castmember
  424.   -- auf den MoviePath
  425.   
  426.   global gsSoundPath
  427.   
  428.   
  429.   
  430.   
  431.   repeat with i= 1 to the number of castMembers
  432.     put the castType of cast i into ty
  433.     
  434.     if ty = #sound then
  435.       put the filename of cast i into x
  436.       put ExtractFile (x)  into y
  437.       set y =  gsMoviePath & "sound\" & y & ".aif"
  438.       set the filename of cast i = y
  439.     end if
  440.     
  441.     if ty = #digitalVideo then
  442.       put the filename of cast i into x
  443.       put ExtractFile (x)  into y
  444.       set y =  gsMoviePath & "video\" & y
  445.       set the filename of cast i = y
  446.     end if
  447.   end repeat
  448. end InitPath
  449.  
  450.  
  451. -- ************************************************************
  452.  
  453. on ExtractFile x
  454.   set p=0
  455.   set y = ""
  456.   -- letztes \ suchen
  457.   repeat with i = 1 to length(x)
  458.     if (char i of x = "\") or (char i of x = ":") then set p = i
  459.   end repeat
  460.   
  461.   set j=0
  462.   repeat with i = p+1 to length(x)
  463.     set j = j +1
  464.     put char i of x  into char j of y 
  465.   end repeat
  466.   return y
  467. end
  468.  
  469.  
  470.  
  471. on CheckBsIni 
  472.   global gsLastMovie
  473.   
  474.   set ok = 0
  475.   if gsLastMovie = the moviename then
  476.     set ok = 1
  477.   else
  478.     set gsLastMovie = the movieName
  479.   end if
  480.   return ok
  481. end
  482.