Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-20-2011, 07:30 AM   #1
Tripolinero
Member
 
Join Date: Jan 2011
Posts: 51
Default [AS3] How To Keep Score

i did this but it only counts once and shows 10 and then stops..what am i missing ?

Last edited by Tripolinero; 06-20-2011 at 01:58 PM.
Tripolinero is offline   Reply With Quote
Old 06-20-2011, 08:52 AM   #2
Tripolinero
Member
 
Join Date: Jan 2011
Posts: 51
Default

[QUOTE=Tripolinero;1084114]i did this but it only counts once and shows 10 and then stops..what am i missing ?


i know that i need a loop but where and how i dunno ? can anyone help plz ?

Last edited by Tripolinero; 06-20-2011 at 01:58 PM.
Tripolinero is offline   Reply With Quote
Old 06-20-2011, 09:01 AM   #3
benjio21
Senior Member
 
Join Date: Jan 2011
Location: uk
Posts: 502
Send a message via Skype™ to benjio21
Default

Why isthe score a String? Change it to a int. Then use
ActionScript Code:
MyTextBox.text = String(score)
That should help. Ben
__________________
as3 is like marmite ("you either hate it or love it");
benjio21 is offline   Reply With Quote
Old 06-20-2011, 10:16 AM   #4
Tripolinero
Member
 
Join Date: Jan 2011
Posts: 51
Default

i tried that but i kept getting a n error : Scene 1, Layer 'Action', Frame 2, Line 160 1086: Syntax error: expecting semicolon before score.


here is my code so far maybe this helps cause i checked my semicolons and it seems that all are closed :S

Last edited by Tripolinero; 06-20-2011 at 02:00 PM.
Tripolinero is offline   Reply With Quote
Old 06-20-2011, 10:48 AM   #5
benjio21
Senior Member
 
Join Date: Jan 2011
Location: uk
Posts: 502
Send a message via Skype™ to benjio21
Default

The brackets should be around score not String.
ActionScript Code:
String(score);
Not
ActionScript Code:
(String)score;

Ben
__________________
as3 is like marmite ("you either hate it or love it");
benjio21 is offline   Reply With Quote
Old 06-20-2011, 01:08 PM   #6
Tripolinero
Member
 
Join Date: Jan 2011
Posts: 51
Default

nothing changed. thanks for your try

Last edited by Tripolinero; 06-20-2011 at 01:59 PM.
Tripolinero is offline   Reply With Quote
Old 06-22-2011, 08:05 AM   #7
SephirothOWA
Senior Member
 
Join Date: Jun 2010
Location: Ipswich, England
Posts: 260
Default

My question is why would you encrypt your zip file if you openly ask for help?
SephirothOWA is offline   Reply With Quote
Old 06-20-2011, 09:48 AM   #8
chunobi
Member
 
Join Date: May 2011
Posts: 98
Default

I think you are looking for Event.ENTER_FRAME or TimerEvent.TIMER to check every certain period of time for these conditions:

ActionScript Code:
addEventListener(Event.ENTER_FRAME, check); function check(e:Event) {   //Everything here is done every frame (speed based on your project's fps) }
chunobi is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:59 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.