7 Replies Latest reply on Sep 29, 2010 2:24 PM by JK2075

    Alert Control Popup Message is blank

    JK2075

      Hi,

       

      I am using Alert control to display a popup message. For some reason message is blank and the label for Ok button is also blank. Popup does come up

      with a blank button. If you click on button then it does go away as it should. Any suggestions?

       

      Thanks in advance!

        • 1. Re: Alert Control Popup Message is blank
          BhaskerChari Level 4

          Hi JK2075,

           

          This doesn't resolve your problem..Give some sample code or brief the scenario in which case you are getting the problem. Are you using the Alert control with dynamic text or static text..??

           

           

          Thanks,

          Bhasker

          • 2. Re: Alert Control Popup Message is blank
            JK2075 Level 1

            Sample of Main.xml - code has been written by someone else so I am having trouble to figure this out. Code does work but any popups or custom popups that are needed come blank.

             

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
                initialize="onAppInitialize()"
                creationComplete="initHttpService()"
                applicationComplete="init()"
                layout="absolute"
                verticalScrollPolicy="off"
                horizontalScrollPolicy="off"
                backgroundAlpha="0"
                xmlns:actionscript="actionscript.*">

             

            Inside initHttpService function I have Alert on first line...

             

              private function initHttpService():void
               {
                try
                {
                 Alert("test","test");

                 httpService.url=CONFIG_XML_PATH;
                 httpService.send();

                 httpService.addEventListener(ResultEvent.RESULT, invokeCreationComplete);
                 httpService.addEventListener("fault", httpFault);
                 ExternalInterface.addCallback("startQuestionScreen", startQusetionPages);
                 ExternalInterface.addCallback("openMessageBox", openMessageBox);
                 ExternalInterface.addCallback("gotoOnFirstScreen", gotoOnFirstScreen);
                 ExternalInterface.addCallback("setPrinterInFlex", setPrinter);
                 ExternalInterface.call("setPrinter");
                }
                catch (e:Error)
                {
                 trace("error : " + e.message);
                }
               }

             

               protected function onAppInitialize():void
               {
                objResourceXML=new ResourceXMLLoader();
                objResourceXML.addEventListener("ResourceXMLLoaded", onResourceLoadComplete);
                objResourceXML.sendLoadRequest("xml/ResourceXML.xml");
               }

             

               private function init():void
               {
                stage.showDefaultContextMenu=false;
               }

             

            Thanks!!

            • 3. Re: Alert Control Popup Message is blank
              BhaskerChari Level 4

              Hi JK2075,

               

              The Alert should be Alert.show and not just Alert....and also import the namespace as well..

               

              import mx.controls.Alert;

               

              Alert.show("test","test");

               

               

              Thanks,

              Bhasker

              • 4. Re: Alert Control Popup Message is blank
                JK2075 Level 1

                Sorry...they are there. I did not include all the variables...And yes alert is Alert.show (I mistyped it while copying)

                 

                <mx:Script>
                  <![CDATA[
                   import mx.controls.Alert;

                   //ALL IMPORT CLASSES AND PACKAGE

                   import mx.controls.Text;
                   import mx.controls.Image;
                   import mx.controls.Label;
                   import mx.controls.Button;
                   import mx.states.SetStyle;
                   import mx.containers.Panel;
                   import mx.managers.PopUpManager;
                   import mx.rpc.events.ResultEvent;
                   import flash.sampler.NewObjectSample;
                   import mx.collections.XMLListCollection;
                   import mx.messaging.management.Attribute;
                   import mx.messaging.channels.StreamingAMFChannel;
                   import FrameComponents.*;
                   import actionscript.*;
                   import actionscript.ResourceLanguage;
                   import actionscript.ResourceXMLLoader;
                   import flash.display.Stage;
                   import flash.system.fscommand;
                   import mx.rpc.events.FaultEvent;

                 

                Thanks!

                • 5. Re: Alert Control Popup Message is blank
                  BhaskerChari Level 4

                  Hi JK2075,

                   

                  I dont think there is any reason as why such a simple Alert is not appearing correctly. Have you tested with some sample application with an Alert..??

                   

                  Are you using any css for Alert control.??

                   

                   

                   

                  Thanks,

                  Bhasker

                  • 6. Re: Alert Control Popup Message is blank
                    Flex harUI Adobe Employee

                    If you are using Flex 4.1 and Flex 3 compatibility mode, popups can lose

                    text unless you set layoutDirection='ltr' on the global CSS selector.

                    • 7. Re: Alert Control Popup Message is blank
                      JK2075 Level 1

                      Thanks!! That did the trick. And yes the code was originally in 3.0.

                       

                      Thanks again!!