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

  • SEARCH
  • Home
  • 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 7967139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:37:04+00:00 2026-06-04T06:37:04+00:00

I get error Error #2099: The loading object is not sufficiently loaded to provide

  • 0

I get error

Error #2099: The loading object is not sufficiently loaded to provide this information

when I try to encode object into JSON using as3corelib.
I succeeded encoding some value object which has no parent or children so I know that library works and that problem might be related to addChild or something like that. That is just guess.

Board is added to stage like that:

stage.addChild(board);

When I don’t add board to stage and try to serialize it I get different error:

undefined
at XML/http://adobe.com/AS3/2006/builtin::copy()
at global/describeTraits()
at global/avmplus::describeType()
at global/flash.utils::describeType()
    ...

Board class:

public class Board extends Sprite
{
    public var board:Array;
    public var blockColor:uint = 0xE3E3E3;
    public var blockLength:uint

    public function Board(blockLength:uint)
    {
        super();
        x = 0;
        y = 0;
        this.blockLength = blockLength;
        //buttonMode = true;
        // Setting up two dim array
        board = new Array(10);
        for (var k:int = 0; k < board.length; k++) 
        {
            board[k] = new Array(10);
        }


        for (var i:int = 0; i < 10; ++i) 
        { 
            for(var j:int = 0; j < 10; ++j)
            {
                var block:Block = new Block(i*blockLength, j*blockLength);  
                board[i][j] = block;
                this.addChild(block); // here I add children
                block.drawBlock(blockLength, blockColor);
                block.addEventListener(MouseEvent.CLICK, blockClicked);
            }
        }           
    }

    ....

}

}

Here is code for Block, really nothing there.

public class Block extends Sprite
{

    public var cos:int = 5; // test

    public function Block(x:uint, y:uint)
    {
        ...
    }

    public function drawBlock(length:uint, color:uint):void
    {
        ...
    }
}

Any clues why is that?

  • 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-06-04T06:37:06+00:00Added an answer on June 4, 2026 at 6:37 am

    I would suggest that you don’t try to serialize any form of DisplayObject; instead you should just be serializing the underlying Data (attributes) which the View uses; it’s hard to give you an exact answer from the code above, but consider the following:

    // Simple Model object which represents the BlockView's underlying data.
    public class BlockViewModel {
        public var x : Number;
        public var y : Number;
    }
    
    // Renders the BlockViewModel on screen.
    public class BlockView extends Sprite {
        public var position : BlockViewModel;
    
        // Constructor requires a BlockViewModel object.
        public function BlockView(position : BlockViewModel) {
            this.position = position;
            draw();
            reposition();
        }
    
        private function draw() : void {
            // Omitted...
        }
    
        // Update the block's position based on the model.
        private function reposition() : void {
            this.x = this.position.x;
            this.y = this.position.y;
        }
    
        // Setter for the block's current position.
        public function setX(value : Number) : void {
            this.position.x = value;
            reposition();
        }
    }
    

    With the example above you would just serialize the BlockViewModel object when you want to save state, eg:

    var serailizedBlockData : String = JSON.encode(blockView.position);
    

    You could then re-create a new BlockView by deserializing the data:

    // Convert from JSON -> Object.
    var blockData : Object = JSON.decode(serializedBlockData);
    
    // Create and populate a BlockViewModel with the deserialized data.
    var position : BlockViewModel = new BlockViewModel();
    position.x = blockData.x;
    position.y = blockData.y;
    
    // Create a new view using the serialized data.
    var blockView = new BlockView(position);
    

    You could extend this further by moving the object construction / population logic into a Factory method to help separate the logic.

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

Sidebar

Related Questions

Why I get error with this query on my live server but not on
I get error TypeError: 'int' object is not subscriptable what should I do to
I get this error in my smtdplugin implementation file , when i try to
I get Error Object Expected on line 1, char 1 (where-ever this is) on
I have this query and I get error Operand should contain 1 column(s), whats
I use the following jquery statements but i get error in this function onGetDataSuccess(result)
When we try to create a view within a funcion we get ERROR: there
Whenever i try using php with lighttpd on my iphone i get error 500
If I set pre-compile script into binary code to true I get error saying
i get error of this type: in function ... multiple definition of ... ...

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.