Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Java - Actionscript objects not serializing

Level 1
Level 1

I am having trouble serializing some objects from Java to

On 90% of my objects the mapping is fine, but on 10% the
mapping can not be found so flex defaults the object type to
Object, rather then the ActionScript type that has been defined.

All of the Java Objects to be mapped have a public no
argument constructor, and a getter and setter for each of the
properties to be mapped.

An example of two object, one where the mapping is found and
one where it is not:

package model



public class Dimension extends Component


public var codeList:Codelist;



This maps ok, in debug mode I can see this is model.Dimension

package model



public class FrequencyDimension extends Dimension




Mapping can not be found, in debug this maps to Object
(@MemRef) all of the Objects attributes properties come down the
wire, but the Object type is not found.

The Java class for FrequencyDimension is very simple, all it
does is have a default constructor and extend Dimension.

There does not seem to be any relationship between the
classes that don’t map, some extend already mapped classes
some do not, sometimes the bad mapping is in objects held in a
List, sometimes it isn’t. Actually, there is one
relationship, I think of the classes that don't map, they are the
latest classes written, and I wonder if this is a compiler issue,
not exporting the classes properly?

Can anyone help?

2 Replies
Level 1
Level 1
Found the answer.

This seems to be because none of my code was explicitly
instantiating or using the type FrequencyDimension, so I guess it
was not compiled into the swf. This seems to be by design, although
IMHO this is bad design as it causes confusion when working with
DataServces and it forces unnecessary code to be written.

Level 2
Level 2

Yes indeed. It is not compiled into the swf unless it is
referenced or cast.

Also, be careful to the variable names in Java like

During deserialization, ActionScript might expect a different
spelling than firstName because of the mix between lowercase and