I have a score that goes up by 10 every time you press this button, its var "score". I have a simple countdown timer. caller, its var "timer". When the game ends it goes to the next frame which says game end. I can get the score to show but I want the time left to be added to this. I have tired: onEnterFrame (){ score = Number(score) + timer; } Nothing seems to work. Do I even actually use onEnterFrame ?
I am working on a project and I cannot get my final code to work correctly. Theoretically, each answer "yes" or "no" gets a score, then those scores are added to take the user to one of three possible outcome pages.[code]
the first variable works perfectly and the secon does too but i want to make final score get the total_score and divide it by 10 like final_score = total_score / 10 but it dont works so how do i fix it?
I am editing a flash game,I want that whenever user press the submit button,his score should be saved in the database at my Server.How i can achieve this task?I had got the variable in which score is stored.I can i send this to my database.
I've decide racing car game! and I want to be able to send the score to send to a mail box or send it to a table in php or database! at the moment I can send the Score Variable to be display in PHP but its not the way that I want!
Script that send the Score to php submit.onPress = function () { getURL ("getVars.php", "_blank", "POST");
I am trying to get a high score table set up and I have it all working except for an if statement which decides whether to put a zero in the time or not. ActionScript Code: variable declared at the top var gap:String;
This is getting data that is stored - it works fine except for the underlined "gap" - The "gap" is meant to be calling the variable which has the below if statement ScoreInputScore.text=String(SpotTheDifferenceGame._minute)+gap+String(SpotTheDifferenceGame._second); if (SpotTheDifferenceGame._second<10) { gap=(":0"); } else { gap=(":"); }
I thought by have the variable called in in the function and having the if statement with gap= it would do the specified text in the dynamic text box. When I put a trace on "gap" it traces with the correct text depending on what the number is but in my dynamic text box it displays as number null number. // displays like this when trace put on it :0 // displays like this in dynamic text box 2null02
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??
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
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.
I'm currently having a fair amount of trouble doing something that in it's concept is quite simple but appears to be hard to make happen.I am hoping to check a textfield, whatever is in that text field is then used as a variable to set another textfield, for example:
I'm using createTextField to create a textfield. I have also created a input textfield with a variable called textline1 (I don't create the inputfield with as).I want to display the letters in the created textfiled that I'm typing in the input field. So this in my AS coed:
_root.createTextField("text1",1,100,100,300,100); text1.variable = textline1; format1 = new TextFormat();
I simply want to do is display a variable via a Textfield. This was easily done in AS2 by making a var; "var1", then making a textfield with a var; "var2", and having code that var2 = var1...
But of course this can't be done now.. =(
I have a found a tutorial where you create a textfield version fot he variable.. this being the coding..
ActionScript Code: var myText:TextField = new TextField(); myText.text = "Hello!"; myText.x = 200 myText.y = 200 addChild(myText);
But from my experience of AS in the past (AS2) Any Textfield which utilises "text here" is not possible to show coding such as
ActionScript Code: myText = myText+=1;
Which is all I want to do. I want a variable. Editable with easy, simple coding such as the one just above. Which is displayed in a textfield. Which will constantly update it's display of the variable as the variable changes.
Just like what was easily done in AS2...
I have tried to find out tutorials etc, after finding out about the one above, I foudn one which was meant to be able to update the textfield. But ti utilised event lsiteners, of which I know nothign about, and the tutorials I've found didn't ..tutorial very well.. didn't even say what was with all the "package" stuff..
I've seen many times the following procedure to assign a variable name to a text field: - We create a generic movieclip which contains a dynamic text field called "tittle" (for example) - We add 4 instances of this movieclip to frame 1 in our main time line. - We give them a different name (testMC1, testMC2, testMC3 and testMC4) - We also add this little AS into frame 1: testMC1.tittle = "Hello"; testMC2.tittle = "How"; testMC3.tittle = "are"; testMC4.tittle = "you";
If we run the fla we'll have the 4 movieclips on screen "Hello How are you". So far, it's ok, no problem and everything's understood. However I'm trying to implement a variation for this method which I need to use, but I'm not succeeding. I'd like to assign the variable values from a plain text file instead.
Hence, I create a plain text file called "Exampletext.txt". Inside this file I put the following variable values: &variable1=Hello &variable2=How &variable3=are &variable4=you
I add this piece of AS lo load the variables from the text file: this.loadVariables ("Exampletext.txt"); And finally, I modify this bit too: testMC1.tittle = variable1; testMC2.tittle = variable2; testMC3.tittle = variable3; testMC4.tittle = variable4; And well, it does not work at all!
I'm trying to get a variable that I get from a PHP-script to be a link in a textfield.
Right now I'm using an html tag to make a link to the information I want to display...
This works but I think its not good enough... I want to get a "rollOver" function on the Headline instead of a new line that says click me.
The following code displays in the textfield "content":
News
Headline <--Headline from the database Teaser <-- Text from the database Click me <-- Html link that displays the full text in a textfeild called "info"
I am having a bit of a headache with regards to this problem
Code:
class A { private var tf:TextField; private var canvas:MovieClip
[code]....
Why is it that the above code does not work? I need reference to the textfield so i can apply different TextFormats depending on the state of target_mc.Why does flash complain that Void is found where textField is expected?
I'm using the following code to try and change the font size of a textfield dynamically using a varaible but I can't get size to use the variable as a value however all the other variables I combine with the string works as intended just not size ....
Comparison of number or string is understandable. But how come when in flash AS3.0, we do :
var a:TextField = new TextField(); var b:TextField = new TextField() ;
[Code]....
Is their some Application-wide ID, that flash gives to each component instance. Or is it compairson of the strings ( comparing the whole path of each component )
Some might know by know that I am working on a school project.But my knowledge of AS3 is not so big.My game is doing what it is supposed to do (for now).But the place where I declare (or something.It now looks like this:
I'm testing the equality of an input textfield and a string variable. For some reason, it's always resolves to false even when the values it traces out are the same.[code]
I am building a project where I got XML text displayed on a textfield. How can I change a specific word's color through actionscript 3 instead of doing it on XML? I though of creating a String variable for my word and then using that variable in my textfield.text, it works but is it possible to set a color for that variable?
i'm creating a completely dynamic form. i want to assign a variable name to a textfield and then pass that variable with a LoadVars() object.
here's a small piece of code i can't get working:
//create movieclip (used like a form) _root.createEmptyMovieClip( 'dialog_body', 0 ); //create textfield input
[Code].....
bottomline: if i create a textfield using the traditional method and assign the 'var' it works fine. if i create a textfield dynamically at run time, and use the *.variable property, the variable is NOT sent..