PDA

View Full Version : Please Help - Simple Game action script



Madras
August 13th, 2003, 05:58 PM
Can anyone help me in this game file.

I need to create a scene or a frame with a button.
When I click on the button the Game should start to play.

Since I am not able to upload the file please use this below link to access the FLA file


This is What I did:
I tried 1 space on the 1st key frame It didn’t work.
I also made a new scene created a button gave a action-script (go to) It didn’t work.

When I created the button (action-script go to next frame or next scene) and modifying the frame number in the action-script on the actual game key frames.

This is the Problem I am facing:
It doesn’t go to the last frame of the game (Last Frame - Click to play again)

My level in action-Script (Beginner- intermediate)


Thanks for the great help


http://www.flashkit.com/movies/Games/pingbric-pinkel_l-7765/index.php


Thanks once again

Madras
August 14th, 2003, 10:18 AM
urgent request

I tried Many times with the scene & Keyframe . But it It didn’t work.


Can anyone help me please. This is a urgent request, So Please HELP.


THANKS


__________________
Your Pal

blah-de-blah
August 14th, 2003, 10:22 AM
I need to create a scene or a frame with a button.


I'm not really sure what you want to do, but this is not possible :-\
Can you be more specific in what you want to do?

Madras
August 14th, 2003, 12:16 PM
Hi blah-de-blah,

Thanks for the reply & thank you very much for helping me.

Step 1
Basically I want to create a button. The Button should say Click to Play the GAME

So when Click on the Button --- Step 2

Step 2
The Game should start playing.


I did the step one
But the game does not play good.
That is if you miss the ball in the game it does not go the last frame (play again)


In the original game(before making the button):
When you miss the ball it goes to last fame (play again).


I am sorry for some reason I am not able to the load the working file (FLA).

Can you Please download the file from the below site link.
and test on the file.

http://www.flashkit.com/movies/Games/pingbric-pinkel_l-7765/index.php

Thanks Again for helping me.

blah-de-blah
August 15th, 2003, 02:05 AM
So you jsut want a button to make the game go to the last scene?? I tried downloading your thing, but i can't access the site :-\

Does this code work?


on (release) {
_root.gotoAndPlay (123)
}


Doesn't that work? where 123 is the frame number

Madras
August 18th, 2003, 09:55 AM
Hi blah-de-blah,

Thanks for the reply & thank you very much for helping me. I am sorry for late response we lost the power supply I am sure you would have heard about Major Blackout.

please don't KILL ME. I am sorry to mention I think my explanation was not correct. I really like to apologize.

What I really wanted to do is create a CLICK HERE START TO PLAY BUTTON before the game.

I know the there is "click here to play again” frame,


Can you please try again the link. I think now the link works.

http://www.flashkit.com/movies/Games/pingbric-pinkel_l-7765/index.php


Here is the Explanations with the problem.

Step 1
Basically I want to create a button. The Button should say Click to Play the GAME (before the game)

So when Click on the Button --- Step 2

Step 2
The Game should start playing.


I have done the step one But the game does not play good.
That is if you miss the ball in the game it does not go the last frame (play again)


In The original game(before making the button):
When you miss the ball it goes to last fame (play again).

This Is What I tried:
I tried 1 space on the 1st key frame created a button gave a action-script go to next frame -- It didn’t work.
I also made a new scene created a button gave a action-script go to next scene -- It didn’t work.

I am sorry for some reason I am not able to the load the working file (FLA).


I know you spent lot of time on this, once again i apologize. please try to help me if you can.

Thanks

Voetsjoeba
August 18th, 2003, 10:40 AM
Is the game supposed to continue after the score of 20 or to stop ?

Madras
August 18th, 2003, 10:57 AM
it supposed to continue after the score of 20.

Voetsjoeba
August 18th, 2003, 11:02 AM
Almost there ... need to eliminate a bug. By the way ... do you use Flash MX or Flash 5 ?

Madras
August 18th, 2003, 11:13 AM
Fantastic, Great - I use FLASH MX.

Thank You

Voetsjoeba
August 18th, 2003, 11:25 AM
Oh man, I'm starting to get a headache :( This bug is a tough one. I'm sorry.

Madras
August 18th, 2003, 11:31 AM
I am sorry about that

Voetsjoeba
August 18th, 2003, 11:39 AM
Mmm ... this is interesting: I put this on the bottom part (which if it hits, it's supposed to go to Frame 5 and stops):


onClipEvent (enterFrame) {
if (this.hitTest(_root.bal)) {
removeMovieClip(_root.bal);
_parent.gotoAndStop(5);
trace("Hit bottom: _parent("+_parent+").gotoAndStop(5) ||| removeMovieClip(_root.bal)");
}
}


and when I test the movie and let the ball hit the bottom, nothing is traced. Which means that it doesn't gotoAndStop(5). Which is probably the bug. But why !?

Madras
August 18th, 2003, 11:41 AM
if you need to see my FLA file, here it is please have look.

http://www.artisticguru.com/flash/flash.htm

Thanks

Voetsjoeba
August 18th, 2003, 11:43 AM
Aaah, a fresh file. Just what I needed. Thanks :) Now I can clear my mind about the previous bug.

Madras
August 18th, 2003, 11:48 AM
WOW Thanks for trying so hard, I really appreciate it.

Voetsjoeba
August 18th, 2003, 11:51 AM
I have to stop working on this computer, but I'll continue upstairs.

Madras
August 18th, 2003, 11:54 AM
Great!

Voetsjoeba
August 18th, 2003, 12:32 PM
I fixed it ! Finally I got that little bug to die. I'll explain what the problem was later cuz I ain't got much time now. I'm uploading the fla as we speak. I'll edit this post as soon as it's done.

*Just popped into my mind: the original code isn't perfect, causing the ball to fly through the walls sometimes. I got a fix for that too, I'll attach the same Fla but with the walls fixed later.

Here it is: FLA (http://voetsjoeba.asianillusion.com/brick.fla)

Madras
August 18th, 2003, 01:05 PM
Hi Voetsjoeba,

Thank You, you are too good, Incredible. That was a Fantastic hard work, You must be a GURU in FLASH. Thanks again it works great.

GURU THANKS AGAIN

Voetsjoeba
August 18th, 2003, 01:54 PM
You're welcome :)

I fixed the FLA for the ball that flies through the walls sometimes. Plus, I forgot to change the button at the last frame ("Play Again"). Changed that too.

I replaced the file on the server. So just click the same link I gave you in my previous reply.

Madras
August 18th, 2003, 02:40 PM
Thanks Guru’s,

It works great. Thank You So Much.

Tips or Advice, Can you suggest me a site or recommend me a book for action-script, there lot of sites and books but I am not sure which one to pick for a starter.

FYI I i am just a beginner in scripting language
(action-script or javascript).

Question: Do i have to know javascript to understand Action-Script.

Voetsjoeba
August 18th, 2003, 02:45 PM
You're on one. www.kirupa.com. And this forums contains a treasure of code, sample fla's, solve methods and so much more ... I don't know about books, I'm not into ActionScript books. Although I should.


Question: Do i have to know javascript to understand Action-Script ?
No, you don't. Although a little Javascript skills come in handy for splash pages and/or pop-ups and closing them. JavaScript is actually very similar to ActionScript, which makes JavaScript easier to learn :)

Madras
August 18th, 2003, 03:08 PM
Great,

Thanks for the advice, I will start using this site for learning.
Just a note once I master the scripting I promise that I will definitely try to help some one like me in the future.

Thanks GURU