Under rating threshold (hideshow)
I have a problem with the game over menu. I called it "GameOverMenu" and its export is "GameOverMenu" - just like in the tutorial. Now when I try to run the game, I get this error: "1120: Access of undefined property gameOverMenu." I get that error 8 times - the number of times "gameOverMenu" is written in my Game.as file. I tried changing "gameOverMenu" to "GameOverMenu" but that didn't help. Can someone please explain what the problem is?
Under rating threshold (hideshow)
For score format, the code is correct, but the score format code has to be before the score text code because if you are defining a default text format, you need to define it before drawing the text. ALSO, in order to define scoreText's text format, you have to create it first, so replace this line: static var scoreText:TextField; with this:static var scoreText:TextField=new TextField(); in your variables spot. Take that Cantor.
Under rating threshold (hideshow)
To answer the one question most people have for this tut, defaultTextFormat is WRONG! instead use: scoreText.setTextFormat(scoreFormat);
Quite a simple little error but causes so much frustration :P
Under rating threshold (hideshow)
for the undefined thing when you create your own HeathMeter, i got mine to work by creating a new .as file saved it as HealthMeter.as with this code in it
package{
import flash.display.*;
public class HealthMeter extends MovieClip{
}
}
and no more errors with the custom made HealthMeter.
also the bar on the inside needs to have the instance name bar in the properties as in this screenshot
http://i180.photobucket.com/albums/x64/shadowrider189/flashhelp.jpg
Under rating threshold (hideshow)
I couldn't make my own bar. Even though I made a separate symbol and named it HealthMeterBar and put it inside the HealthMeter symbol. the script couldnt find healthMeter.bar until I copypasted yours. Trying to figure out where you defined "bar" plz enlighten me? :)
Under rating threshold (hideshow)
Im getting this error on page 8: 1119: Access of possibly undefined property healthMeter through a reference with static type Class. why is this? anyone?
Under rating threshold (hideshow)
For anyone having trouble with the text format part, It worked for me (as written) only after I got through page 5 of the tutorial. Hopefully that helps. :)
Under rating threshold (hideshow)
just add score text on stage from toolbar and problem solved. Make it Dynamic text, choose your own font, size etc, click embed, name it ScoreText, choose numerals only, export for ActionScript /export in frame 1 and click ok, then give it a name of the text you added on stage "scoreText" and thats it, you can use it in your game
Under rating threshold (hideshow)
To apply default text format to the text, you should set the default text format first and then set the text which must inherit this format. Also, if you want the text to look glowing and to cast a shadow (like in the example), add the following to your code: scoreText.filters = [new DropShadowFilter(), new GlowFilter(0x000000)];
Under rating threshold (hideshow)
Formating of scorebord is not working , and i think is not my fall and this code not works in CS6... and what i must to do i have no idea ... :/
Under rating threshold (hideshow)
Great series. I thank you, Moly.
One question, though. When my ship dies via crashing into an enemy, I get an error message a "reference to a null object" when it's going through the code that removes all enemies from the screen. This ONLY happens when I die from crashing. Anyone have any idea about that?
Under rating threshold (hideshow)
Please disregard this:"The source file downloaded from the 1st page is not working i.e. the game.fla when 'Test Movie' produced only a static page with no button interactions."
What I meant was :
The source file downloaded from the 1st page is not working properly i.e. the game.fla during 'Test Movie', when spacebar is pressed, the ship disappeared, and the error messages appeared in the output window >> TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Ship/move()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Ship/kill()
at Ship/takeDamage()
at EnemyShip/enterFrame()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Ship/kill()
at Ship/takeDamage()
at EnemyShip/enterFrame()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Explosion/enterFrame()
TypeError: Error #1009: ...............
Under rating threshold (hideshow)
The source file downloaded from the 1st page is not working i.e. the game.fla when 'Test Movie' produced only a static page with no button interactions.
Under rating threshold (hideshow)
it seems if i have the resetscore(); thing up the score box doesnt even show up… if i dont the score doesnt update when it is called to but just disappears.
Under rating threshold (hideshow)
I got mine to work(YAY!!!) the problem was the .fla wasn't saved there for is was like not having the healthMeter in the library when I tried to change its scale.
Under rating threshold (hideshow)
milkonmonday, you're getting NaN because you never set score =0; It has to be initliazed. before you can use it. Thats why changing it to score =points works.
Under rating threshold (hideshow)
I really hope someone can help me with the score. If I shoot an enemy the score changes from 0 to NaN (Not a Number???). I did it exactly as in the tut but it seems I did something wrong and have no clue where t look. If I change this part in the Game.as "score += points;" to "score = points;" It adds up the 50 points for killing a ship but doesn't change when killing a second. But when I leave the "+" it gives met NaN in the score... :(
Under rating threshold (hideshow)
well now i've got a null object reference at
Key(d(because i tryed changing the class name))$/initalize i even changed the class name to Keyd
Under rating threshold (hideshow)
Good it was a unreparible problem of the file i copyed the code put it into a new script deleted the old one and it worked
Under rating threshold (hideshow)
I'm still stuck on slide 3. I tried testing it exactly like the tutorials way but it didn't work. I then tried it like ThinkLikeMike said, but that didn't work either. Can someone tell me what's wrong if there is an error in the tutorial? Or if there is something I probably did wrong?
Under rating threshold (hideshow)
ye, like Orangatang, I don't understand why we have to put static var healthMeter:HealthMeter; Can someone explain it plz?
And btw, very good tutorial, thx
Under rating threshold (hideshow)
What is the difference in declaring
static var healthMeter:HealthMeter;
and
static var healthMeter:MovieClip;
What is the difference and when should they be used?
Under rating threshold (hideshow)
The AS3 versions your doing are pretty helpful! One note, I don't know if its me but I was having issues with the score formatting on page 3. Instead of the code that is suggested I went with: var scoreFormat=new TextFormat(); scoreFormat.color=0xffffff; scoreFormat.font="Helvetica"; scoreFormat.size=20;
scoreText.defaultTextFormat = scoreFormat;
Under rating threshold (hideshow)
i know it works and all but.
when u declare the healthBar variable, shoudn't it be a MovieClip type.( im used to as2)
Under rating threshold (hideshow)
i cant get the score text format to change, and the updateScore function keeps coming back saying im trying to put a number in a string. Does anyone know what im doing wrong?
Under rating threshold (hideshow)
The other tutorials were made explaining it in Actionscript 2 (the code language) and these are in Actionscript 3. Nothing was stolen, it's just updating it.
Under rating threshold (hideshow)
Great now i have it start all of shootorial again all my codes such as new game gameover takedamage(ship class) explosion(ship class) is null ive ttryed debug and its all to do with linking the functions for instance on explode you have to call gameover()