06-19-2012 1:47 PM
Hi experts,
I've created a FLEX-project. Everything's working fine - until my actual "version".
I have added some libs (alivePDF, bulkloader, fzip) to my application, which is working fine in the debug version. I have exported a release version, which is working fine in some SWF-Debugger (SWiX), too.
Now I have imported it to SAP (as before with the previous versions), but my new added functions only show this problem:
TypeError: Error #1009: Der Zugriff auf eine Eigenschaft oder eine Methode eines null-Objektverweises ist nicht möglich.
at MethodInfo-856()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at br.com.stimuli.loading::BulkLoader/_onAllLoaded()
at br.com.stimuli.loading::BulkLoader/_onItemComplete()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at br.com.stimuli.loading.loadingtypes::LoadingItem/onCompleteHandler()
at br.com.stimuli.loading.loadingtypes::ImageItem/onCompleteHandler()
Sorry for the German version, should be "Error #1009:Cannot access a property or method of a null object reference."
Does anyone know what can be the problem?
Thanks
Michael
07-24-2012 3:35 AM
Hi,
Imported to SAP? - I cannot understand this statement.. Do you have an HTML wrapping the SWF?
Also, it seems your onCompleteHandler is trying to use and access properties of a null object. When you work with Events you must ensure your handler will be in a usable state when you dispatch the event.
Maybe if you provide parts of the code where the issue happens others may help..
D.
07-24-2012 9:44 AM
Daniel Ruiz wrote:
Imported to SAP? - I cannot understand this statement.. Do you have an HTML wrapping the SWF?
I created a release version of my project in FLEX. Then I created a BSP application and imported all the "release" files as MIME.
Daniel Ruiz wrote:
Also, it seems your onCompleteHandler is trying to use and access properties of a null object. When you work with Events you must ensure your handler will be in a usable state when you dispatch the event.
Everything is working fine in my debug version, I'm quite sure the problem is with the bulkloader lib.
Here's the coding for it:
BulkLoader.removeAllLoaders()
var loaderbulk: BulkLoader = new BulkLoader("pdf");
loaderbulk.add( String(xmlDetail.PIC_APPL) , {id:"APPL", type:BulkLoader.TYPE_IMAGE});
loaderbulk.add( String(xmlDetail.PIC_EINZ) , {id:"SING", type:BulkLoader.TYPE_IMAGE});
loaderbulk.add( String(xmlDetail.PIC_PACK) , {id:"PACK", type:BulkLoader.TYPE_IMAGE});
loaderbulk.add( barcode , {id:"BARCODE", type:BulkLoader.TYPE_IMAGE});
loaderbulk.addEventListener(BulkLoader.COMPLETE, onComplete);
loaderbulk.start();
function onComplete(evt : Event) : void{
//var image1:Image = new Image;
var myBmpData:BitmapData;
var myByteArray:ByteArray;;
var bmp:Bitmap;
var encoder:JPEGEncoder = new JPEGEncoder ( 100 );
var bytes:ByteArray;
myByteArray = new ByteArray;
bmp = loaderbulk.getBitmap("APPL");
myBmpData = bmp.bitmapData;
myByteArray = bmp.bitmapData.getPixels(myBmpData.rect);
bytes = encoder.encode ( myBmpData );
myPDF.addImageStream( bytes, ColorSpace.DEVICE_RGB, null,15,30,30 );
myByteArray = new ByteArray;
bmp = loaderbulk.getBitmap("SING");
myBmpData = bmp.bitmapData;
myByteArray = bmp.bitmapData.getPixels(myBmpData.rect);
bytes = encoder.encode ( myBmpData );
myPDF.addImageStream( bytes, ColorSpace.DEVICE_RGB, null,80,30,30 );
myByteArray = new ByteArray;
bmp = loaderbulk.getBitmap("PACK");
myBmpData = bmp.bitmapData;
myByteArray = bmp.bitmapData.getPixels(myBmpData.rect);
bytes = encoder.encode ( myBmpData );
myPDF.addImageStream( bytes, ColorSpace.DEVICE_RGB, null,145,30,30 );
myByteArray = new ByteArray;
bmp = loaderbulk.getBitmap("BARCODE");
myBmpData = bmp.bitmapData;
myByteArray = bmp.bitmapData.getPixels(myBmpData.rect);
bytes = encoder.encode ( myBmpData );
myPDF.addImageStream( bytes, ColorSpace.DEVICE_RGB, new Resize ( Mode.NONE, null ),340,110,50 );
Alert.show("Do you want to save?","Save",Alert.YES | Alert.NO ,SINGLE_BLOCK,handleAlert,null)
}