Getting native vibration to work on iOS through AS3

馋奶兔 提交于 2019-12-11 09:39:50

问题


I've been looking at the documentation and it's a bit confusing as to how I even import the extension for the vibration plugin. http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/vibration.html The instructions says I need to mess about with Xcode, but I thought the point of Adobe AIR was that you don't need to mess about with Xcode; it's really convoluted. How exactly do I import the class and files so that I can use the provided code in AS3?


回答1:


read a this article: Vibration native extension sample

click a this link: Vibration Download

and unzip anywhere.

Click File-ActionScript 3.0 Settings

link to (In ReadyToUseExtension) VibrationActionScriptLibrary.swc, com.adobe.extensions.Vibration.ane

In Simulator not compiled. because Requested extension com.adobe.Vibration is not supported for MacOS-x86.

import com.adobe.nativeExtensions.Vibration;

var vibe:Vibration;
if (Vibration.isSupported)
{
    vibe = new Vibration();
    vibe.vibrate(2000);
}



回答2:


Using the files in the ReadyToUseExtension directory, add the pre-packaged .ane file to your project, as in this tutorial.



来源:https://stackoverflow.com/questions/14777563/getting-native-vibration-to-work-on-ios-through-as3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!