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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:47:11+00:00 2026-05-13T13:47:11+00:00

My Brain Is Going to Explode.. . I have five images all named 0,1,2,3,4.

  • 0

My Brain Is Going to Explode.. .

I have five images all named 0,1,2,3,4.

I have five buttons, btn1, btn2, btn3, btn4, btn5.
The buttons are laid out like:

• • • • •

when an image (lined to a button) is active it looks more like this

if image 1 is active:

• (•) • • •

A timer is running, at the end of 240 seconds, the image on the bottom of the display stack has its alpha set to 0. It is then placed on the top of the stack and its alpha is tweened in.

A user can bypass the timer and advance to whichever image he likes by clicking a button.

btn1 brings up image 0.
btn2 brings up image 1 and so on.

What happens if image 3 is showing and the user clicks btn2 is image 1 ends up at the top and the new stacking order is: 1,3,4,0,2.

Meaning now my images are out of order, (in terms of the button layout). and the highlighted buttons are no longer in order (or in the order the client wants the images to display).

how do I re-stack the images so that if I click btn 4, the images line up behind it correctly?

I know this isn’t a horribly difficult question, I’m just not in the mood to solve this little brain teaser, perhaps you are. Thanks!
-J

  • 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-13T13:47:11+00:00Added an answer on May 13, 2026 at 1:47 pm

    If I understand your problem, then something like this should work:

    public function setSelected($index:Number) {
        var i:Number = 0;
        for (i = 0; i < $index) {
            addChild(images[i]);
        }
        for (i = $index + 1; i < images.length; i++) {
            addChild(images[i]);
        }
        addChild(images);
    }
    

    Where images is an array of your images and index is index number of the button you clicked on. So, 0 for btn1.

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

Sidebar

Related Questions

A friend and I are going back and forth with brain-teasers and I have
I nearly have this going but don't have sufficient brain power to work out
I am going brain dead on this; I have several List' defined, based on
I have got a bit of 'brain fade' going on this afternoon, so if
I have just had a brain block, I have a Deck object and want
Annoying brain numbing problem. I have two functions to check the length of a
Setup Have you ever had the experience of going into a piece of code
Here is one to get your brain going! I've not had any luck with
I really don't know what's going on here, I've been racking my brain for
I have been racking my brain on this one for hours now and I

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.