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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:32:14+00:00 2026-06-13T13:32:14+00:00

I’m very new to AS3 and I don’t really know all of the basic

  • 0

I’m very new to AS3 and I don’t really know all of the basic syntax yet, even though I read through some guides every day. I am using this bitmapdata canvas to load spritesheets onto a canvas, and using a foor loop, I’ve tried to get the map to populate with tiles but I’ve had no luck.

        for (var i:int = 0; i < columns; i++)
        {
            for (var j:int = 0; j < rows; j++)
            {
                smb3SpriteSheet = new SMB3(new SMB3SpriteSheet(), smb3XML.animation, 175);
                smb3SpriteSheet.x = startX;
                smb3SpriteSheet.y = startY;
                canvas.addSprite(smb3SpriteSheet);
                startX = startX + 16
            }
            startX = 0
            startY = startY + 16
        }

This code is supposed to create a new bitmap data that it’ll add onto a blank background bitmap, setup the x and y coordinates and then move down a space and repeat, but when I compile, the only tile that appears is the last tile. I have looked online but there is no information that I could find about using bitmap data in this way. I am supposed to use it for the assignment.

  • 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-13T13:32:15+00:00Added an answer on June 13, 2026 at 1:32 pm

    I don’t know what SMB3 class should do, but i think you are receiving the last image only because iterating over sprite sheets you call each time the same canvas into you are trying to draw. So each time you call the canvas, actually you are replacing the current content with the new one, even if you are creating new SMB3. You need to consider that a display object cannot have more than a parent.

    So to make your code working either you use a separate Sprite for each image, which is absolutely not recommended, or to use the BitmapData and perform the image drawing of the canvas, and only after that assigning the Bitmap to the Sprite.

    You have a few methods for this operation. You can use BitmapData‘s copyPixels, draw or clone methods.

    Here are two resources which are related to your issue:

    Adding multiple instances of a Sprite?

    Show another instance of a sprite

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I know there's a lot of other questions out there that deal with this
I don't have much knowledge about the IPv6 protocol, so sorry if the question
Does anyone know how can I replace this 2 symbol below from the string
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.