2 Replies Latest reply on Mar 24, 2011 11:33 AM by Flex harUI

    Text no longer visible in my TextArea since we targeted flash player 10

    Sébastien VARLET Level 1

      Hi everyone,

       

      I have an application based on Flex 3.5.0.12683. I recently had to make it target flash player 10 to be able to use the new features of the FileReference class.

       

      Since I did it the text content of a TextArea component is no longer visible. We noticed the same problem on some Label components.

       

      Here is an example of a component that do not work anymore :

       

      Footer.mxml

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="23"
                 paddingRight="10" paddingLeft="10" backgroundColor="#F9F9F9"
                 backgroundAlpha="0.8" click="displayHistory()"
                 initialize="initListeners()" verticalAlign="bottom"
                 horizontalAlign="right" cornerRadius="3" borderStyle="solid"
                 borderColor="#B0B0B0" currentState="historyClosed"
                 xmlns:parsley="http://www.spicefactory.org/parsley">
      
           <mx:states>
                <mx:State name="historyOpened">
                     <mx:SetProperty name="height" value="630" />
                     <mx:SetProperty target="{statusLabel}" name="height" value="600" />
                </mx:State>
                <mx:State name="historyClosed" />
           </mx:states>
      
           <parsley:Configure />
      
           <mx:Script>
                <![CDATA[
                     import com.finams.dataadmin.application.events.FooterEvent;
                     import com.finams.dataadmin.domain.ModelVO;
                     import com.finams.dataadmin.domain.referentials.UserProfileVO;
                     import com.finams.dataadmin.domain.utils.DateLabels;
                     import com.finams.dataadmin.domain.utils.HistoryVO;
                     
                     import flexlib.scheduling.util.DateUtil;
                     
                     import mx.controls.Alert;
                     import mx.core.Application;
                     import mx.managers.HistoryManager;
      
                     [Bindable]
                     private var model:ModelVO = ModelVO.getInstance();
                     
                     [Inject(id="currentProfile")]
                     public var currentProfile:UserProfileVO;
      
                     private var _savedH:HistoryVO;
      
                     public function initListeners():void
                     {
                          model.addEventListener(FooterEvent.UPDATE_STATUS, updateStatus);
                     }
      
                     private function sortOnPrice(a:HistoryVO, b:HistoryVO):Number
                     {
                          var aDate:Date = a.date;
                          var bDate:Date = b.date;
      
                          if (aDate > bDate) {
                               return -1;
                          } else if (aDate < bDate) {
                               return 1;
                          } else {
                               return 0;
                          }
                     }
      
                     private function displayHistory():void
                     {
                          var str:String;
                          var tab:Array;
      
                          if (!currentProfile.hasPrivilegeByAreaAndName("XXXX", "XXXX")) {
                               return;
                          }
                          if (currentState == 'historyClosed') {
                               currentState = 'historyOpened';
                               statusLabel.htmlText = "";
                               if (model && model.history) {
                                    for each (var tmp:HistoryVO in model.history) {
                                         if (tmp) {
                                              statusLabel.htmlText += tmp.toHtmlText() + "\n\n";
                                         }
                                    }
                               }
                          } else {
                               currentState = 'historyClosed';
                               try {
                                    str = DateLabels.hhmmss(_savedH.date, ":");
                                    statusLabel.text = str + " · ";
                                    statusLabel.text += _savedH.label;
                                    statusLabel.setStyle("fontWeight", "normal");
                                    if (_savedH.type == FooterEvent.FOOTER_ERROR) {
                                         statusLabel.setStyle("color", "0x6e0505");
                                         statusLabel.setStyle("fontWeight", "bold");
                                    }
                                    else if (_savedH.type == FooterEvent.FOOTER_WARNING) {
                                         statusLabel.setStyle("color", "0xd96704");
                                    }
                                    else {
                                         statusLabel.setStyle("color", "0x104008");
                                    }
                               } catch (e:Object) {
                               }
                          }
                     }
      
                     [MessageHandler]
                     public function updateStatus(e:FooterEvent):void
                     {
                          var date:Date = new Date();
                          var str:String;
      
                          model.addToHistory(new HistoryVO(e.err, e.txt, e.obj));
                          _savedH = new HistoryVO(e.err, e.txt);
                          if (currentState == 'historyOpened') {
                               return;
                          }
                          str = DateLabels.hhmmss(date, ":");
                          statusLabel.text = str + " · ";
                          statusLabel.text += e.txt;
                          statusLabel.setStyle("fontWeight", "normal");
                          if (e.err == FooterEvent.FOOTER_ERROR) {
                               statusLabel.setStyle("color", "0x6e0505");
                               statusLabel.setStyle("fontWeight", "bold");
                          } else if (e.err == FooterEvent.FOOTER_WARNING) {
                               statusLabel.setStyle("color", "0xd96704");
                          } else {
                               statusLabel.setStyle("color", "0x104008");
                          }
                     }
                ]]>
           </mx:Script>
           <mx:TextArea id="statusLabel" height="22" width="100%" bottom="0" text=""
                           click="displayHistory()" mouseDown="displayHistory()"
                           backgroundAlpha="0.0" alpha="0.0" borderStyle="none"
                           backgroundColor="#FF0000" editable="false" selectable="false" />
      </mx:HBox>
      
       
      

       

       

       

      As is, this component works well if we target Flash Player 9 but id does not if we target flash player 10.

       

      Any idea ?