Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ActionScript help

Status
Not open for further replies.

DGTLguy

Technical User
Jul 23, 2003
125
US
looking for help writing very simple code...

need program to:
INPUT (number of people)
INPUT (age) //repeating for each person
OUTPUT average age

thats it! very easy but i need direction...
check out my work in progress for clarification:

 
doesnt make sense as it stands....dont you want to input a number of diffent ages then output the avearge....in which case you dont the number of people...just a number of ages

these can be input one at a time or all at once

more details are required before an answer can be given
 
if you visit the link you will see the setup...

enter the number of people,
then continue to input ages and hitting submit until
it returns the average age

... this is not my setup, i just have to execute it...

take a look at the link above and the visuals might help
 
looked at the link ....hence my question

eg enter 10 people...then you have to enter 10 ages (and check 10 have been entered) and either have have a button click after each entry or a delimeter after each age ( a comma or whatever)

as you said in the original post...dead easy to code...but its how the interface has to work that the question
 
[bigcheeks]

Regards,

cubalibre2.gif
 
click of the submit button after every input of age...

i conceptually know what i want to do but the actionscript lang. is new to me
 
d guy,
i am sajay from india
i am a new comer to computer field but feel more craze than attached
i think you have undergone some c training
that is why such a question
for next etc

you can do the same trick here

(remember I need time to work out some thing)

set an arry
mypeoplenum=new array ()

and add the number of times of people from the first box
ie for(i=0,i<pnum,i++)

where i is a simple variable
pnum stands for the number user types in the first box
remeber array subsricpts starts from zero
so this loop will work for that much number of times

duplicate movie(some movie,&quot;&quot;,&quot;&quot;)
add a button
on (press){
yy=yy+1
mypeoplenum[yy-1]=number(textbox)
zz=zz+agebox


//then finally

myaverage=zz/yy

}


// i don't remember what is the parameters required
// i don't have flash in this system
// try this and sure i will try out this for you
//

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top