473,404 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Moock's VirtualPet - TextField Update not working

Hi...

I've followed Colin Moock's AS3 notes to create a VirtualPet
I've got it working from the code at: http://www.adobe.com/devnet/actionsc...n_moock_f6.pdf

...but am now trying to add a textField on the stage that will display the % of calories remaining.

Extra code I have created in VirtalPet.as:
1. private var petView (An instance of VirtualPetView)
2. petView.displayInfo() (Called from the digest() method, which is called by the Timer every second)

Extra code I have added in VirtualPetView.as:
1. The method, displayInfo()
2. The method, createTextField(whichField:TextField, x:Number, y:Number, align:String, size:Number, color:Number, bold:Boolean)
3. The textField calories_txt, created in VirtualPetView by the above method.


The problem:
It displays correctly at first: "50% remaining". However there is no change to the textField content after that, as the VirtualPet becomes more and more hungry.
The method which should update the textField is called displayInfo(), and is definitely being called, as a trace action within the function is working properly, giving the correct value of remaining calories.


Please see the source code in the zip file at: http://www.adamfrost.net/problems/Moock_VirtualPet.zip
Sep 22 '08 #1
0 1749

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: - ions | last post by:
I have created a JComboBox with its Items as a list of "M" numbers ie. M1,M2,M3.......throgh too M110 (thes are the messier objects, a catolouge of deep sky objects) the user selects of of these...
2
by: C. Armour | last post by:
Help me, I'm suffering! Situation: I have a load() function which loads a bunch of TextFields with values. There are TextListeners registered for each of these TextFields. Thus, changing the...
1
by: Veverita | last post by:
Hi there I'm hoping that someone can help me with a question I have about javascript syntax. I got an html page that uploads an image and some text field to a database. What I'd like to do...
1
by: Suresh | last post by:
How do I insert a char into the textfield on the keypress event of another textfield? I have two textboxes, "text1" and "text2". Important: "text1" is outside the table. "text2" is inside...
3
by: Sidney Linkers | last post by:
Hi, I'm trying to make a calculated text field in a query where the textvalue is being populated from multiple records. I already use a VBA function to loop through records and concatenate the...
1
by: UrKo | last post by:
Hi all, First let m say that i did search and found lots of answers to my problem and have solved it partial. I have a main form that include subform. I needed to get the data from combo box...
9
by: learning | last post by:
Hi! Here's my situation: I have one textfield with one 'submit' button in PAGE1.PHP. When I click on the 'submit' button I am sent to PAGE2.PHP where I have a "switch" routine that checks...
2
jkmyoung
by: jkmyoung | last post by:
I was trying to create an applet with a TextField that would only accept an integer, and ignore any other keystrokes. Eg, if a user typed in an 'f' into the field, the TextField should ignore it, and...
2
by: theophilus | last post by:
i am currently working on a project which should enable a user to enter a gaelic word. i am using actionscript/flash develop. i have created a textfield in flash 8 and its property is set as Input...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.