When I run this program the "showAPplication" method runs first. I am just a little confused as why the "showApplication" method runs before the "complete开发者_StackOverflow" method? Why could this be happening?
<?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"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:applicationComplete>
<![CDATA[
complete();
showApplication();
]]>
</s:applicationComplete>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
private function complete(): void {
Alert.show("wewt");
}
private function showApplication(): void {
Alert.show("Showing components");
}
]]>
</fx:Script>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
</s:Application>
The Alert component does not block execution of ActionScript code. In other words, after the first Alert is shown, the code keeps running, even if you haven't clicked OK yet. The first Alert is there, but it is hidden under the second Alert because Alerts are always display on top of other existing content.
精彩评论