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
Toggle Static Property of a Flash Member
cXtraSoundRec
Install QuickTime
Image Magnify
Space Invaders
Light Up
Number of Days in a Month
Foundation Director 8.5
Set ButtonsEnabled Property of a Flash Cast member
FlashMaster
 

 

 

Behavior Video Status bar

Added on 6/30/2004

 

Compatibilities:
D8 D8_5 D9

This item has not yet been rated

Author: Raschko

This script will display the name, duration and the current running time of a movie sprite. This is easy to implement since it only requires three text fields.

Download PC Source
-- 30 June 2004, written By Brian Raschko

-- variables -- globals
global myVideoMember
global myTempo
global myTotalTime

-- variables -- property box specific
property description
property spritenum
property mySprite

property myName
property myDuration
property myCurrentTime

------------------
-- Main Scripts --
------------------

on beginSprite me
  
  mySprite = sprite(me.spritenum) -- default sprite number
  
  myVideoMember = member(sprite(mySprite).member).name -- get my name
  myTempo = member(myVideoMember).framerate  -- get my frame rate
  myTotalTime = framesToHMS((member(myVideoMember).duration / 60),myTempo,0,1) -- get my duration in minuts
  
  member(myDuration).text = myTotalTime --set my duration
  member(myName).text = myVideoMember  --set my name  
  
end beginSprite

on exitFrame
  
  if member(myVideoMember).type <> #bitmap then -- check
    
    startTimer
    
    if the timer < 60 then -- count every second
      
      member(myCurrentTime).text = framesToHMS((sprite(mySprite).movieTime / 60),myTempo,0,1) -- get my current time
      
    end if
    
  end if
  
end exitFrame
---------------------------------
-- Property "Pop-Up" Functions --
---------------------------------

on isOKToAttach (me, aSpriteType, aSpriteNum) -- What am I attached to?
  
  case aSpriteType of
    #graphic:
      return TRUE -- I can be attached to that. ( graphic = attached to a sprite )
    #script:
      return FALSE -- You can't attach ME to that!
  end case
  
end isOKToAttach

on getPropertyDescriptionList -- Open the Property "Pop-Up" Box.
  
  if the currentSpriteNum = 0 then exit -- Quit installation if not on the Timeline or a Sprite.
  
  theMember = sprite(mySprite).member --|__ My member Number
  theMemberNumber = theMember.number  --|
  
  description = [:] -- Declare the Property Variable Array.
  
  -- Add the Property Vairables.
  addprop description,#myName,       [#comment: "What contains my name?",         #format: #field, #default: "URL" ]
  addprop description,#myDuration,   [#comment: "What contains my Duration?",     #format: #field, #default: "URL" ]
  addprop description,#myCurrentTime,[#comment: "What contains my current time?", #format: #field, #default: "URL" ]
  
  -- Display these Variables.
  return description
  
end getPropertyDescriptionList

------------------------
-- Script Description --
------------------------

on getBehaviorDescription me
  RETURN
  "Video Progess Bar:" & RETURN & RETURN &
  "Parameters: " & RETURN &
  "    *The members name container." & RETURN &
  "    *The members duration container." & RETURN &
  "    *The members current timer container." & RETURN & RETURN &
  QUOTE & "This script requires three text fields." & QUOTE
end getBehaviorDescription

 


Contact

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

Send e-mail