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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:12:40+00:00 2026-05-20T10:12:40+00:00

I’m looking to take an object that contains String and Integer context and that

  • 0

I’m looking to take an object that contains String and Integer context and that has pushed upon a Stack and pop those specific contents into a display that the user can see. The display consists of two textareas and a label.

I can’t figure out how to access the individual parts of the Object to display them though..

Here’s my Stack.as class:

Stack.as

package
{

// credit for this class: *@author Michael Avila

import Node;

public class Stack
{
    private var first:Node;

        public function isEmpty()
        {
            return first == null;
        }

        public function push(data:Object)
        {
            var oldFirst : Node = first;
            first = new Node ();
            first.data = data;
            trace(first.data.toString());
            first.next = oldFirst;
        }

        public function pop():Object 
        {
            if (isEmpty())
            {
                trace ("Error: \n\t Objects of type Stack must contain data before you attempt to pop");
                return true;
            }
            var data = first.data;
            return Object;
    }
  }
}

And here’s how i’m popping it:

…

private function nextMoveLPart(event:EffectEvent):void  // open up connection get 
        {
            if(shuffle == 0)
            {
            var r:Object = s.pop();
            trace(r);
            stext1.text = r.cSide1;
            trace(r.cSide1);
            stext2.text = r.cSide2;
            cardNumberLabel.text = r.id;

…

Here’s how I’m pushing it on stack:

if(i<=numResults-1)
            {

                var row:Object = result.data[i];
                s.push(row);
                stext1.text = row.cSide1;
                stext2.text = row.cSide2;
                cardNumberLabel.text = row.id;
            }

Any help or advice would be awesome and much appreciated. Thank you!

REVISION

To Push:

public var stackArray:Array = new Array();

…

if(i<=numResults-1)
            {

                var row:Object = result.data[i];
                stackArray.push(row);
                stext1.text = row.cSide1;
                stext2.text = row.cSide2;
                cardNumberLabel.text = row.id;
            }

To Pop:

if(shuffle == 0)
            {

                var r:Object = stackArray.pop();
                if(r != null)
                {
                stext1.text = r.cSide1;
                stext2.text = r.cSide2;
                cardNumberLabel.text = r.id;
                }
  • 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-20T10:12:41+00:00Added an answer on May 20, 2026 at 10:12 am

    Looks like this part is wrong

    public function pop():Object 
            {
                if (isEmpty())
                {
                    trace ("Error: \n\t Objects of type Stack must contain data before you attempt to pop");
                    return true;
                }
                var data = first.data;
                return Object; <<<<<<<<<<<<<<<why just return Object, why not return first.data and remove first.data from the list.
        }
    

    Looks like a linked list implementation if an array could be used it’ll probably save some headaches by using an Array and using push and shift it looks like if you want a traditional Stack behavior.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Array.html

    Hope that helps,

    Shaun

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

Sidebar

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
i got an object with contents of html markup in it, for example: string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a jquery bug and I've been looking for hours now, I can't
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

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.