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

The Archive Base Latest Questions

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

I was trying to make a similar thing with the game SameGame (ie. the

  • 0

I was trying to make a similar thing with the game SameGame (ie. the block above the removed blocks fall downward). Before trying this with an Array that contains MovieClips, this code worked (tried it with int values). With MovieClips on the array, it seems not working the same way.

With int values, example:

popUp(0, 4): Before: 1,2,3,4,5,6,7,8,9,10; After: 1,2,3,4,6,7,8,9,10

But with MovieClips:

popUp(0, 4): Before: 1,2,3,4,5,6,7,8,9,10; After; 1,2,3,4
// Assume the numbers are movieclips XD

Basically, it strips everything else, rather than just the said block >_<

Here’s the whole method. Basically, two extra arrays juggle the values above the soon-to-be removed value, remove the value, then re-stack it to the original array.

What could be wrong with this? And am I doing the right thing for what I really wanted to emulate?

function popUp(col:uint, row:uint)
    {
        var tempStack:Array = new Array();
        var extraStack:Array = new Array();
        tempStack = IndexArray[col];
        removeChild(tempStack[0]);
        for(var ctr:uint = tempStack.length-(row+1); ctr > 0; ctr--)
        {
            removeChild(tempStack[ctr]);
            extraStack.push(tempStack.pop());
            trace(extraStack);
        }

        tempStack.pop();

        for(ctr = extraStack.length; ctr > 0; ctr--)
        {
            tempStack.push(extraStack.pop());
            //addChild(tempStack[ctr]);
        }

        IndexArray[col] = tempStack;
    }

PS: If it’s not too much to ask, are there free step-by-step guides on making a SameGame in AS3 (I fear I might not be doing things right)? Thanks in advance =)

  • 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:14:21+00:00Added an answer on May 22, 2026 at 1:14 am

    I think you just want to remove an element and have everything after that index shift down a place to fill what you removed. There’s an inbuilt function for this called splice(start:uint, length:uint);

    Parameters:
    start – the index to start removing elements from
    length – the amount of elements to remove

    var ar:Array = ["hello","there","sir"];
    
    ar.splice(1, 1);
    

    ar is now -> [“hello”, “sir”];


    As per question:

    Here’s an example with different types of elements:

    var ar:Array = [new MovieClip(), "some string", new Sprite(), 8];
    ar.splice(2, 1);
    
    trace(ar); // [object MovieClip], some string, 8
    

    And further example to display the indexes being changed:

    trace(ar[2]); // was [object Sprite], is now 8
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I saw a similar post that was trying to do this same thing with
I'm trying to make a map generator for a 2d tilemap game (similar to
Both are trying to do the similar thing, which is make some effect on
Im trying to make something similar to twitpic.com's email submission feature. Their address schema
I'm trying to make a similar effect where only a part or 1/8 of
I am trying to make an application that opens a certain file type (similar
I am trying to make a program that will find similar images from a
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
Im trying to make a request from last.fm where I will get similar artists
Im trying to make my own calendar similar to iCal and all is going

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.