主题:  可以告诉我如何用ActiveX导入MPG吗?

loveking

职务:普通成员
等级:1
金币:0.0
发贴:117
注册:2000/12/11 19:51:06
#12001/6/5 13:36:02
可以告诉我如何用ActiveX导入MPG吗?
请写一个详细的给我好吗?谢谢,急着救命
我先行开一下,希望能够得到你的帮助



Call Me Simon

职务:普通成员
等级:2
金币:2.0
发贴:646
注册:2000/9/19 13:56:51
#22001/6/5 15:09:55

Question:
How can I play MPEG video in Director?

Answer:

There are a number of ways, no one is any better than another, and it will be different on the Mac and the PC. Having said that, here are the 4 most common solutions.

1. Use an Xtra. To see a list of currently available ones click here. This makes it easier to work with, good product support, but many are not cross platform.

2. Use ActiveX controls. This is only a solution on the PC, but a behavior to control the Microsoft Active Movie ActiveX component can be found here. Note that this is more limited than an Xtra, but is free and works well for standard playback.

3. Use QuickTime. This is another that is for one platform only. On the Mac QuickTime supports MPEG, but on the PC you are out of luck.

4. Use MCI calls. This is another PC only one, but works fairly well. Note that the playback engine is only 16 bit, so performance may not be as good as other solutions and it calls directly from the system so control is limited. Also, Microsoft no longer supports these calls. For MCI behaviors click here.

Try them out and choose what works best for you, but remember that MPEG can act differently on every platform, so test on a wide variety of machines!!


这里是所需要的behavior:

--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


由于论坛变形, 把最后一段handler 分出来, 使用时, 请同时copy 这一段。
以上内容出自:
www.mediamacros.com


To LoveKing
如果你愿意,可以帮助大家翻译过来吗?我可以帮助你校对。让我们大家来帮助大家, 好不好?

编辑历史:[这消息被flyingbird编辑过(编辑时间2001-06-05 15:14:03)]


loveking

职务:普通成员
等级:1
金币:0.0
发贴:117
注册:2000/12/11 19:51:06
#32001/6/5 15:54:18
flyingbird,首先谢谢你的信任,我会尽自己所能将这脚本翻译出来,不过需要我将提问的问题解决后
到时,不足之外,请你帮忙!
谢谢你!



zwjn

职务:普通成员
等级:1
金币:0.0
发贴:110
注册:2000/12/7 9:29:52
#42001/6/5 16:50:04
Chuk Neal 是director开发组成员,在新闻组里经常可以看到他的回答,
其实有问题时到他的网站去查大部分都是已经有回答



johnart

职务:普通成员
等级:1
金币:0.0
发贴:3
注册:2001/6/5 16:58:37
#52001/6/5 17:51:08
东西是好!!!
但就是看不懂,真希望有人给翻译过来。我这里先谢谢了!!!



johnart

职务:普通成员
等级:1
金币:0.0
发贴:3
注册:2001/6/5 16:58:37
#62001/6/5 17:52:59
上面的老兄,Chuk Neal 的网站地址给一个好吗? 谢谢!!!



zwjn

职务:普通成员
等级:1
金币:0.0
发贴:110
注册:2000/12/7 9:29:52
#72001/6/6 9:46:53
今天我有兴趣,就乱翻翻吧:)
问题:
在Director中如何播放MPEG视频?
回答:
有很多种方法,因为对于PC和MAC两种机器会有所区别所以无法比较哪一种更好。通常主要有四种解决方法。
1,使用Xtra,要查找的话请到网上去找(呵呵,因为原文是说点击连接,所以我就不翻它),这种方法很容易实现,并且有很好的技术支持,但是很多都无法做到跨平台

2,使用ActiveX,虽然这种方法只能用于PC机(ActiveX是MicroSoft在Windows里面用的一种技术,Mac机里面不存在),但是它的控制behavior在这里可以找到,注意:使用ActiveX比使用Xtra更受限制,但它是免费的并且能稳定的工作在标准环境下

3,使用QuickTime,这是对于单一平台的另外一种方法,在Mac机上QuickTime支持MPEG,在PC机上你就没那么幸运了

4,使用MCI,这种方法也是只能在PC机上使用,还算可以用,但注意到它是工作在16位模式下的,所以不会象其他方法那样稳定(既然这样我也不翻了,省得浪费我的时间)

把这几种方法都测试一下并找出最适合于你的,但要注意的是,MPEG在不同的平台下会有不同的表现,所以记得多在一些机器上测试你的程序

behavior(就不用我翻了吧