0 Replies Latest reply on Jan 1, 2012 8:33 AM by birnerseff

    strange error - platform differences

    birnerseff Level 2

      I am trying to integrate this great package https://github.com/jbpin/as3-qrcode-encoder into my project.

      After some minor corrections I got a demo application running (pure as3 built with mxmlc under linux; both 4.0 and 4.5 produce functional swf) and then added the code to a bigger project. The same setup worked fine.

      Next I added same code to a flash 4.5 project (using latest updates - on a windows system). The project failed to compile, complaining about the initializers in the snippet below.

      I then copied the demo app and made its main class the document class for an empty fla file. This returned the same error   and confirmed that it was not a problem integrating into a biigeer projt.

      Next I copied the exact same files (demo app) to a new FB actionscript project. This time I get 3 errors in line 1 (the "package" line), about PropertyChangeEvent and BindingManager.

       

      It seems that replacing the initializer references by their values can fix the flash side of things ... (slowly, once one file is modified, the next one with a similar construct shows up) but why does plain mxmlc handle that where both flash and flash builder fail.

      On the other side, removing the [Bindable] attribute helps Flash builder. While I do not plan to make this a mxml application here, this is - after all - library code where a data binding would make sense.

       

       

      package org.qrcode

      {

              import org.qrcode.enum.QRCodeEncodeType;

              import org.qrcode.enum.QRCodeErrorLevel;

              import flash.display.BitmapData;

       

              public class QRCode

              {

       

                      private var level:int;

                      private var type:int;

       

                      [Bindable]

                      public var bitmapData:BitmapData;

       

                      public function QRCode(errorLevel:int=QRCodeErrorLevel.QRCODE_ERROR_LEVEL_LOW,encodeType:int = QRCodeEncodeType.QRCODE_ENCODE_BYTES) {

                              this.level = errorLevel;

                              this.type = encodeType;

       

                      }