【发布时间】:2014-03-27 23:07:35
【问题描述】:
我卡住了。我一直在尝试使用Adobe Flash Builder 开发简单的应用程序,但没有运气。
这很简单,我什至没有在任何类型的模拟器/设备上显示诸如 button 之类的视觉元素。
我看了一些视频教程,似乎一切都正确,没有出现错误,但问题是当我在 device/simulator/air iOS/Android 甚至是真正的 iOS 设备上启动应用程序时 - 它仍然是空白....为空.只是白屏
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" applicationDPI="160"
applicationComplete="init(event)">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Button id="button1" x="100" y="58" label="300ms"/>
<s:Button id="button2" x="200" y="58" label="500ms"/>
<s:Button id="button3" x="300" y="58" label="1000ms"/>
<fx:Script>
<![CDATA[
import com.adobe.nativeExtensions.Vibration;
private var vibrate:Vibration
private function init(evt:Event):void
{
trace("We are here");
if(Vibration.isSupported)
{
setupButtons();
} else {
trace("Vibration is not supported");
}
}
private function setupButtons():void
{
button1.addEventListener(MouseEvent.CLICK, handleButtons);
button2.addEventListener(MouseEvent.CLICK, handleButtons);
button3.addEventListener(MouseEvent.CLICK, handleButtons);
vibrate = new Vibration();
}
private function handleButtons(event:MouseEvent):void
{
switch (event.currentTarget.id)
{
case "button1":
vibrate.vibrate(300);
break;
case "button2":
vibrate.vibrate(500);
break;
case "button3":
vibrate.vibrate(1000);
break;
}
}
]]>
</fx:Script>
</s:Application>
至少应该出现 3 个按钮。在控制台中调试时没有有用的信息,在 -init() 方法中没有在断点处停止。
我对我的第一次会议flash builder 和为移动平台进行开发感到非常沮丧。
Flash Builder 4.7
提前致谢
【问题讨论】:
-
调试时是否收到跟踪消息?可能是一些异常阻止应用程序完成初始化(尝试注释所有初始化代码并仅保留 mxml 并查看是否获得按钮)
-
不,我没有得到任何调试信息
-
如果我删除
标签: apache-flex actionscript air adobe flash-builder