Changeset 18 for trunk/lingosource/castlib2/aleXtrasMovieScript.ls
- Timestamp:
- 10/24/08 12:12:09 (4 years ago)
- File:
-
- 1 edited
-
trunk/lingosource/castlib2/aleXtrasMovieScript.ls (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lingosource/castlib2/aleXtrasMovieScript.ls
r14 r18 1 -- LDM Xtras Moviescript -- ©05 Alex da Franca -- alex@farbflash.de1 -- aleXtrasMovieScript 2 2 --------------------------------------------------------------------- 3 4 -- Requires: 5 -- nothing 6 7 -- Purpose: 3 -- CREATED: 4 -- 2005 5 -- 6 -- PROPERTIES: 7 --!memberProperties: [#name: "aleXtrasMovieScript", #scripttype: #movie, #scriptSyntax: #lingo, #comments:"~/Documents/Scripts/lingo/aleXtrasMovieScript.ls"] 8 -- 9 -- DESCRIPTION: 10 -- -- LDM Xtras Moviescript -- c05 Alex da Franca -- alex@farbflash.de 8 11 -- store instances of scripts and bitmaps in a 'global' list (-> property pAleXtras) 9 12 -- and provide access to them for all scripts 10 11 -- Usage: 12 -- put it in one of your castlib, DON'T RENAME MEMBER !! 13 -- 14 -- REQUIRES: 15 -- script "commonmoviescript" 16 -- 17 -- USAGE: 18 -- put it in one of your castlib, DON'T RENAME THIS MEMBER !! 19 -- use xscr(<name of script as symbol>) to get a reference to the script from 20 -- every script of the movie. It will return an instance of the script 21 -- 22 -- PARAMS: 23 -- - 24 -- 25 -- RETURNS: 26 -- - 27 -- 28 -- WARNINGS: 29 -- - 30 -- 31 -- TODO: 32 -- - 33 ----------------------------------- 13 34 14 35 property pAleXtras 15 36 16 37 on mGetAleXtras 38 39 alextras = (script "aleXtrasMovieScript").pAleXtras 40 if not(objectP(alextras)) then 41 42 cms = member("commonMovieScript") 43 if ilk(cms) <> #member then 44 alert "Script commonMovieScript missing, can't proceed" 45 halt 46 end if 47 if cms.type <> #script then 48 alert "Script commonMovieScript missing, can't proceed" 49 halt 50 end if 51 alextras = rawnew(cms.script) 52 if ilk(alextras) <> #instance then 53 alert "Script" & QUOTE & "commonMovieScript" & QUOTE && "is missing. This movie can't proceed!" 54 halt 55 end if 56 (script "aleXtrasMovieScript").pAleXtras = alextras 57 end if 58 return alextras 59 ----------------------------- 60 17 61 alextras = (script "aleXtrasMovieScript").pAleXtras 18 62 if voidP(alextras) then … … 26 70 27 71 on xscr scrName 72 ----------------------------------- 73 -- CREATED: 11.02.2008 74 -- ACTION: Description 75 -- INPUT: - 76 -- RETURNS: - 77 -- CALLER: - 78 -- DEBUG: - 79 -- TODO: - 80 ----------------------------------- 81 28 82 return mGetXScript(scrName) 29 83 end … … 32 86 33 87 on mGetXScript scrName 88 ----------------------------------- 89 -- CREATED: 11.02.2008 90 -- ACTION: Description 91 -- INPUT: - 92 -- RETURNS: - 93 -- CALLER: - 94 -- DEBUG: - 95 -- TODO: - 96 ----------------------------------- 97 98 alextras = mGetAleXtras() 99 scrName = string(scrName) 100 if length(scrName) < 1 then return alextras 101 if scrName = "commonMovieScript" then return alextras 102 103 inst = alextras.mGetInstance(scrName, 1) 104 if ilk(inst) <> #instance then 105 if the runmode contains "aut" then 106 put "Script" && QUOTE & scrName & QUOTE && "is missing! This may cause unwanted behavior" 107 end if 108 inst = [] 109 end if 110 return inst 111 ---------------------- 112 113 34 114 scrName = symbol(scrName) 35 115 if ilk(scrName) <> #symbol then scrName = #commonmoviescript … … 61 141 62 142 on mLoadScripts cls 143 ----------------------------------- 144 -- CREATED: 11.02.2008 145 -- ACTION: Description 146 -- INPUT: - 147 -- RETURNS: - 148 -- CALLER: - 149 -- DEBUG: - 150 -- TODO: - 151 ----------------------------------- 152 exit 153 63 154 64 155 mediaList = mGetAleXtras() … … 106 197 on mLoadXScript whichName 107 198 199 exit 200 201 108 202 whichName = string(whichName) 109 203 if length(whichName) < 1 then return 0 … … 130 224 131 225 on mLoadScriptsFromLDM whichSprite 226 227 includes = [:] 228 229 tell sprite(whichSprite) 230 cl = the number of castlibs 231 repeat with n = 1 to cl 232 num = the number of members of castlib cl 233 repeat with m = 1 to num 234 mem = member(m,n) 235 if length(mem.name) > 0 then 236 if mem.type = #script then 237 includes.setaProp(symbol(mem.name), rawNew(mem.script)) 238 end if 239 end if 240 end repeat 241 end repeat 242 end tell 243 244 cms = includes.getaprop(#commonMovieScript) 245 if not(objectP(cms)) then 246 cms = member("commonMovieScript") 247 if ilk(cms) <> #member then 248 alert "Script commonMovieScript missing, can't proceed" 249 halt 250 end if 251 if cms.type <> #script then 252 alert "Script commonMovieScript missing, can't proceed" 253 halt 254 end if 255 cms = rawnew(cms.script) 256 end if 257 258 (script "aleXtrasMovieScript").pAleXtras = cms 259 260 globs = cms.mGetGlobalList() 261 incl = globs[#gParentScriptInstances] 262 if not(objectP(incl)) then 263 incl = [:] 264 globs[#gParentScriptInstances] = incl 265 end if 266 267 repeat with n = count(incl) down to 1 268 includes.setaprop(incl.getPropAt(n), incl[n]) 269 end repeat 270 includes.deleteOne(#commonMovieScript) 271 globs[#gParentScriptInstances] = includes 272 273 exit 274 ------------------------------ 132 275 133 276 mediaList = mGetAleXtras() … … 166 309 167 310 on mListAleXtras 311 put "Handler mListAleXtras deprecated" 312 exit 313 168 314 alextras = (script "aleXtrasMovieScript").pAleXtras 169 315 if voidP(alextras) then mLoadScripts … … 215 361 sel = the selection of castlib cl 216 362 217 delim = the last char of the applicationpath 363 364 mp = the moviepath 365 if length(mp) < 1 then 366 if the runmode contains "plug" then 367 mp = "/" 368 else 369 mp = the applicationpath 370 end if 371 end if 372 delim = the last char of mp 218 373 219 374 the itemdelimiter = "/"
Note: See TracChangeset
for help on using the changeset viewer.
