Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4610472
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:08:10+00:00 2026-05-22T01:08:10+00:00

Hey there! I’m trying to serialize data in AS3 but am running into a

  • 0

Hey there! I’m trying to serialize data in AS3 but am running into a frustrating problem. Originally I had problems with “myObjClass” not being convertible, but after I discovered “registerClassAlias” I got things working allright.

Some time later, I added vectors to the myObjClass. I ran into trouble with Vector Strings before, as was reported here:

https://bugs.adobe.com/jira/browse/FP-6693

So I know the workaround is to include:

registerClassAlias("String", String);

I’m just not sure how to register an alias for a subvector within a vector (along with other variables). Here’s my code:

var newObj:myObjClass = new myObjClass();
newObj.mySubXML = new Vector.<XML>();
newObj.mySubString = new Vector.<String>();

var myObj:Vector.<myObjClass> = new Vector.<myObjClass>();
myObj.push(newObj);

registerClassAlias("String", String); // Problem #1
registerClassAlias("XML", XML);       // Problem #1
registerClassAlias("VecMyObjClass", Vector.<myObjClass> as Class); // Problem #2
// registerClassAlias("myObjClass", myObjClass); // This and the above are interchangable (same errors)
var bytes:ByteArray = new ByteArray();
bytes.writeObject(myObj);
bytes.position = 0;
myObj = bytes.readObject();

Problem #1: When these two lines are included in my compilation, the final line (bytes.readObject()) fails with the error:

Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@42edb21 to __AS3__.vec.Vector.<myObjClass>.

This is really strange. It’s as if the first two registerClassAlias’s are undoing the third one.

Problem #2: If I comment out the two “first problem” lines (string/xml classalias registrations) it converts myObj to myObjClass just fine; no internal error is thrown and the application is not halted. However, it fails to convert the internal String and XML vectors, with this error appearing in the application Output (without halting):

TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@3aabc11 to __AS3__.vec.Vector.<XML>.
TypeError: Error #1034: Type Coercion failed: cannot convert __AS3__.vec::Vector.<Object>@3aabc41 to __AS3__.vec.Vector.<String>.

So my question is, How can I register a class alias for:

  • Vector.(myObjClass)
  • A vector of Strings as a property of Vector.(myObjClass)
  • A vector of XML as a property of Vector.(myObjClass)

All at the same time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:08:11+00:00Added an answer on May 22, 2026 at 1:08 am

    Looks like moving:

    registerClassAlias("XML", XML);
    registerClassAlias("String", String);
    

    Into myObjClass directly did the trick, while retaining:

    registerClassAlias("myObjClass", myObjClass);
    

    In the serialization class. I’m not sure why storing the three together in the serialization class wasn’t working – and was generating strange errors if I changed the order of the code, so the problem might just be some glitch on specific machine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hey there, Im having problems displaying my results in this program but the program
Hey there, trying to install a ruby gem but I keep getting the following
hey there! im not really into regular expressions, but i need a simple regex
Hey There, This is a pretty simple problem, but it is my first time
Hey there, everyone. A really random question, but I'm looking to get into some
Hey there, I am trying to get my signout button to work. This is
Hey there, I'm trying to validate a form with Zend_Validate and Zend_Form. My element:
Hey there. I'm trying to write a small program that will read the four
Hey there, I'm at the moment trying to make a product management application. The
hey there i am having problem i have List<List<memoryCard>> that i want to show

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.