[RESOLVED] CS5 AS2 Flash Game Help!
A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: [RESOLVED] CS5 AS2 Flash Game Help!

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    9

    resolved [RESOLVED] CS5 AS2 Flash Game Help!

    Hi, i'm making a flash game for school and I am almost done, however I have two problems with it. The first is that I have trouble adding score. I used the dynamic text box with var name counter and put counter++; where the enemy dies, and put counter=0 but it doesnt work. The second problem is that after I the player dies and it goes to the game over frame, the enemies still remain on the screen until the leave it. Can anybody help, I would most appreciate it. If you would want me to upload the fla. then I will.

  2. #2
    Senior Member
    Join Date
    Nov 2012
    Posts
    106
    Without looking at the file, I am guessing that your variable is being updated, but your textbox is not. Everytime the counter variable is updated, you will also need to update the dynamic text box. You could do this with an Enter_Frame function or inside of the function where you are updating your counter variable.

    As far as the enemies, I need to know how they are being added, and if you are assigning them consistant names. When the the "game over" happens you will just need to tell each enemy to turn their ._visibile = false or ._alpha = 0.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    I have one enemy a symbol, than I have a spawner to duplicate the enemies.

  4. #4
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    I could upload the file and show you if you would like to.

  5. #5
    Senior Member
    Join Date
    Nov 2012
    Posts
    106
    Sure, upload your file, and I will take a look at it.

  6. #6
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    sorry I couldn't upload it to the forum. the file size was too big. But here is a link to download it.

    http://www.2shared.com/file/m0cQtpF0/try3.html

  7. #7
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    Okay, so I solved the aliens not disappearing after game over by restarting or loading back to the same swf. I still can't figure out score.

  8. #8
    Senior Member
    Join Date
    Nov 2012
    Posts
    106
    I looked at your file:
    1) you must give your dynamic textbox an instance name "theScore".
    2) Then delete _root.counter from the variable box in the options
    3) create a var counter=0; in the actions layer of your main timeline on frame1
    4) On the spaceship MC<player>, in the onClipEvent (enterFrame) you will need to put this code:

    _root.theScore.text=_root.counter;

    this will make your score box work correctly.

  9. #9
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    For some reason, the text box isn't even appearing. When I opened the program on a different computer with CS4, the text box appeared. Could it be CS5? Or should I just try that on another computer.

    Also, when I run the swf. in the output tab it says "Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts." does that have anything to do with it?
    Last edited by khard; 01-10-2013 at 08:31 PM.

  10. #10
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    Quote Originally Posted by jkell View Post
    I looked at your file:

    4) On the spaceship MC<player>, in the onClipEvent (enterFrame) you will need to put this code:

    _root.theScore.text=_root.counter;
    is there any specific place that i put this?

  11. #11
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    Quote Originally Posted by khard View Post
    For some reason, the text box isn't even appearing. When I opened the program on a different computer with CS4, the text box appeared. Could it be CS5? Or should I just try that on another computer.

    Also, when I run the swf. in the output tab it says "Fonts should be embedded for any text that may be edited at runtime, other than text with the "Use Device Fonts" setting. Use the Text > Font Embedding command to embed fonts." does that have anything to do with it?
    Some fonts appear and some fonts don't. And the solution you sent me still isn't working Do you think you could send me the file with the fixes. I can PM you my email.

  12. #12
    Senior Member
    Join Date
    Nov 2012
    Posts
    106
    Sure, PM me your email... You may just need to Embed the font for your dynamic text box. I believe you are using impact, so you will need to embed the font in the properties window.

  13. #13
    Junior Member
    Join Date
    Jan 2013
    Posts
    9
    okay i pmed you my email

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width


HTML5 Development Center

Poll by Flashkit.com