可以选择使用Flash 10.2光标,同时仍然与Flash 10.0兼容?光标、可以选择、Flash

由网友(牵手的路、只有我天荒地老)分享简介:我有一个Flash应用程序,需要Flash 10.0版本运行。我想补充本地鼠标光标,这是在Flash 10.2出台,但我不想要求我的所有用户升级,我不希望有编译两个独立的我的应用程序的版本。有没有办法在运行时我可以检测,如果游标是可用,然后使用它们? 这似乎是,如果你只编译为Flash 10.0,它标志着SWF版本头1...

我有一个Flash应用程序,需要Flash 10.0版本运行。我想补充本地鼠标光标,这是在Flash 10.2出台,但我不想要求我的所有用户升级,我不希望有编译两个独立的我的应用程序的版本。

有没有办法在运行时我可以检测,如果游标是可用,然后使用它们?

这似乎是,如果你只编译为Flash 10.0,它标志着SWF版本头10,你有新的API进行访问。如果你编译为Flash 10.2,它标志着版头11,你可以访问新的API,但仍可以在旧的Flash播放器不能运行任何更多的(我抓狂的错误,而它的加载Flex框架状

 的VerifyError:错误#1053:play2的org.osmf.net.dynamicstreaming.DynamicNetStream非法覆盖。

的ReferenceError:错误#1065:变量_379fa43169660c76f131cadc0adfbfe8f347bd31d3ceec26a9cb2a56f0dda1f9_flash_display_Sprite没有定义。
 

解决方案

 如果(鼠标[supportsNativeCursor])
{
  //做的东西跟MouseCursorData ...
}
 

注:

在这等同于调用的属性 Mouse.supportsNativeCursor ,但因为 supportsNativeCursor 是不是非此即彼之前支持10.2您需要检查的财产像这样 在某些设备可能不支持,即使他们有游标10.2(Android平板电脑没有游标) - !所以,要小心,太多 您可能希望将它设置为一个布尔值,因为评估它可能提供一个性能命中

由于该视频的信息。跳转至约7:40在时间线中:

Flash游戏开发 Flash设置光标

http://www.youtube.com/watch? V = rtc3DYSuahI和放大器;特征= player_embedded#在= 464

这是视频陪这篇文章: http://everythingfla.com/quickies/native-mouse

基本上解决方案如下:

I have a Flash application that requires Flash version 10.0 to run. I want to add native mouse cursors, which were introduced in Flash 10.2, but I don't want to require all my users to upgrade, and I don't want to have to compile two separate versions of my app.

Is there any way at runtime I can detect if the cursors are available, and then use them?

It seems like if you only compile for Flash 10.0, it marks the SWF version header "10", and you have no access to the new APIs. And if you compile for Flash 10.2, it marks the version header "11", and you have access to the new APIs, but can't run in the old Flash player any more (I get crazy errors while it's loading the Flex framework like:

VerifyError: Error #1053: Illegal override of play2 in org.osmf.net.dynamicstreaming.DynamicNetStream.

ReferenceError: Error #1065: Variable _379fa43169660c76f131cadc0adfbfe8f347bd31d3ceec26a9cb2a56f0dda1f9_flash_display_Sprite is not defined.

解决方案

if (Mouse["supportsNativeCursor"]) 
{
  // do stuff with MouseCursorData...
}

Notes:

This is equivalent to calling the property Mouse.supportsNativeCursor, but since supportsNativeCursor isn't supported either prior to 10.2 you need to check the property like this Some devices may not support cursors even if they have 10.2 (Android tablets don't have cursors) -- so be aware of that too! You may want to set this to a boolean because evaluating it probably gives a performance hit

Thanks to this video for this information. Skip to about 7:40 in the timeline :

http://www.youtube.com/watch?v=rtc3DYSuahI&feature=player_embedded#at=464

It's the video to accompany this article : http://everythingfla.com/quickies/native-mouse

Basically the solution is as follows:

阅读全文

相关推荐

最新文章