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 57383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:40:57+00:00 2026-05-10T17:40:57+00:00

Is it possible to have multiple view of the same display object? (e.g. same-computer

  • 0

Is it possible to have multiple view of the same display object? (e.g. same-computer multi-player game using split screen)

The sample code that failed to work follows:

    var content: Sprite = new Sprite();     var v1: Sprite = new Sprite();     var v2: Sprite = new Sprite();      with(content.graphics) {         lineStyle(2, 0xff0000);         drawCircle(100, 100, 80);          lineStyle(5, 0x009999);         drawRect(50, 80, 200, 30);     }      v1.addChild(content);     v1.x = 0;     v1.y = 0;     v1.scrollRect = new Rectangle(0, 0, 100, 100);     addChild(v1);      v2.addChild(content);     v2.x = 100;     v2.y = 0;     v2.scrollRect = new Rectangle(0, 0, 100, 100);     addChild(v2); 

I thought this would make two viewports (v1 and v2) of the same object (content). But when I checked the docs, DisplayObjectContaner/addChild method, it says,

‘If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container.’

Is there a solution for this?


Obtained result

Obtained result

Expected result (simulated)

Expected result (simulated) http://img337.imageshack.us/img337/7914/222mq4.png


Rendering to a bitmap as suggested by Antti is a great idea, but the rendered sprites will not be able to catch mouse events. Is there a way to redirect the mouse clicks on the bitmap to trigger clicks on the original sprites?

  • 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. 2026-05-10T17:40:58+00:00Added an answer on May 10, 2026 at 5:40 pm

    The easiest way to do this is to have a bitmap that’s updated with the original display object’s contents, something like:

     var bitmap:Bitmap = new Bitmap(new BitmapData(1,1)); addChild(bitmap);  addEventListener(Event.ENTER_FRAME,enterFrameHandler);  function enterFrameHandler(event:Event):void {     bitmap.bitmapData.dispose();     bitmap.bitmapData = new BitmapData(displayObject.width, displayObject.height, true, 0x00000000);     bitmap.bitmapData.draw(displayObject); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 381k
  • Answers 381k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Can you do best of both? ISNULL only serves this… May 14, 2026 at 10:15 pm
  • Editorial Team
    Editorial Team added an answer It is taking the address of _someMember and casting it… May 14, 2026 at 10:15 pm
  • Editorial Team
    Editorial Team added an answer Send IB object to back programmatically Interface Builder has no… May 14, 2026 at 10:15 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.