Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 72601

Re: Basic ActionScript 3 help please! (Displaying an integer value)

$
0
0

I don't see anything readily wrong with your code except for a few minor things.

 

You should specify the variable type when you declare it, as in...

 

     var quizScore:int = 0;

 

When assign a numeric value as a String you should cast it as such...

 

    score.text = String(quizScore);

 

You can shorten the scoring code

 

    quizScore += 1;

    quizScore -= 1;  etc

 

As far as nothing happening goes, I would expect a possible warning regarding the second item I mention, which makes me think that maybe you do not have the publishing set for Actionscript 3.  Check to be sure that you have AS3 selected in the Publish Settings.

 

Beyond that, how is the quiz set up along the timeline?  It is possible that the code is assigned to objects that are no longer present if you are walking down the timeline.  That could explain why you get no error messages.


Viewing all articles
Browse latest Browse all 72601

Trending Articles