Archive for the ‘Errors and Warnings’ category

FlexPrintJob, TypeError: Error #1009: Cannot access a property or method of a null object reference.

August 3rd, 2011

Full error text:

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at mx.printing::FlexPrintJob/addObject()[E:\dev\hero_private\frameworks\projects\framework\src\mx\printing\FlexPrintJob.as:252]

What caused the warning?
I was trying to print dynamically created image. The error occured in function addObject from FlexPrintJob class.

What is the solution?
You have to add printed object to a stage before you add it to FlexPrintJob.

var flexPrintJob:FlexPrintJob = new FlexPrintJob();
addElement(image);
if (flexPrintJob.start() != true)
{
    removeElement(image);
    return;    
}
flexPrintJob.addObject(image, FlexPrintJobScaleType.SHOW_ALL);
flexPrintJob.send();
removeElement(image);

Note that the printed object will not be visible on a stage even for a second because it’s immediately removed from the stage after sending to FlexPrintJob.

MS-DOS style path detected [...]

July 22nd, 2011

Full error text:

cygwin warning:
    MS-DOS style path detected: C:/alchemy/alchemy0.5a/alchemy-setup
    Preffered POSIX equivalent is: /cygdrive/c/alchemy/alchemy05.a/alchemy-setup
    CYGWIN enviroment variable option "nodosfilewarning" turns off this warning.
    Consult the user's guide for more details about POSIX paths:
        http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

What caused the warning?
I was configuring Alchemy on Windows XP and I run ./confing in $ALCHEMY_HOME direcory.

What is the solution?

  • Open System Properties (Right-click My Computer and select Properties, then select “Advanced system settings”).
  • Select the Advanced tab, then click Environment Variables…
  • Under the System Variables section, click New.
  • In the Variable name field, enter CYGWIN.
  • In the Variable value field, enter nodosfilewarning.
  • Click OK on each of the dialogs to save your settings.
  • Restart Cygwin console.

[Compiler] Error #1063: Unable to open file: … /global.abc

July 20th, 2011

Full error text:

[Compiler] Error #1063: Unable to open file: [...]/global.abc
[Compiler] Error #1063: Unable to open file: [...]/playerglobal.abc

What caused the error?
The erorr happened when I tried to compile sample C application with Alchemy.

What is the solution?
Open $ALCHEMY_HOME/achacks/hacks.pl and change line #27 from:

if(`uname` =~ /CYGWIN/)

to

if(`/bin/uname` =~ /CYGWIN/)

ERROR: “java” not available

July 20th, 2011

What caused the error?
The error happened in the Alchemy installation process when I tried to run ./confing in $ALCHEMY_HOME directory.

What is the solution?
I had installed Java JRE for Windows x64. The problem was solved by installing Java JRE for Windows x86.

Black screen instead of video stream from camera

July 9th, 2011

What caused the error?
The error happened when I tried to display view from my web camera in a VideoDisply object but insted I got black screen. I was sure that camera was connected and it was working with other applications (e.g. Skype).

What is the solution?
Right click on any Flash content and choose “Settings”, then go to the “Camera” tab (section) and check if your camera is listed there. It should. In my case there were two additional cameras “Google Camera Adapter” and one of them was selected. They probably came with Google Talk plugin.

[0]: Creative WebCam Vista Plus #2
[1]: Google Camera Adapter 0
[2]: Google Camera Adapter 1

As soon as I selected “Creative WebCam” everything started to work.

RangeError: Error #1506: The specified range is invalid.

June 17th, 2011

Full error code:

RangeError: Error #1506: The specified range is invalid.
at cmodule.as3_jpeg_wrapper::FSM_imalloc$/start()
at cmodule.as3_jpeg_wrapper::FSM_pubrealloc/work()

What caused the error?
The error happened when I tried to encode more than one bitmap with Alchemy JPEG encoder.

What is the solution?
Make sure that you don’t initialize you C library more than once or use the code below to avoid this:

var cLibInit:CLibInit;
var cLib:Object;
if (cLib == null) {
    cLibInit = new CLibInit;
    cLib = cLibInit.init();            
}

Error #2030: End of file was encountered

May 10th, 2011

What caused the error?
I got this error when I tried to read bytes from a ByteArray. I found out that the error happened because ByteArray pointer was set to its last position available and by reading bytes I was forcing it to move further.

What is the solution?
You need to know that when you populate ByteArray with some data you move its pointer as well. To get rid of this error you should reset ByteArray pointer after writing data to it.

//Writing to ByteArray.
byteArray.position = 0;
//Reading from ByteArray.

Skin for * cannot be found

December 25th, 2010

What caused the error?
I was moving one of my modular applications from Flex 3 (Gumbo) to Flex 4 (Spark) architecture. This error happend each time I added a module GUI to the main application. Unfortunately this is all what I found out about source of this problem.

What is the solution?
Add: -keep-all-type-selectors to your compiler arguments.

Here’s is what documentation says about this argument:
“Instructs the compiler to keep a style sheet’s type selector in a SWF file, even if that type (the class) is not used in the application. This is useful when you have a modular application that loads other applications. For example, the loading SWF file might define a type selector for a type used in the loaded (or, target) SWF file. If you set this option to true when compiling the loading SWF file, then the target SWF file will have access to that type selector when it is loaded. If you set this option to false, the compiler will not include that type selector in the loading SWF file at compile time. As a result, the styles will not be available to the target SWF file.

This is an advanced option.”

Error #2012 class cannot be instantiated

December 17th, 2010

What caused the error?
The errors occured when I wanted to create a class subclassing from DisplayObject. According to the documentation: “DisplayObject is an abstract base class; therefore, you cannot call DisplayObject directly. Invoking new DisplayObject() throws an ArgumentError exception.”

What is the solution?
“The DisplayObject class itself does not include any APIs for rendering content onscreen. For that reason, if you want create a custom subclass of the DisplayObject class, you will want to extend one of its subclasses that do have APIs for rendering content onscreen, such as the Shape, Sprite, Bitmap, SimpleButton, TextField, or MovieClip class.”

Launch Failed: If the program is already running, close it before attempting to run

November 21st, 2010

What caused the error?
You can only have a single instance of an AIR application running. Sometimes it doesn’t shutdown properly and stays running in the background preventing from launching the application again.

What is the solution?
Open your task manager and terminate adl.exe process.

Flexmaniaks on Facebook