ActionScript 2.0 :: Getting A NaN Error On 'Keeping Score' Tutorial
Mar 1, 2007
I recently did the tutorial on here called "Keeping Score" - where you can click on one button and it will add score to a dynamic text field. Press another and it will subtract. I wanted to take this one step further - although have run into some problems.I have set my stage up so that the MCcontainer loads up a random movie clip each time.. from external SWF's. The idea was to have you click on the random swf's when the pop up and add points.. to the dynamic movie clip on the main stage. Although I end up getting a NaN in the score box.However if I click on a button with the same script in the main movie (not externally) it will add to the score.. and then if I click on the external movie it will add points correctly.[code]I have made sure that it relates to the root - and it only works once a button has been pressed with the same code in the main timeline of the movie, but messes up if you click on the external SWF first.
View 2 Replies
Similar Posts:
Dec 15, 2010
I'm having an actionscript 2.0 problem with keeping score. I have a dynamic text box with a variable called score. I have the following action code for that variable:
_root.score = 0;
For the correct answer button I have this action:
_root.score = Number (score) +10;
This works fine to increase the score by 10 for each correct answer. The problem is that I can't get an if statement to work for when the score reaches 150 to gotoAndPlay a certain frame. I've tried various syntax, I've tried it on the action for a button and an action for the timeline with:
onRelease = function () {
(My learning game is set up to allow for users to answer up to four extra questions to reach the score of 150). Nothing has worked so far.
View 5 Replies
Jun 10, 2010
I create a password and go to save the password and get an error saying it not in the table.The error was because i had to press generate php code.That was so fustrating. couldnt belive it . Ive just wrote the answer now if any 1 else has the same error. It was annoying .
//__________________________________________________ ___________________________________
http://library.creativecow.net/artic...o-tutorial.php
<?PHP
[code].....
View 2 Replies
Oct 1, 2002
I am trying to do a string compare over 2 levels.As you will see when you run the game, When you select the radio buttons and click continue the values are passed to the next movie under the You selected column. I want to compare these with the values in the Correct Answer column.
I have a count that is supposed to be incremented if a string compare is successful (in actions in answers_train.fla), the final value of count is placed in the dynamic text field _level1.score and then it checks the value of count and places a statement in _level1. statement.However my string compare doesnt seem to be working?
View 1 Replies
Aug 1, 2011
I wrote a singleton class to keep track of some variables across my application. I am getting a syntax error that I can't figure out, I am sure that I am missing something simple but it's been one of those days. Anyone see something wrong with my code?
The error is 1084: Syntax error: expecting rightparen before resultNumber.
public static function setResult(int resultNumber, int value): void {
switch(resultNumber) {
case 2: { this.result2 = value; break; }
case 3: { this.result3 = value; break; }
case 4: { this.result4 = value; break; }
case 5: { this.result5 = value; break; }
[Code] .....
View 1 Replies
Aug 10, 2004
Im designing my own game in flash, iv set up a score text box and it works fine. Except i just cant seem to get it to gotoandplay another frame,scene, when it hits a certain score??
View 4 Replies
Oct 24, 2010
I'm going to make a counter that will count the correct answers of an exam questions.The counter will collect only the correct answers from each frame.
Here is the first frame:
var counter:Number = 0;
var correctAns:Number;
correctAns = ans1_mc.alpha;
function clicked1(event:MouseEvent):void
[Code]...
View 1 Replies
Oct 8, 2009
I keep on running into this problem and it has me puzzled. I keep on getting this message. ReferenceError: Error #1069: Property Score not found on Drink and there is no default value.
[Code]...
What puzzles me is if I use the first line with ****, I get that error and if I use the second it works fine. I have received on this forum!!!, maybe someday I will be wise enough to contribute back.
View 2 Replies
Dec 23, 2006
I apoligise if this has been covered many times before but when I run the fuse. tutorial I get the following error: The class or interface 'Fuse' could not be loaded. The error refers to line 7 --- var f:Fuse = new Fuse();
View 5 Replies
Feb 17, 2004
i am building a shooting game and i was wondering if it is possible to have the movie go to frame 3 if the score = 500.I.E Score is displayed in a dynamic text box and everytime the enemy is hit the:
_root.score +=50
=============
on the first frame of the film i have the code
if (_root.score == 500) {
gotoAndPlay(3);
}
View 2 Replies
Nov 14, 2006
Im trying to put together the "scrolling thumbnail" tutorial you have and I have copied it step by step, and dont know where i have gone wrong, when i go to publish it gives me a actionscript error and output like this;
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 10: Syntax error.
Function scrollPanel() {
**Error** Scene=Scene 1, layer=Actions, frame=1:Line 11: There is no property with the name 'b'.
if(_xmouse,b.xMin || _xmouse>b.xMax || _ymouse<b.yMin || _ymouse.b.yMax) {
Total ActionScript Errors: 2 Reported Errors: 2
View 14 Replies
Feb 23, 2011
I have a result screen that shows bonus points and such. I want each text field to increment one after another and also have it increment by a certain amount each frame. Result Screen pops up. First is the player score check the player score, is it more than the score we want to display if the player score is greater than the player display score by 100 increase the player display score by 100 if the player score is greater than the player display score by 10 increase the player display score by 10 else increase the player display score by 1 when finished move to the next score...and so on. I have thought of using timers to move from one score to the next, but not being in an Event.ENTER_FRAME it only does one if then moves to the next one.
Also the if statement for incrementing the score looks ridiculous and I'm thinking there has to be a better way to do it. I was thinking of making it a separate function but then I wouldn't know what to return, or how to return it so it looks like its increasing and not just showing the total number instantly. I'll try to expand on it a little more.
View 1 Replies
May 21, 2010
I have tried replacing all of the class files with the tutorial specimen ones but i still get the error.
[Code]...
Now, not really understanding the error properly I paste dumped the files online for you to look at.
[Code]...
As the error still occured when using the specimen class files I really have no idea where to begin.
View 2 Replies
Mar 22, 2005
I sent an email to pom regarding a tutorial that he wrote, but the email was bounced and he hasn't replied to my PM. I have followed both of pom's tutorials that involve experiments with perspective in Flash, but I have encountered a problem while attempting to duplicate a movie clip symbol in the second tutorial ([URL]). I have a single instance of the "ball" movie clip symbol appearing at random positions. However, I cannot seem to successfully duplicate the symbol instance at random positions using the loop that pom provided:
[Code]....
View 10 Replies
Aug 11, 2010
I have built a catalog in flash that was orginally built in InDesign and exported but it has some small content that is hard to read for the elderly users viewing it and I would like to add a zoom feature or some type of magnifying glass.
View 1 Replies
Mar 3, 2009
So i watched his awesome tutorial on Advanced RollOvers http:[url]....
, Downloaded the source files, and extracted the files, it plays perfectly with the extracted .SWF file. but upon opening the .fla, and re-generating the.SWF file i get this output error
## [Tweener] Error: The property '_frame' doesnt seem to be a normal object of [object ticket_1] or a registered special property.
View 4 Replies
Jul 27, 2005
I am looking for a tutorial called Senocular's 3D car race tutorial
View 1 Replies
Feb 28, 2006
original: I really just need to figure out how to center the pictures. here is what I did I have modified the tutorial that I finished to have a bigger stage for bigger pictures. Everything is working properly but the pictures are displayed on the left side, I want to have them centered in the stage for the images, after clicking on the thumbnails, plus my images are different sizes as well. ranging from 200x410 to 744x410 but all are the same height of 410. i will post up what I am talking about at the end. I believe it is something within either the action script or the xml coding that allows the position of the image to be differently? please help here is what i am talking about[URL] Continued: Here is my coding in action script:
[Code]....
View 4 Replies
Jan 30, 2009
I'm an experience programmer, but I'm pretty new to flash. [URL] I've been following along and learning with some of the tutorials, but I can't quite seem to get the scrollbar to work right. I've written the code in object oriented classes and linked the classes to the library elements, but I am getting an error: "1046: Type was not found or was not a compile-time constant: ScrollBox."
When I remove the linkage to the ScrollBox and just leave the ScrollBar linkage, the scrollbar works great (moves and everything), but the the content of course doesn't scroll.
View 1 Replies
Apr 13, 2004
One of the moderators, could you've a look at this tutorial: [URL] it doesn't works with me, maybe because I've 2004 so if you change loadVars() into LoadVars() it should work
View 2 Replies
Oct 7, 2010
hey im trying to make a mp3 player and when u click on a play btn it plays that song. but i keep getting this output error "Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at slide_fla::MainTimeline/frame1()"
this is my code
ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var slidebind:Rectangle = new Rectangle(3, 3, 159, 0);
var loadsnd:URLRequest = new URLRequest ("s1.mp3");
var thissnd:Sound = new Sound();
[Code]...
View 1 Replies
Aug 15, 2009
I have created a website header that rotates through various images. I have another image that I would like to be off to the left side but partially cover the main header images. I really don't want this image to change with the other images. Is there a way to put this image on its own layer in flash and have it visible the whole time, while the other images change?
View 2 Replies
Sep 14, 2009
i am doing a mario game with flash, as3. i want to mario stay above box when jump above it or i dont want mario to pass through box while walking. mario should crash box like wall.
View 3 Replies
Aug 12, 2011
I'm making this banner, or FMA if you rather call it that, for a company (school assignment). I have some text fading in and out displaying the message. But I want an interactive FMA.I want to make some buttons, and when you go mouse-over on them, I want a picture to be displayed (different image for each button), WHILE the animation keeps going. Thats not the tough part.However, when the animation repeats (starts from the beginning), and if I'm holding the cursor over the button connected to the picture, the picture disappears and I have to go over the button again. [code]
View 1 Replies
Jan 17, 2012
I have an as3 app that loads SWF's with various movie clips inside with a size of 1280 width and 720 height. I would like to fit these SWFs into a content box of height 885 width by 500 height. The SWF must keep a ratio of 1.77. This would be easy if as3 recognised the SWF being 1280 height by 720 width. It doesn't however, and takes the size of the movie clips inside the swf which varies (as long as it's within the original size boundaries). how I can make the SWF's fit into the content box even if the movie clip sizes and therefore the original SWF sizes vary?
View 1 Replies
Aug 25, 2009
I know how to remove all decimals with:
ActionScript Code:
Math.round (xTwo*0.39);
But, how do I keep 1 or 2 decimals?
View 6 Replies
Aug 6, 2006
I need to use a custom cursor.I am doing so by simply hiding the cursor and having a small MC follow the mouse around with a setInterval.I need to make sure the cursor stays at the highest level. The stage is blank and all content is loaded using script. I was just setting up the cursor at the end of the script and using getNextHighestDepth. That was working fine, but now I need to load external stuff into the movie. How can I set up my cursor so that it will stay above all the other clips, regardless of when they are loaded?
View 3 Replies
Jan 7, 2009
I have created a cd-rom in flash which autoruns and opens up as a fullscreen projector. The cd launches various powerpoint files from without the movie, however, once i close the powerpoint file, the projector is no longer fullscreen.
Is there any way I can keep the flash movie running fullscreen behind the powerpoint files, so when i close them, the flash movie is the same.
View 1 Replies
Mar 3, 2009
What is the best way to keep a sub menu visible? The way I have it coding, is onRollOver the menu button, the sub menu is displayed. I want the submenu to disappear onRollOut of the entire menu... how would you do this?
View 2 Replies
May 5, 2009
Does anyone know how to hold a button image after it is clicked? Can you only do this with a movie clip??
View 3 Replies