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.
------------------
-- 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" ]