• Advertisement

Jeramey Jones

Member
  • Content count

    3
  • Joined

  • Last visited

Community Reputation

101 Neutral

About Jeramey Jones

  • Rank
    Newbie

Personal Information

  1. Thanks alot paulstamp! It worked, my fields now update...
  2. Thank you paulstamp, I will try setting up an enterframe function. As for the data, I am trying to pass the information back and forth between the frames and the code. I will let you know how it turns out.
  3. Hey All, I am trying to have my Dynamic Text values communicate across several frames and with the document class. I get a consistent error that states my dynamic text fields contain null values, when they contain numeric values at the time of running the code. The error is as follows: [color=#FF0000]TypeError: Error #1009: Cannot access a property or method of a null object reference.[/color] [color=#FF0000]at TDQuest/getInventory()[/color] [color=#FF0000]at TDQuest()[/color] The full document class code is as follows: [color=#0000FF]package [/color] [color=#0000FF]{[/color] [color=#0000FF]import flash.display.MovieClip;[/color] [color=#0000FF]import flash.display.SimpleButton;[/color] [color=#0000FF]import flash.display.*;[/color] [color=#0000FF]import flash.text.*;[/color] [color=#0000FF]import flash.ui.*;[/color] [color=#0000FF]import fl.controls.Button;[/color] [color=#0000FF]import fl.controls.*;[/color] [color=#0000FF]public class TDQuest extends MovieClip[/color] [color=#0000FF]{[/color] [color=#0000FF]public var invBasic,invCannon,invElemental,invGold,invLumber,invStone,invOre,invGems:uint;[/color] [color=#0000FF]public var intExp:int;[/color] [color=#0000FF]public function TDQuest()[/color] [color=#0000FF]{[/color] [color=#0000FF]getInventory();[/color] [color=#0000FF]}[/color] [color=#0000FF]function UpdateButtons()[/color] [color=#0000FF]{[/color] [color=#0000FF]if (currentLabel=="World Map")[/color] [color=#0000FF]{[/color] [color=#0000FF]btnNav1.label="Character Sheet";[/color] [color=#0000FF]btnNav2.label="Inventory";[/color] [color=#0000FF]btnNav3.label="Shop";[/color] [color=#0000FF]btnNav4.label="Upgrades";[/color] [color=#0000FF]btnNav5.label="Crafting";[/color] [color=#0000FF]btnNav6.label="Main Menu";[/color] [color=#0000FF]}[/color] [color=#0000FF]else if (currentLabel=="Character Sheet")[/color] [color=#0000FF]{[/color] [color=#0000FF]btnNav1.label="World Map";[/color] [color=#0000FF]btnNav2.label="Inventory";[/color] [color=#0000FF]btnNav3.label="Shop";[/color] [color=#0000FF]btnNav4.label="Upgrades";[/color] [color=#0000FF]btnNav5.label="Crafting";[/color] [color=#0000FF]btnNav6.label="Main Menu";[/color] [color=#0000FF]}[/color] [color=#0000FF]else if (currentLabel=="Inventory")[/color] [color=#0000FF]{[/color] [color=#0000FF]btnNav1.label="World Map";[/color] [color=#0000FF]btnNav2.label="Character Sheet";[/color] [color=#0000FF]btnNav3.label="Shop";[/color] [color=#0000FF]btnNav4.label="Upgrades";[/color] [color=#0000FF]btnNav5.label="Crafting";[/color] [color=#0000FF]btnNav6.label="Main Menu";[/color] [color=#0000FF]}[/color] [color=#0000FF]else if (currentLabel=="Shop")[/color] [color=#0000FF]{[/color] [color=#0000FF]btnNav1.label="World Map";[/color] [color=#0000FF]btnNav2.label="Character Sheet";[/color] [color=#0000FF]btnNav3.label="Inventory";[/color] [color=#0000FF]btnNav4.label="Upgrades";[/color] [color=#0000FF]btnNav5.label="Crafting";[/color] [color=#0000FF]btnNav6.label="Main Menu";[/color] [color=#0000FF]}[/color] [color=#0000FF]else if (currentLabel=="Upgrades")[/color] [color=#0000FF]{[/color] [color=#0000FF]btnNav1.label="World Map";[/color] [color=#0000FF]btnNav2.label="Character Sheet";[/color] [color=#0000FF]btnNav3.label="Inventory";[/color] [color=#0000FF]btnNav4.label="Shop";[/color] [color=#0000FF]btnNav5.label="Crafting";[/color] [color=#0000FF]btnNav6.label="Main Menu";[/color] [color=#0000FF]}[/color] [color=#0000FF]else if (currentLabel=="Crafting")[/color] [color=#0000FF]{[/color] [color=#0000FF]btnNav1.label="World Map";[/color] [color=#0000FF]btnNav2.label="Character Sheet";[/color] [color=#0000FF]btnNav3.label="Inventory";[/color] [color=#0000FF]btnNav4.label="Shop";[/color] [color=#0000FF]btnNav5.label="Upgrades";[/color] [color=#0000FF]btnNav6.label="Game Screen";[/color] [color=#0000FF]}[/color] [color=#0000FF]}[/color] [color=#0000FF]public function getInventory()[/color] [color=#0000FF]{[/color] [color=#0000FF]gotoAndStop("Inventory");[/color] [color=#0000FF]invBasic=Number(inventoryBasic.text);[/color] [color=#0000FF]invCannon=Number(inventoryCannon.text);[/color] [color=#0000FF]invElemental=Number(inventoryElemental.text);[/color] [color=#0000FF]invGold=Number(inventoryGold.text);[/color] [color=#0000FF]invLumber=Number(inventoryLumber.text);[/color] [color=#0000FF]invStone=Number(inventoryStone.text);[/color] [color=#0000FF]invOre=Number(inventoryOre.text);[/color] [color=#0000FF]invGems=Number(inventoryGems.text);[/color] [color=#0000FF]trace("Basic Towers: " + invBasic);[/color] [color=#0000FF]trace("Cannon Towers: " + invCannon);[/color] [color=#0000FF]trace("Elemental Towers: " + invElemental);[/color] [color=#0000FF]trace("Gold: " + invGold);[/color] [color=#0000FF]trace("Lumber: " + invLumber);[/color] [color=#0000FF]trace("Stone: " + invStone);[/color] [color=#0000FF]trace("Ore: " + invOre);[/color] [color=#0000FF]trace("Gems: " + invGems);[/color] [color=#0000FF]}[/color] [color=#0000FF]}[/color] [color=#0000FF]}[/color] I have tried moving the code into separate functions, new classes and other document classes. I cannot seem to get the data to transfer to the document class or other frames. I have tried having the document class create and place the text fields with the same result. I am starting to think that there is a configuration setting that I am missing. Any advice or suggestions would be appreciated.
  • Advertisement