3 Replies Latest reply on May 17, 2006 5:52 AM by Newsgroup_User

    How to position a MIAW before you open it

    Kevin_Boyd Level 1
      I'm using Dir 10.1 on winXP. I'm opening a MIAW and want it to be in the corner of whatever size screen they are using. The manual says I can position it before opening the MIAW but I find this does not work and I have to open it first and then move it (code below for playing a video) Downside is the window flashes up in the midlle before moving. And ideas how to resolve this?

      TIA

      Kevin

      on playVideo me
      window().new ("video")
      moviesScreen=getScreenRect()
      myR=moviesScreen[3] -- bottom Right
      myB=moviesScreen[4] -- Bottom right

      if pVideoType=#wide then -- 16:9 aspect ratio
      myWidth=800
      myHeight=450
      myLanguage=gLanguage
      window("video").filename = "videoWindowWide"
      else -- 4:3 aspect ratio
      myWidth=800
      myHeight=600
      window("video").filename = "videoWindowSquare"
      myLanguage=gLanguage
      end if

      -- move MIAW to bottom right corner of the full screen
      myX=myR-myWidth-20
      myY=myB-myHeight-35
      window("video").open()
      window("video").rect=rect(myX, myY ,myX + myWidth, myY + myHeight)

      -- tell MIAW to play relevant video
      window("video").movie.playVideo(pVideoFile,spriteNum,myLanguage)
      end



      -- return the rect of the current screen the movie is running in
      on getScreenRect
      st=_movie.stage.rect
      mon=_system.deskTopRectList

      if mon.count > 1 then -- more than 1 monitor, so find out which one it's on.
      repeat with whichMon = 1 to mon.count
      if st[1]>= mon[whichMon][1] and st[1] <mon[whichMon][3] then
      exit repeat
      end if
      end repeat
      if whichMon > mon.count then -- can't find active screen so defualt to first screen
      whichMon=1
      end if
      else
      whichMon=1
      end if

      return mon[whichMon]
      end
        • 1. Re: How to position a MIAW before you open it
          Level 7
          Assign the new window to global variable and it will work just fine.

          to open the window:
          -------------

          global newMIAW

          on mouseUp me
          newMIAW = window().new("myMIAW")
          newMIAW.fileName = "myMIAW"
          newMIAW.rect = rect(0,0,200,200)
          newMIAW.open()
          end
          --------

          and to close the window:
          ----------

          global newMIAW

          on mouseUp me
          newMIAW.close()
          newMIAW.forget()
          end
          --------

          The important part is to set the name of the window to be the same as
          the file that you are using, then set the fileName, so that there is a
          reference to an actual movie. Then you can set the rect in any way that
          you like, and finally open the window.

          --
          Rob
          _______
          Rob Dillon
          Adobe Community Expert
          http://www.ddg-designs.com
          412-243-9119

          http://www.macromedia.com/software/trial/
          • 2. Re: How to position a MIAW before you open it
            Kevin_Boyd Level 1
            Excellent that worked, many thanks.

            Though my Quicktime 6 Sorenson 3 videos do flicker for the first few frames in the MIAW, any ideas how to cure that?
            • 3. Re: How to position a MIAW before you open it
              Level 7
              Sure,

              Just place the QT sprite in the score a few frames before you need to
              use it. This is the method that I use:

              1. Reserve the first five sprite channels for digital video sprites.
              2. Place a background sprite in channel 6. This can be as simple as a
              toolbox shape that fills the stage area.
              3. Place a dv sprite 3 frames before you want to play it in the score.
              Set the dv member to be not direct to stage, and to be paused. This will
              hide the sprite behind the background sprite in channel 3.
              4. If you are jumping to the score space where the dv sprite is to play
              it, then be sure to jump to the frame where the dv sprite starts.
              5. At the frame where you want to show the dv sprite, change the direct
              to stage property to true. This will cause the dv sprite to burn through
              the background and be visible.
              6. Place a behavior on the dv sprite that will set its member's direct
              to stage property back to false in an endSprite function. This will make
              the dv sprite disappear and be ready again if it needs to be played
              again.

              This method gives the dv member time to start up its player when the
              playback head hits the sprite in the score before it begins to play.

              --
              Rob
              _______
              Rob Dillon
              Adobe Community Expert
              http://www.ddg-designs.com
              412-243-9119

              http://www.macromedia.com/software/trial/