OSMF AS3/FlashCS5 错误:未找到类型 [...]:StageVideoEvent
我正在使用 OSMF,即使运行一个超级简单的示例也遇到问题。
我在Arch Linux上的VirtualBox中的Win7上运行Flash CS5(只是说因为我认为这可能与底层的东西有关)。另外,我正在使用 OSMF 1.6 Sprint 1。
无论如何,我正在尝试运行这个简单的示例:
package
{
import flash.display.Sprite;
import org.osmf.containers.MediaContainer;
import org.osmf.elements.VideoElement;
import org.osmf.media.DefaultMediaFactory;
import org.osmf.media.MediaElement;
import org.osmf.media.MediaPlayer;
import org.osmf.media.URLResource;
public class OPlayer extends Sprite {
public function OPlayer() {
var filePath:String = "testvid.flv";
var resource:URLResource = new URLResource(filePath);
var mediaFactory:DefaultMediaFactory = new DefaultMediaFactory();
var mediaElement:MediaElement = mediaFactory.createMediaElement(resource);
var mediaPlayer:MediaPlayer = new MediaPlayer(mediaElement);
var mediaContainer:MediaContainer = new MediaContainer();
mediaContainer.addMediaElement(mediaElement);
addChild(mediaContainer);
}
}
}
不幸的是,我不断收到以下编译错误:
1046: Type was not found or was not a compile-time constant: StageVideoEvent.
I am playing around with OSMF and have a problem running even a super simple example.
I am running Flash CS5 on Win7 in VirtualBox on Arch Linux (just saying because I thought that this may have something to do with the underlying stuff). Also I am using OSMF 1.6 Sprint 1.
Anyways I am trying to run this simple example:
package
{
import flash.display.Sprite;
import org.osmf.containers.MediaContainer;
import org.osmf.elements.VideoElement;
import org.osmf.media.DefaultMediaFactory;
import org.osmf.media.MediaElement;
import org.osmf.media.MediaPlayer;
import org.osmf.media.URLResource;
public class OPlayer extends Sprite {
public function OPlayer() {
var filePath:String = "testvid.flv";
var resource:URLResource = new URLResource(filePath);
var mediaFactory:DefaultMediaFactory = new DefaultMediaFactory();
var mediaElement:MediaElement = mediaFactory.createMediaElement(resource);
var mediaPlayer:MediaPlayer = new MediaPlayer(mediaElement);
var mediaContainer:MediaContainer = new MediaContainer();
mediaContainer.addMediaElement(mediaElement);
addChild(mediaContainer);
}
}
}
And unfortunately I keep getting the following compile error:
1046: Type was not found or was not a compile-time constant: StageVideoEvent.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
StageVideo 上周才正式发布,您的版本可能尚未使用新的 API 进行更新。
此 PDF 包含有关将其与 Flex 一起使用的信息:http://download.macromedia.com /pub/labs/flashplayer10/flashplayer10_2_p1_releasenotes.pdf
我看到你正在使用Flash CS5,你需要一个playerglobal.swc,你可以尝试Flex,但我认为它不会起作用。寻找特定于 Flash CS5 的一款。
更新
我快速搜索了一下,看起来它还不能用于 Flash Professional CS5,只能通过 Flex 编译器使用。
StageVideo was only officially released last week, your version probably hasen't been updated with the new API's.
This PDF has info on using it with Flex: http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p1_releasenotes.pdf
I see you are using Flash CS5, you'll need a playerglobal.swc for that, you could try the Flex one, but I don't think it'll work. Look for a Flash CS5 specific one.
UPDATE
I did a quick search and it doesn't look like it is available for Flash Professional CS5 yet, just through the Flex compiler.
我发现使用 FlashDevelop 4 alpha 版本 http 可以很好地工作://www.flashdevelop.org/downloads/builds/FlashDevelop-4.0.0-R1747.exe 以及 Flex sdk http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero
我发现的一件事是,StageVideoAvailabilityEvent 似乎不是没有实施,尽管我可能是错的?
我收到
[Fault] 异常,信息 = VerifyError:错误 #1014:找不到类 flash.events::StageVideoAvailabilityEvent。
使用它时,我在 http://www.adobe.com 上发现了以下评论/devnet/flashplayer/articles/stage_video.html
I've found it to work quite well using FlashDevelop 4 alpha release http://www.flashdevelop.org/downloads/builds/FlashDevelop-4.0.0-R1747.exe alongside the flex sdk http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+Hero
One thing I have found is that it seems the StageVideoAvailabilityEvent isn't implemented, although I may be wrong about that?
Am getting
[Fault] exception, information=VerifyError: Error #1014: Class flash.events::StageVideoAvailabilityEvent could not be found.
When using it and I found the following comment on http://www.adobe.com/devnet/flashplayer/articles/stage_video.html
Flex 4.5.1.21328 playerglobal.swc ,下载即可。我遇到了同样的问题,现在我明白了
Flex 4.5.1.21328 playerglobal.swc , just download it, you will get it. i met the same problem, now i got it