
-----------------------------------
wysper
Wed Apr 28, 2010 11:04 am

Adobe Flash CS4 Code
-----------------------------------
I'm a little new to the website so im unsure if this is the proper place to post this..but i need help writing and understanding code for Adboe Flash CS4..so if some one knows the language, please help me.

I'm making a game where you feed a man a burger and he gets lbigger (its a cheesy game, but its for school :P)
i have a timer everything works(kinda) but i need to know how to make a counter..something to let the people who play know how many burgers they've fed the man.
i made a dynamic text with three zeros and static text saying "Burgers Fed" but im unsure of the code i need to make it all work.

i havent the slightest how to post a file in this so i could show what i have done so far..so if someone could tell me how, that would also be very helpful, ty for your help  :)[/list]

-----------------------------------
wysper
Wed Apr 28, 2010 11:06 am

RE:Adobe Flash CS4 Code
-----------------------------------
OH!..i for got to put..i have a dragable burger, and it reacts to the man..he gets bigger when the burger is released over his body..so..that might help :D

-----------------------------------
Insectoid
Wed Apr 28, 2010 11:10 am

RE:Adobe Flash CS4 Code
-----------------------------------
In the most brutal pseudo-code possible;

[code]
var counter = 0
if (burger_released) {
    counter ++
}

//and then in your update loop or whatever
dynamic_text_box.text = counter
[/code]

I haven't used flash in a while, and I've never used CS4, so I don't know if it's changed since, but that should work with tweaking (replacing conditionals and variable names with actual code).

-----------------------------------
wysper
Wed Apr 28, 2010 11:20 am

RE:Adobe Flash CS4 Code
-----------------------------------
i'll try that next period..thanx  :D

would i be applying that to the frame, or a specific object?

-----------------------------------
Insectoid
Wed Apr 28, 2010 2:43 pm

RE:Adobe Flash CS4 Code
-----------------------------------
This would be in the document class, though it could be implemented on the burger.

-----------------------------------
wysper
Thu Apr 29, 2010 11:59 am

RE:Adobe Flash CS4 Code
-----------------------------------
I GOT IT..kinda..lol :P

it works on a test..but the actual counter doesnt move..the output table shows counting..but the dynamic text box just..chills there :/

-----------------------------------
Insectoid
Thu Apr 29, 2010 3:05 pm

RE:Adobe Flash CS4 Code
-----------------------------------
Then you aren't telling it what to do properly. Or flash is just being stupid and you should switch to a language that isn't being phased out.
