director制作课件,想插入个视频做片头,大约五十秒,每次测试一下就过去了,片头都没播放完,这
director制作课件,想插入个视频做片头,大约五十秒,每次测试一下就过去了,片头都没播放完,这怎么解决,谢谢大神...
director制作课件,想插入个视频做片头,大约五十秒,每次测试一下就过去了,片头都没播放完,这怎么解决,谢谢大神
展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
展开全部
加入一个控制按钮就可以了。
property waitforClick
property waitforKey
property myWaitState -- flag for whether wait conditions are met
property myTimer -- used to cycle the wait cursor
property myCursorFlag -- keeps track of which cursor to use
-- SPRITE HANDLERS
on new (me)
myWaitState = #waiting -- initialize wait state
-- create cursors
me.makeWaitCursor ("Wait Up Cursor")
me.makeWaitCursor ("Wait Up Mask")
me.makeWaitCursor ("Wait Down Cursor")
me.makeWaitCursor ("Wait Down Mask")
-- initialize cursor timing and cycle
myTimer = the milliseconds
myCursorFlag = 1
end new
on beginSprite (me)
-- check to make sure that at least one wait option is set
if not (waitforClick or waitforKey) then myWaitState = #continue
end beginSprite
on endSprite
-- reset cursor when playback head leaves frame
cursor 0
end endSprite
-- EVENT HANDLERS
on exitFrame (me)
-- look for mouse press and continue if true
if waitforClick then
if the mouseDown then myWaitState = #continue
end if
-- look for a key event and continue if true
if waitforKey then
if the keypressed <> EMPTY then myWaitState = #continue
end if
if myWaitState = #waiting then
-- check to see whether enough time has elapsedm to cycle cursor
currentTime = the milliseconds
if currentTime - myTimer > 500 then
-- half a second has elapsed
-- update the timer
myTimer = currentTime
-- switch the cursor state
myCursorFlag = not myCursorFlag
-- set the cursor to appropriate cast member and mask
if myCursorFlag then
cursor [member ("Wait Up Cursor").number, \
member ("Wait Up Mask").number]
else
cursor [member ("Wait Down Cursor").number, \
member ("Wait Down Mask").number]
end if
end if
-- hold playback head in current frame
go the frame
end if
end exitFrame
-- CUSTOM HANDLERS
on makeWaitCursor (me, cursorType)
-- make sure the correct data is being passed to the routine
case cursorType of
"Wait Up Cursor", \
"Wait Up Mask", \
"Wait Down Cursor", \
"Wait Down Mask":
-- check to see whether image already exists, if it is,
-- then don't do anything
if member (cursorType).number = -1 then
-- create a new cursor cast member
cursorMember = new (#bitmap, castLib 1)
-- name the cast member
cursorMember.name = cursorType
-- set the image size and depth
cursorMember.image = image (16, 16, 1)
-- set the registration point
cursorMember.regPoint = point (8, 12)
-- set drawstring equal to a hexadecimal representation of the
-- appropriate image
case cursorType of
"Wait Up Cursor":
drawString = \
"000000000000000008081C1C0E38077003E001C0008000000000000000000000"
"Wait Up Mask":
drawString = \
"00000000101038387C6C76DC3BB81D700EE007C0038000000000000000000000"
"Wait Down Cursor":
drawString = \
"0000008000801084088804900220000008081C1C0E38077003E001C000800000"
"Wait Down Mask":
drawString = \
"01C001C03BEE5FFD6FFB37F41BEC3DDE3FEE37DE3BBC1D780EF007E003C00180"
end case
-- hexOrdinal is used to convert the hex numbers to decimal values
hexOrdinal = "0123456789ABCDEF"
-- cycle through the rows of the image
repeat with i = 0 to 15
-- each of the rows of the image is represented by two
-- pairs of hexadecimal characters
-- each pair of controls 8 pixels of the line
repeat with drawSection = 0 to 1
-- extract the two-character portion of the hex string
drawLine = chars (drawString, i * 4 + 1 + 2 * drawSection, \
i * 4 + 2 + 2 * drawSection)
-- set an offset for the section of the row being drawn
drawOffset = 8 * drawSection
-- convert the value of the two-character hex value to
-- a decimal value (ranging from 0 to 255)
drawValue = (offset (char 1 of drawLine, hexOrdinal) - 1) * 16 + \
(offset (char 2 of drawLine, hexOrdinal) - 1)
-- the image begins with white pixels
-- these lines determine which pixels should be drawn
-- with black pixels
if drawValue > 127 then
cursorMember.image.setPixel (0 + drawOffset, i, 1)
drawValue = drawValue - 128
end if
if drawValue > 63 then
cursorMember.image.setPixel (1 + drawOffset, i, 1)
drawValue = drawValue - 64
end if
if drawValue > 31 then
cursorMember.image.setPixel (2 + drawOffset, i, 1)
drawValue = drawValue - 32
end if
if drawValue > 15 then
cursorMember.image.setPixel (3 + drawOffset, i, 1)
drawValue = drawValue - 16
end if
if drawValue > 7 then
cursorMember.image.setPixel (4 + drawOffset, i, 1)
drawValue = drawValue - 8
end if
if drawValue > 3 then
cursorMember.image.setPixel (5 + drawOffset, i, 1)
drawValue = drawValue - 4
end if
if drawValue > 1 then
cursorMember.image.setPixel (6 + drawOffset, i, 1)
drawValue = drawValue - 2
end if
if drawValue > 0 then
cursorMember.image.setPixel (7 + drawOffset, i, 1)
end if
end repeat
end repeat
end if
end case
end makeWaitCursor
--BEHAVIOR DESCRIPTION BLOCK
on isOKToAttach (me, aSpriteType, aSpriteNum)
-- can only be attached to script channel
if aSpriteType = #script then
isOK = TRUE
else
isOK = FALSE
end if
return isOK
end isOKToAttach
on getPropertyDescriptionList (me)
props = [:]
props[#waitforClick] = [ \
#comment: "Wait for Click", \
#format: #boolean, \
#default: TRUE]
props[#waitforKey] = [ \
#comment: "Wait for Keypress", \
#format: #boolean, \
#default: TRUE]
return props
end getPropertyDescriptionList
on getBehaviorTooltip (me)
return \
"Use as a frame behavior." & RETURN & RETURN & \
"Holds the playback head in the current frame until either a mouse click or a key press."
end getBehaviorTooltip
on getBehaviorDescription (me)
return \
"WAIT FOR MOUSE CLICK OR KEYPRESS" & RETURN & RETURN & \
"Drop this behavior onto the Stage or into the Script Channel of the Score to hold the playback head in the current frame until the mouse button is clicked or a key is pressed." & RETURN & RETURN & \
"PARAMETERS:" & RETURN & \
"* Wait for Click - determines whether a mouse click will make the movie continue" & RETURN & \
"* Wait for Key - determines whether a key press will make the movie continue"
end getBehaviorDescription
property waitforClick
property waitforKey
property myWaitState -- flag for whether wait conditions are met
property myTimer -- used to cycle the wait cursor
property myCursorFlag -- keeps track of which cursor to use
-- SPRITE HANDLERS
on new (me)
myWaitState = #waiting -- initialize wait state
-- create cursors
me.makeWaitCursor ("Wait Up Cursor")
me.makeWaitCursor ("Wait Up Mask")
me.makeWaitCursor ("Wait Down Cursor")
me.makeWaitCursor ("Wait Down Mask")
-- initialize cursor timing and cycle
myTimer = the milliseconds
myCursorFlag = 1
end new
on beginSprite (me)
-- check to make sure that at least one wait option is set
if not (waitforClick or waitforKey) then myWaitState = #continue
end beginSprite
on endSprite
-- reset cursor when playback head leaves frame
cursor 0
end endSprite
-- EVENT HANDLERS
on exitFrame (me)
-- look for mouse press and continue if true
if waitforClick then
if the mouseDown then myWaitState = #continue
end if
-- look for a key event and continue if true
if waitforKey then
if the keypressed <> EMPTY then myWaitState = #continue
end if
if myWaitState = #waiting then
-- check to see whether enough time has elapsedm to cycle cursor
currentTime = the milliseconds
if currentTime - myTimer > 500 then
-- half a second has elapsed
-- update the timer
myTimer = currentTime
-- switch the cursor state
myCursorFlag = not myCursorFlag
-- set the cursor to appropriate cast member and mask
if myCursorFlag then
cursor [member ("Wait Up Cursor").number, \
member ("Wait Up Mask").number]
else
cursor [member ("Wait Down Cursor").number, \
member ("Wait Down Mask").number]
end if
end if
-- hold playback head in current frame
go the frame
end if
end exitFrame
-- CUSTOM HANDLERS
on makeWaitCursor (me, cursorType)
-- make sure the correct data is being passed to the routine
case cursorType of
"Wait Up Cursor", \
"Wait Up Mask", \
"Wait Down Cursor", \
"Wait Down Mask":
-- check to see whether image already exists, if it is,
-- then don't do anything
if member (cursorType).number = -1 then
-- create a new cursor cast member
cursorMember = new (#bitmap, castLib 1)
-- name the cast member
cursorMember.name = cursorType
-- set the image size and depth
cursorMember.image = image (16, 16, 1)
-- set the registration point
cursorMember.regPoint = point (8, 12)
-- set drawstring equal to a hexadecimal representation of the
-- appropriate image
case cursorType of
"Wait Up Cursor":
drawString = \
"000000000000000008081C1C0E38077003E001C0008000000000000000000000"
"Wait Up Mask":
drawString = \
"00000000101038387C6C76DC3BB81D700EE007C0038000000000000000000000"
"Wait Down Cursor":
drawString = \
"0000008000801084088804900220000008081C1C0E38077003E001C000800000"
"Wait Down Mask":
drawString = \
"01C001C03BEE5FFD6FFB37F41BEC3DDE3FEE37DE3BBC1D780EF007E003C00180"
end case
-- hexOrdinal is used to convert the hex numbers to decimal values
hexOrdinal = "0123456789ABCDEF"
-- cycle through the rows of the image
repeat with i = 0 to 15
-- each of the rows of the image is represented by two
-- pairs of hexadecimal characters
-- each pair of controls 8 pixels of the line
repeat with drawSection = 0 to 1
-- extract the two-character portion of the hex string
drawLine = chars (drawString, i * 4 + 1 + 2 * drawSection, \
i * 4 + 2 + 2 * drawSection)
-- set an offset for the section of the row being drawn
drawOffset = 8 * drawSection
-- convert the value of the two-character hex value to
-- a decimal value (ranging from 0 to 255)
drawValue = (offset (char 1 of drawLine, hexOrdinal) - 1) * 16 + \
(offset (char 2 of drawLine, hexOrdinal) - 1)
-- the image begins with white pixels
-- these lines determine which pixels should be drawn
-- with black pixels
if drawValue > 127 then
cursorMember.image.setPixel (0 + drawOffset, i, 1)
drawValue = drawValue - 128
end if
if drawValue > 63 then
cursorMember.image.setPixel (1 + drawOffset, i, 1)
drawValue = drawValue - 64
end if
if drawValue > 31 then
cursorMember.image.setPixel (2 + drawOffset, i, 1)
drawValue = drawValue - 32
end if
if drawValue > 15 then
cursorMember.image.setPixel (3 + drawOffset, i, 1)
drawValue = drawValue - 16
end if
if drawValue > 7 then
cursorMember.image.setPixel (4 + drawOffset, i, 1)
drawValue = drawValue - 8
end if
if drawValue > 3 then
cursorMember.image.setPixel (5 + drawOffset, i, 1)
drawValue = drawValue - 4
end if
if drawValue > 1 then
cursorMember.image.setPixel (6 + drawOffset, i, 1)
drawValue = drawValue - 2
end if
if drawValue > 0 then
cursorMember.image.setPixel (7 + drawOffset, i, 1)
end if
end repeat
end repeat
end if
end case
end makeWaitCursor
--BEHAVIOR DESCRIPTION BLOCK
on isOKToAttach (me, aSpriteType, aSpriteNum)
-- can only be attached to script channel
if aSpriteType = #script then
isOK = TRUE
else
isOK = FALSE
end if
return isOK
end isOKToAttach
on getPropertyDescriptionList (me)
props = [:]
props[#waitforClick] = [ \
#comment: "Wait for Click", \
#format: #boolean, \
#default: TRUE]
props[#waitforKey] = [ \
#comment: "Wait for Keypress", \
#format: #boolean, \
#default: TRUE]
return props
end getPropertyDescriptionList
on getBehaviorTooltip (me)
return \
"Use as a frame behavior." & RETURN & RETURN & \
"Holds the playback head in the current frame until either a mouse click or a key press."
end getBehaviorTooltip
on getBehaviorDescription (me)
return \
"WAIT FOR MOUSE CLICK OR KEYPRESS" & RETURN & RETURN & \
"Drop this behavior onto the Stage or into the Script Channel of the Score to hold the playback head in the current frame until the mouse button is clicked or a key is pressed." & RETURN & RETURN & \
"PARAMETERS:" & RETURN & \
"* Wait for Click - determines whether a mouse click will make the movie continue" & RETURN & \
"* Wait for Key - determines whether a key press will make the movie continue"
end getBehaviorDescription
更多追问追答
追问
这么复杂?是代码么?
追答
是代码。其实DIR里有现成的按钮,不用自己动手写这么多代码。
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询