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
CatEffects pack
OSControl Xtra Review
Robin Hood Xtra
To activate previous instance and quit
Copy My Text
Curve Sprite - Move a sprite along a curved path.
Spawn
Director 7 and Lingo Authorized
Moving Bevel Light-Alphamania
Cells Xtra
 

 

 

Behavior MPEG / ActiveMovie ActiveX control

Added on 7/1/1999

 

Compatibilities:
behavior D7 D8 PC

This item has not yet been rated

Author: MediaMacros (website)

This is pretty basic, but gets the job done. Feel frree to improve upon it and modify the functionality, but it would be nice if you would send me a copy of any enhancements you make.

--Copyright 1999 Chuck Neal
--chuck@mediamacros.com
--If you find this code helpful, send me an e-mail and let me know.  :-)

property initialMovie, spriteNum, command, whenGo, movieSprite

on getPropertydescriptionList me
  p_list = [:]
  if (sprite the currentSpriteNum).member.type = #activeX then
    addProp p_list, #initialMovie, [#format : #string, #default : "mediasample.mpg", #comment : "Default Movie Relative to the Director Movie:"]
  else
    addProp p_list, #command, [#format : #symbol, #default : #PlayMovie, #range : [ #PlayMovie,#FastF,#StopPlay, #RestartMovie, #pauseMovie ], #comment : "What button is this?"]
  end if
  return p_list
end

on beginSprite me
  if (sprite spriteNum).member.type = #activeX then
    sprite(spriteNum).filename = the moviePath & initialMovie
    sprite(spriteNum).showdisplay = false
    sprite(spriteNum).showPositionControls = false
    sprite(spriteNum).showControls = false
    sprite(spriteNum).showSelectionControls = false
    sprite(spriteNum).showTracker = false
    sprite(spriteNum).autoRewind = false
    sendAllSprites(#IAmMovie, spriteNum)
    if sprite(spriteNum).autostart = true then
      command = #playMovie
    else
      command = #stopPlay
    end if
  end if  
end

on mouseUp me
  if (sprite spriteNum).member.type = #activeX then
    pass
  else
    case command of
      #PlayMovie :
        sprite(movieSprite).command = #playMovie
        run(sprite movieSprite)
      #FastF :
        sprite(movieSprite).command = #playMovie
        sprite(movieSprite).rate = 1
        run(sprite movieSprite)
      #StopPlay :
        sprite(movieSprite).command = #StopPlay
        stop(sprite movieSprite)
      #RestartMovie :
        sprite(movieSprite).command = #playMovie
        stop(sprite movieSprite)
        sprite(movieSprite).fileName = sprite(movieSprite).fileName
      #PauseMovie :
        sprite(movieSprite).command = #PauseMovie
        pause(sprite movieSprite)        
    end case
  end if
end

on mouseDown me
  if (sprite spriteNum).member.type = #activeX then
    pass
  else
    case command of
      #FastF :
        sprite(movieSprite).command = #FastF
        sprite(movieSprite).rate = 3
        put sprite(movieSprite).rate
    end case
  end if
end


on IAmMovie me, whatSprite
  movieSprite = whatSprite
end

on getBehaviorDescription me
  describe = "This is a pretty simple script to use the activeMovie ActiveX control.  You are not going to ahve as much flexibility as you would with an Xtra, but it is pretty sound for just playing back a movie." & return & "Drop this on you activeX control as well as the play,  ff, stop, pause, and restart buttons.  You may also want ot open up the activeX element and assign properties manually for things like size (double, half, etc).  Remember that the only supported sizes are double, half, quarter, etc, not odd sizes.  Also, the sprite must be set to the maximum size or larger than the movie or it will be cropped."
end

 


Contact

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

Send e-mail