Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Line Skip-Alphamania
Sound not playing in projectors
Fake-3D Motion
Macromedia Licensing
Hyper Midi
Set ViewScale Property of a Flash Sprite
Custom Radio/Check Box
Allowing Users to Skew an Image
PopUp Field
Happy Hour Fonts
 

 

 

Behavior Fix Bad Scripts

Added on 11/29/1999

 

Compatibilities:
D6_5 D7 D8 Mac PC Script

This item has not yet been rated

Author: AndyWilson

If you"ve ever come up against that director bug where all your scripts get confused about what type of script they are (ie. you get "handler not found" errors all over the place, and you can"t create new instances from your parent scripts) the usual solution is to change the scriptType of the offending scripts to something arbitrary, save and compact the movie, then change the scriptTypes back to what it should be and save the movie all over again. From Andy Wilson"s Page of tips and Tricks http://195.92.248.101:802/director

on fixScripts
  set scrpts = []
  set cntLibs = the number of castLibs
  repeat with x = 1 to cntLibs
    setAt (scrpts, x, [])
    set libScrpts = getAt (scrpts, x)
    set cntMems = the number of ¬
    members of castLib x
    if not cntMems then next repeat
    repeat with y = 1 to cntMems
      if the type of member y of ¬
      castLib x <> #empty then
        if the type of member y of ¬
        castLib x <> #script then
          set scTxt = the scriptText of ¬
          member y of castLib x
          setAt  (libScrpts, y, scTxt)
          set the scriptText of member y ¬
         of castLib x = EMPTY
        else
          set styp = the scriptType of ¬
             member y of castLib x
          if offset("on fixScripts", the ¬
      scriptText of member y of ¬
     castLib x) then
            setAt (libScrpts, y, #none)
          else
            setAt (libScrpts, y, styp)
            if styp = #movie then
              set the scriptType of member y ¬
             of castLib x = #score
            else
              set the scriptType of member y ¬
           of castLib x = #movie
            end if
          end if
        end if
      else
        setAt (libScrpts, y, #none)
      end if
    end repeat
  end repeat
  saveMovie
  set cnt = count (scrpts)
  if not cnt then exit
  repeat with x = 1 to cnt
    set minLst = getAt (scrpts, x)
    set cnt2 = count (minLst)
    if not cnt2 then next repeat
    repeat with y = 1 to cnt2
      set val = getAt (minLst, y)
      if val <> #none then
        if symbolP(val) then
          set the scriptType of member y ¬
          of castLib x = val
        else
          if stringP(val) then
            set the scriptText of member y
    of castLib x = val
          end if
        end if
      end if
    end repeat
  end repeat
  saveMovie
end

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail