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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:23:13+00:00 2026-05-31T05:23:13+00:00

Working on an RPG type flash, and I have to be able to control

  • 0

Working on an RPG type flash, and I have to be able to control a text-box from quite a few locations. The one that is causing me trouble is the inventory. I need to be able to access the textbox with an instance of “statusWindow” from within the inventory clip (instance name “inventory”), so when I mouse over an item within the movieclip it will change the status window on the stage.

In this instance I want to mouse over inventory.invHealth from the main timeline to get the display.
itemName and itemProps are strings containing information about the item.

I tried the following but it gave me a “possibly undefined” error.

    invHealth.addEventListener(MouseEvent.MOUSE_OVER, itemStats);

    function itemStats(e:Event):void
    {
        root.statusWindow.text = itemName+"\n"+itemProps;
    }

I’m not very adept in AS3 just yet, so if you could also explain your code when you post it -though most people usually do anyway- I would very much appreciate it. 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-31T05:23:14+00:00Added an answer on May 31, 2026 at 5:23 am

    I would advice you to store the information data in a class object; that object should be accessible by both the statusWindow and the inventory clip. This way there’s no need to “read” a textbox, you will have different views on the same data. For example:

    public class GlobalVars
    {
        public static var health:Number;
    } 
    

    You could of course create a more structured information data, like:

     public class Item
     {
          public function Item(setname:String)
          {
             name=setname;
             health = 100;
             quantity = 0;
          }
    
          private var name:String;
          private var health:Number;
          private var quantity:Number;
     } 
    
     var inventory:Array = new Array();
     inventory.push(new Item("hammer"));
     inventory.push(new Item("gun"));
     inventory.push(new Item("sponge"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A few friends and myself have been working on an XNA RPG once a
I'm working on a browser-based RPG for one of my websites, and right now
Working sample using one Table SELECT t.* FROM ( SELECT TITLE.name, (TITLE.value-TITLE.msp) AS Lower,
Working with a Lucene index, I have a standard document format that looks something
I have been working on creating an RPG combat sim for code-practice. A single
Working with SSRS and a SQL 2000 source, I have a stored procedure that
I'm currently working on a programming assignment for school. It's a simple text-based RPG.
For background I have been working on an RPG based off Ray Wenderlich's tutorials.
I'm working on a simple text rpg and I'm storing all of my data
I am working on a Text-Based RPG for Android (just built around the default

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.