5 Replies Latest reply on Feb 4, 2014 3:59 PM by MaverikMS

    Auto resize a director movie

    spycatcher69 Level 1

      Dear All

      Is there a way in director to have the movie size match the resizing of the projector ,so as I make the projector large by either clicking the normal expand button or clicking and dragging the movie the sprites on the stage resize to fit the window,like some web pages.If Director cannot do this is there a plugin that can be loaded to accomplish this .

      Thank you for your time and consideration.

      Peter

        • 1. Re: Auto resize a director movie
          Chunick Level 3

          There's a recent similar post in the Basics section of this forum... check it out here: http://forums.adobe.com/thread/608846?tstart=0

          • 2. Re: Auto resize a director movie
            spycatcher69 Level 1

            Thank you Joshua for your reply

            I pasted the code for the resize movie into my Director 11 movie as a movie script I keep getting a syntax error of script error :Operand expected symbollist =[\              "from utility handlers code area"

            Code below from link ,also is all this code for one movie clip script or does it need to be split up .

            I am a bit overwhelmed by all this code

            Is there a simpler solutrion say an addon I can purchase that would do this.

            All the best peter

             

            -- STRETCH ON RESIZE --
            --
            -- © December 2000, James Newton <james.newton( at )openspark.com>
            --
            -- Requires a movie script with the handlers:
            --
            --   on activateWindow()
            --     (the activeWindow).windowType = 8 -- Zoomable:12, resizable:0
            --   end resizeWindow
            --
            --   on resizeWindow()
            --     sendAllSprites(#reposition, (the activeWindow).rect)
            --   end
            --
            --   on zoomWindow()
            --     sendAllSprites(#reposition, (the activeWindow).rect)
            --   end

             

             

             

            -- PROPERTY DECLARATIONS --

             

            property spriteNum
            --
            property stretchFrom   -- #topLeft | #center | #regPoint
            property widthMode     -- #fixed | #ratio | #ignore
            property minimumWidth  -- <integer>
            property maximumWidth  -- <integer>
            property heightMode    -- #fixed | #ratio | #ignore
            property minimumHeight -- <integer>
            property maximumHeight -- <integer>
            property sourceWidth
            property sourceHeight
            --
            property mySprite      -- sprite(spriteNum)
            property myMember      -- sprite(spriteNum).member
            property myType        -- sprite(spriteNum).member.type
            --
            property myFixedPoint  -- point from which the sprite stretches
            property myLeftRatio   -- proportion of stage to left of myFixedPoint
            property myWidthData   -- proportion of stage to right of myFixedPoint
            property myTopRatio    -- proportion of stage above myFixedPoint
            property myHeightData  -- proportion of stage below myFixedPoint

             

             

             

            -- EVENT HANDLERS --

             

            on beginSprite(me)
              me.initialize()
            end beginSprite

             

             

             

            -- PUBLIC METHODS --

             

            on reposition(me, newStageRect)
              stageWidth  = newStageRect.right - newStageRect.left
              stageHeight = newStageRect.bottom - newStageRect.top
             
              case stretchFrom of
                #topLeft:
                  leftToRight = stageWidth - mySprite.left
                  topToBottom = stageHeight - mySprite.top
                 
                  case widthMode of
                    #ratio:
                      newWidth  = leftToRight * myWidthData
                    #fixed:
                      newWidth  = leftToRight - myWidthData
                    #ignore:
                      newWidth  = sourceWidth
                  end case
                 
                  case heightMode of
                    #ratio:
                      newHeight = topToBottom * myHeightData
                    #fixed:
                      newHeight = topToBottom - myHeightData
                    #ignore:
                      newHeight = sourceHeight
                  end case
                 
                  newWidth   = max(minimumWidth, min (newWidth, maximumWidth))
                  newHeight  = max(minimumHeight, min(newHeight, maximumHeight))
                 
                  bottomLeft = myFixedPoint + [newWidth, newHeight]
                  spriteRect = rect(myFixedPoint, bottomLeft)
                 
                #center:
                #regPoint:
              end case
             
              me.setRect(spriteRect)
            end reposition

             

             

             


            -- PRIVATE METHODS --

             

            on initialize(me)
              mySprite    = sprite(spriteNum)
              myMember    = mySprite.member
              myType      = myMember.type
             
              -- Convert localized string parameter to symbol
              stretchFrom = (me.getSymbolList(#fixed)).getOne(stretchFrom)
              widthMode   = (me.getSymbolList(#mode)).getOne(widthMode)
              heightMode  = (me.getSymbolList(#mode)).getOne(heightMode)
             
              stageRect   = (the activeWindow).sourceRect
              stageWidth  = stageRect.width
              stageHeight = stageRect.height
             
              case stretchFrom of
                #topLeft:
                  myFixedPoint  = point(mySprite.left, mySprite.top)
                  leftToRight   = stageWidth - mySprite.left
                  topToBottom   = stageHeight - mySprite.top
                  case widthMode of
                    #ratio:
                      myWidthData  = sourceWidth / float(leftToRight)
                    #fixed:
                      myWidthData  = leftToRight - sourceWidth
                  end case
                 
                  case heightMode of
                    #ratio:
                      myHeightData = sourceHeight / float(topToBottom)
                    #fixed:
                      myHeightData = topToBottom - sourceHeight
                  end case
                 
                #center:
                  centreH = (mySprite.left + mySprite.right) / 2
                  centreV = (mySprite.top + mySprite.bottom) / 2
                  myFixedPoint = point(centreH, centreV)
                #regPoint:
                  myFixedPoint = mySprite.loc
              end case
             
              if stageRect <> (the activeWindow).rect then
                me.reposition((the activeWindow).rect)
              end if
            end initialize

             

             

             

            on setRect(me, spriteRect)
              case myType of
                #field, #text:
                  if myMember.boxType = #scroll then
                    memberRect = spriteRect - [0, 0, 16, 0]
                  else
                    memberRect = spriteRect
                  end if
                 
                  myMember.rect = memberRect
                  mySprite.rect = spriteRect
                otherwise
                  mySprite.rect = spriteRect
              end case
            end setRect

             

             

             


            -- UTILITY HANDLERS --

             

            on getSymbolList(me, whichList, returnAsLinearList)
              case whichList of
                #fixed:
                  symbolList = [ \
            #topLeft:  "top left", \
            #center:   "centre", \
            #regPoint: "bottom" \
            ]
                #mode:
                  symbolList = [ \
            #fixed:  "to maintain a fixed distance from the edge", \
            #ratio:  "as a proportion of the stage size", \
            #ignore: "don't stretch" \
            ]
              end case
             
              if returnAsLinearList then
                temp = symbolList
                symbolList = []
                i = temp.count
                repeat while i
                  symbolList[i] = temp[i]
                  i = i - 1
                end repeat
              end if
             
              return symbolList
            end getSymbolLists

             

             

             


            -- BEHAVIOR DESCRIPTION AND PARAMETERS --

             

            on getPropertyDescriptionList(me)
              propertiesList = [:]
             
              if the currentSpriteNum then
                spriteRect   = sprite(the currentSpriteNum).rect
                spriteWidth  = spriteRect.width
                spriteHeight = spriteRect.height
              else
                spriteWidth  = 1
                spriteHeight = 1
              end if
             
              fixedList = me.getSymbolList(#fixed, 1)
              modeList  = me.getSymbolList(#mode,  1)
             
              propertiesList[ \
            #stretchFrom] = [ \
            #comment: "Stretch sprite from:", \
            #format:  #symbol, \
            #range:   fixedList, \
            #default: fixedList[1] \
            ]
              propertiesList[ \
            #widthMode] = [ \
            #comment: "Stretch horizontally:", \
            #format:  #string, \
            #range:   modeList, \
            #default: modeList[1] \
            ]
              propertiesList[ \
            #minimumWidth] = [ \
            #comment: "Minimum width:", \
            #format:  #integer, \
            #range:  [#min: 0, #max: spriteWidth], \
            #default: 0 \
            ]
              propertiesList[ \
            #maximumWidth] = [ \
            #comment: "Maximum width:", \
            #format:  #integer, \
            #range:  [#min: spriteWidth, #max: 1200], \
            #default: 1200 \
            ]
              propertiesList[ \
            #heightMode] = [ \
            #comment: "Stretch vertically:", \
            #format:  #string, \
            #range:   modeList, \
            #default: modeList[1] \
            ]
              propertiesList[ \
            #minimumHeight] = [ \
            #comment: "Minimum height:", \
            #format:  #integer, \
            #range:  [#min: 0, #max: spriteHeight], \
            #default: 0 \
            ]
              propertiesList[ \
            #maximumHeight] = [ \
            #comment: "Maximum height:", \
            #format:  #integer, \
            #range:  [#min: spriteHeight, #max: 960], \
            #default: 960 \
            ]
              propertiesList[ \
            #sourceWidth] = [ \
            #comment: "(source width)", \
            #format:  #integer, \
            #range:  [#min: spriteWidth, #max: spriteWidth], \
            #default: spriteWidth \
            ]
              propertiesList[ \
            #sourceHeight] = [ \
            #comment: "(source height):", \
            #format:  #integer, \
            #range:  [#min: spriteHeight, #max: spriteHeight], \
            #default: spriteHeight \
            ]
             
              return propertiesList
            end getPropertyDescriptionList

             

             

             

            on getBehaviorTooltip(me)
              return \
            "Changes the width and height"&RETURN&\
            "of a sprite in proportion to"&RETURN&\
            "the size of the active window."
            end getBehaviorTooltip

             

             

             

            on getBehaviorDescription(me)
              return \
            "STRETCH ON RESIZE"&RETURN&RETURN&\
            "Changes the width and height of a sprite in proportion to the size of the active window."
            end getBehaviorDescription

             

            Message was edited by: James Newton

            • 3. Re: Auto resize a director movie
              Chunick Level 3

              I have never used James Newton's resizing scripts. I was simply pointing out a recent and similar post which might help you.

              • 4. Re: Auto resize a director movie
                spycatcher69 Level 1

                Thanks Joshua for your assitance I will try and contact the writer of the script for help.

                Best Regards Peter

                • 5. Re: Auto resize a director movie
                  MaverikMS Level 1

                  Have You found an solution ? I would be happy if you can share it, I have to solve the same Problem.