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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:15:26+00:00 2026-05-24T19:15:26+00:00

I got a serious problem here: I have a scrolling background that is 1320

  • 0

I got a serious problem here: I have a scrolling background that is 1320 x 1000 big. I’m using a sprite as a container where my background canvas is placed inside of it. Additionally I add (via addChild) a score sprite inside of the background sprite (the one that holds the bg canvas so the score appears on top of the bg canvas).

The goal is that when I add a score it shall be stuck to the background (even when the scrollrect moves; it shall have a fixed position on the background).

The problem is that this doesn’t work because when the score appears it moves with the scrollrect and this is not what I want. I already tried it with globalToLocal but had no success yet. Probably because I don’t really understand globalToLocal (and vice versa). Please can anyone help me out with this problem? Thanks in advance.

These are some code excerpts:

private var backgroundBitmapData:BitmapData = new BitmapData(1320, 1000, false, 0x000000);
private var canvasBitmapData:BitmapData = new BitmapData(1320, 1000, false, 0x000000);

private var canvasBitmap:Bitmap = new Bitmap(canvasBitmapData);
private var canvasRect:Rectangle = new Rectangle(0, 0, 660, 500);

private var backgroundSprite:Sprite = new Sprite();

backgroundSprite.scrollRect = new Rectangle(0, 0, 660, 500);
canvasBitmap.scrollRect = new Rectangle(330, 250, 660, 500);

backgroundSprite.addChild(canvasBitmap);
backgroundSprite.cacheAsBitmap = true;

addChild(backgroundSprite);


tempScoreText = new ScoreTextField(String(10), textFormat, oldAstX, oldAstY, 20);
scoreTexts.push(tempScoreText);
backgroundSprite.addChild(tempScoreText);
  • 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-24T19:15:27+00:00Added an answer on May 24, 2026 at 7:15 pm

    I put a sample together to see if I could see what you’re experiencing, but I don’t think I’m seeing the same thing because this example seems to work like it’s supposed to. Here’s my example:

    var backgroundBitmapData:BitmapData = new BitmapData(1320, 1000, false, 0x000000);
    var canvasBitmapData:BitmapData = new BitmapData(1320, 1000, false, 0xff0000);
    
    var canvasBitmap:Bitmap = new Bitmap(canvasBitmapData);
    var canvasRect:Rectangle = new Rectangle(0, 0, 660, 500);
    
    var backgroundSprite:Sprite = new Sprite();
    
    backgroundSprite.scrollRect = new Rectangle(0, 0, 660, 500);
    canvasBitmap.scrollRect = new Rectangle(330, 250, 660, 500);
    
    backgroundSprite.addChild(canvasBitmap);
    backgroundSprite.cacheAsBitmap = true;
    
    addChild(backgroundSprite);
    
    var tempScoreText = new TextField();
    tempScoreText.text = "temp score";
    backgroundSprite.addChild(tempScoreText);
    
    this.stage.addEventListener(MouseEvent.MOUSE_MOVE, function(event):void {
        backgroundSprite.scrollRect.x = mouseX;
        backgroundSprite.scrollRect.y = mouseY;
    });
    

    If this isn’t what you’re looking for, maybe you could upload a swf for me so that I could see what you see? Perhaps a SOF chat is in order as well. I’ve been stuck before and people have helped me out so this is just me paying it forward.

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

Sidebar

Related Questions

I have got a serious problem running our web app in some machines.. machines
Here's the situation: I have a web-based ticket application, multiple users. One problem that
I've got a serious problem with my GPS on my Nexus One: I wrote
I have a list of albums which I got using this: private List<Album> getAlbums()
We have an automated build, managed by Hudson (1.312), that's got a few layers.
I've got a pretty strong background in C-style languages. And have worked on several
I Have a really serious Problem on my end: Im Making an Audio Synchronized
I've got a serious issue here. I'm developing a forum, and trying to get
I've got a serious doubt. Suppose the following scenario: You have a UIViewController onscreen.
My company currently has some serious problem. We've got an application as showcase on

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.