4 Replies Latest reply on May 9, 2011 9:39 AM by davy zhang

    can not alert or popup in module

    davy zhang

      I am pretty much new to modular applications so here's my problem.

       

      I wanna show up a popup window in the module, and I need the window to be modular

       

      I don't know how to work around this. Do I need popup everything from main application?

       

      main application code

       

      <?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">

      <fx:Declarations>

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      </fx:Declarations>

      <s:ModuleLoader url="TestAlert.swf">

       

      </s:ModuleLoader>

      </s:Application>

       

      module code

       

      <?xml version="1.0" encoding="utf-8"?>

      <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009"

        xmlns:s="library://ns.adobe.com/flex/spark"

        xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300">

       

      <fx:Script>

      <![CDATA[

      import mx.controls.Alert;

      protected function button1_clickHandler(event:MouseEvent):void

      {

      // TODO Auto-generated method stub

      Alert.show("hmmmm...","something wrong");//error here

      }

      ]]>

      </fx:Script>

       

      <fx:Declarations>

      <!-- Place non-visual elements (e.g., services, value objects) here -->

      </fx:Declarations>

      <s:Button x="176" y="119" label="Button" click="button1_clickHandler(event)"/>

      </s:Module>