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
Irregular Slider
Script Interface Tool
Semi-Random Bezier Animatior
SM sprite scroll
Fast Start Projector
Generic MP3 Player
TextCruncher
Home, End, Page Up, Page Down with Text Members
Volume Control Dial
Official Adobe Photoshop 5.0 Studio Techniques
 

 

 

Behavior Flash Movie Controls

Added on 8/14/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: Shehal (website)

5 types of Control Play: Plays movie at normal speed Rewind: Rewinds movie Stop: Stops and goes to the begining of the movie Pause: Pauses movie FastFwd: Plays movie at 4 times the normal speed

-- Flash Movie Controls
-- 5 types of Control
-- Play: Plays movie at normal speed
-- Rewind: Rewinds movie
-- Stop: Stops and goes to the begining of the movie
-- Pause: Pauses movie
-- FastFwd: Plays movie at 4 times the normal speed
-- visit my shockwave site
-- http://www.unixville.com/~shehal/
-- mailto: shehal@mediasolv.com
-- MediaSolv.com office login: shehal
-- wapOA login: shehal
-- visit RISSA"s site
-- http://www.geocities.com/~marissaj

property flashList
property flashSprite
property buttonAction
property flashMember
property normalRate

global flashMoviePlaying

on beginSprite me
  flashMember = sprite(flashSprite).member
  set the directToStage of flashMember = TRUE
  set the playBackMode of flashMember = #normal
  normalRate = the frameRate of flashMember
  flashMoviePlaying = FALSE
end beginSprite

on mouseUp me
  case buttonAction of
    "Play":
      if flashMoviePlaying = FALSE then
        stop sprite (flashSprite)
        set the playBackMode of flashMember = #normal
        play sprite (flashSprite)
        flashMoviePlaying = TRUE
      end if
      
    "Rewind":
      stop sprite (flashSprite)
      rewind sprite (flashSprite)
      play sprite (flashSprite)
      flashMoviePlaying = FALSE
      
    "Stop":
      stop sprite (flashSprite)
      rewind sprite (flashSprite)
      flashMoviePlaying = FALSE
      
    "Pause":      
      stop sprite (flashSprite)
      hold sprite (flashSprite)
      flashMoviePlaying = FALSE
      
  end case
end mouseUp

on mouseDown me
  if buttonAction = "FastFwd" then
    set the playBackMode of flashMember = #fixed
    stop sprite (flashSprite)
    set the fixedRate of member flashMember to (4*normalRate)
    play sprite (flashSprite)
  else
    set the playBackMode of flashMember = #normal
  end if
end mouseDown

on verifyFlash n
  return sprite (n).member.type = #Flash
end verifyFlash

on getFlashSpriteList
  flashList = []
  repeat with i = 1 to the lastChannel
    if verifyFlash (i) then
      add flashList, i
      put the type of the member of sprite (i)
    end if
  end repeat
  return flashList
end getFlashSpriteList

on mErrorAlert me, fError, fData
  fBehaviorName = string (me)
  delete word 1 of fBehaviorName
  delete the last word of fBehaviorName
  delete the last word of fBehaviorName
  case fData.ilk of
    #void: fData = ""
    #symbol: fData = "#" & fData
end case
  
  case fError of
    #getPDLError:
     return [#getPDLError: [#comment: "CANCEL: Sprite MUST be one of the following  member types:"& RETURN & fData, #format: #symbol, #range: [#Cancel], #default: #Cancel]]
   #noFlash:
     alert "No Flash sprites are currently on the screen"
end case
end fErrorAlert

on getPropertyDescriptionList me
  if not the currentSpriteNum then
    exit
  end if
  
  flashMovie = getFlashSpriteList ()
  if not flashMovie.count then
    return fErrorAlert (me, #noFlash)
  else
    PDL = [:]
    setaProp PDL, #flashSprite, [#comment: "Flash sprite channel", #format: #string, #default: flashMovie[1], #range: flashMovie]
    setaProp PDL, #buttonAction, [#comment: "Video button action", #format: #string, #default: "Play", #range: ["Rewind", "Stop", "Play", "Pause", "FastFwd"]]
    return PDL
end if
end getPropertyDescriptionList

 


Contact

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

Send e-mail