All of the scripts in these videos are written in AS 2.0. That would explain why your'e having problems. I'm hoping to follow up with some new versions of these projects that explore AS 3.0 very soon.
I copied the code word for word and it didn't work. I've always been able to follow you videos fine though and I do have knowledge on how use actionscript. I'm using Adobe Flash CS4 Professional on actionscript 2.0 here's exactly what I typed in the actions window. Yes I did click on the movie clip before opening actions:
You sure can. What you need to set up, however, is something to measure a 'hit event'. This would be a script that continuously monitors what's happening in a frame and the moment the two objects bump into one another a script is triggered to move the playback head to another frame.
I can't show it here but my next video will provide an overview of a program which includes these features.
oh by the way, if i were to put in another object, such as a square, would i be able to add an actionscript to that so that when my star rolls over it it goes to a new frame?
It appears that you attached your script to an object that isn't a movieclip. Double check the object you intend to be a movieclip and make certain it was converted to a movieclip.
I would suggest reducing your monitor resolution a bit (make the picture bigger). I designed the original video to be visible and Just checked it out and I can read the script easily.
i have a question.whene i type the first line then i push check Syntax it says that "extra characters found after the end of program onClipEvent (load){
Um...it's a bit like asking 'how do I build a house?' The answer really depends on what you want the program to do (specifically) and the mechanisms you need to create to get there. Unfortunately there is no single answer. A health bar would be driven by a variable count of some kind while being able to measure whether somebody was hit by a bullet is a measure of two objects intersecting. As you can imagine, the process isn't a simple 'do this, this and this and you're all set'.
hey man thank you so mush. there should me more people like you in this world. but tell me, I have a Batmobile that moves with your actionscript hints and other cars that come and the Batmobile has to avoid them. what actionscript can i put on the other car so when it touches the batmobile, it gotoAndStop the "you lose" frame
It's an excellent question and something I'll cover in an upcoming 'episode' that will deal with sensing and reacting to objects coming into contact with one another on the stage.
im not sure, but after i type in everything it says i have no errors when i click the check but when press ctrl enter and it opens the movie, the arrow keys do nothing...it might be because im on a laptop and maby the arrow keys are like different buttons or something... i dont rly no so... o yea im using macromedia flash professional 8 if that makes a difference...
it doesn't work for me it says i have done everything correctbut....when i go to play it does not move. is it because i have macromedia flash? please help
It might depend on the version of Flash you have. This approach will work with Flash 8 and Flash CS3. For earlier versions it may not work.
Also, check for spelling errors (the most common culprit!) and that you've correctly named the object you're moving. If you don't correctly name the object the script won't work.
Flash MX 2004 can do a number of things but ActionScript, like most technologies has gone through an evolution. Every time there is an update some things change.
There are ways to move objects in Flash MX 2004 but they don't necessarily match the approach I'm showing. You might look around to see if you can find an older book that covers Flash MX 2004 scripting specifically to help you along.
it's fair question: I find that AS 2.0 is great for creating stand alone applications that don't require any data input from an external source. I also think its easier to explain to people starting to program how to attach scripts to objects instead of needing to create master scripts in the first frame of the movie.
AS 2.0 isn't going anywhere and is still very viable. AS 3.0 is perfect for creating database driven tools and websites. For many simple applications it's overkill.
Can you tell me how to make a wall so when my object hits it it stops.
GamesFame 2 months ago
All of the scripts in these videos are written in AS 2.0. That would explain why your'e having problems. I'm hoping to follow up with some new versions of these projects that explore AS 3.0 very soon.
robgraham 9 months ago
I'm doing this on 3.0. Its saying to change the "onClipEvent (load){"
TheLegend1245 9 months ago
I cant find Actions Movie Clip. 2:06
TheLegend1245 9 months ago
I cant find Actions. 2:06
TheLegend1245 9 months ago
Great help! Thanks a lot =]
90zKiida 2 years ago
Nice tutorial, it's very helpful! But, how can I jump and use grafity?
pokerockmario123 2 years ago
Thank you...the way you explain it makes it so easy to follow and understanding the script!!
utsukusih 2 years ago
That sure helps
some1elseLIKEme 2 years ago
Awesome tutorial!! ive been looking for ages for one that actually explaines the code. Thank you!!
Soadrock132 2 years ago
Comment removed
rythembansal 2 years ago
Hey Rodney:
I'd need to see the whole file to figure out what went wrong. What you are showing looks right.
robgraham 3 years ago
I copied the code word for word and it didn't work. I've always been able to follow you videos fine though and I do have knowledge on how use actionscript. I'm using Adobe Flash CS4 Professional on actionscript 2.0 here's exactly what I typed in the actions window. Yes I did click on the movie clip before opening actions:
onClipEvent (load) {
movespeed = 5;
}
onClipEvent (enterFrame) {
if (Key.isDown(Key.RIGHT)){
this._x += movespeed;
}
Can you please help me?
southrodney 3 years ago
You sure can. What you need to set up, however, is something to measure a 'hit event'. This would be a script that continuously monitors what's happening in a frame and the moment the two objects bump into one another a script is triggered to move the playback head to another frame.
I can't show it here but my next video will provide an overview of a program which includes these features.
robgraham 3 years ago
oh by the way, if i were to put in another object, such as a square, would i be able to add an actionscript to that so that when my star rolls over it it goes to a new frame?
DNAngelnut 3 years ago
thanks a bunch this helped me out a lot
been trying to figure this out for a while now hahaha
DNAngelnut 3 years ago
It appears that you attached your script to an object that isn't a movieclip. Double check the object you intend to be a movieclip and make certain it was converted to a movieclip.
robgraham 3 years ago
I did everything u say and this error come up wat i do???:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 1: Clip events are permitted only for movie clip instances onClipEvent (load){
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 5: Clip events are permitted only for movie clip instances onClipEvent (enterFrame) {
Total ActionScript Errors: 2 Reported Errors: 2
monkeyace12345 3 years ago
Do you know how to make it so when you hit the left arrow key the object will turn around. so it doesn't look like the person is doing the moon walk?
FishCrapPro 3 years ago
lol moon walk
clayerox5 3 years ago
i can't se what u are writing so cud u copy it and paste it her lika a comment i should be very happy then plz! =P
Blodigel11 3 years ago
I would suggest reducing your monitor resolution a bit (make the picture bigger). I designed the original video to be visible and Just checked it out and I can read the script easily.
robgraham 3 years ago
i have a question.whene i type the first line then i push check Syntax it says that "extra characters found after the end of program onClipEvent (load){
thegreasytoothpick 3 years ago
Sorry, hard to know what's going on without seeing the entire script...
robgraham 3 years ago
how do i make a game with a health bar and enemies attacking me and i want it to be a sniper game
srhorses1 3 years ago
Um...it's a bit like asking 'how do I build a house?' The answer really depends on what you want the program to do (specifically) and the mechanisms you need to create to get there. Unfortunately there is no single answer. A health bar would be driven by a variable count of some kind while being able to measure whether somebody was hit by a bullet is a measure of two objects intersecting. As you can imagine, the process isn't a simple 'do this, this and this and you're all set'.
robgraham 3 years ago
hey man thank you so mush. there should me more people like you in this world. but tell me, I have a Batmobile that moves with your actionscript hints and other cars that come and the Batmobile has to avoid them. what actionscript can i put on the other car so when it touches the batmobile, it gotoAndStop the "you lose" frame
thanks
zarbi10425 3 years ago
It's an excellent question and something I'll cover in an upcoming 'episode' that will deal with sensing and reacting to objects coming into contact with one another on the stage.
robgraham 3 years ago
could u reply to this with the Action script u used to do this, b/c i think mines wak
2hott2bthisbored 4 years ago
The script is designed to work with ActionScript 2.0 but not AS 3.0. Could that be the problem?
robgraham 4 years ago
im not sure, but after i type in everything it says i have no errors when i click the check but when press ctrl enter and it opens the movie, the arrow keys do nothing...it might be because im on a laptop and maby the arrow keys are like different buttons or something... i dont rly no so... o yea im using macromedia flash professional 8 if that makes a difference...
2hott2bthisbored 4 years ago
it doesn't work for me it says i have done everything correctbut....when i go to play it does not move. is it because i have macromedia flash? please help
dragonjiggy 4 years ago
It might depend on the version of Flash you have. This approach will work with Flash 8 and Flash CS3. For earlier versions it may not work.
Also, check for spelling errors (the most common culprit!) and that you've correctly named the object you're moving. If you don't correctly name the object the script won't work.
robgraham 4 years ago
Is there a way to move objects in an early version of flash?
dragonjiggy 4 years ago
It depends on how early. What version do you have?
robgraham 4 years ago
macromedia flash MX 2004
dragonjiggy 4 years ago
Flash MX 2004 doesn't use a complete build of ActionScript 2.0. Unfortunately you're going to need Flash 8 or newer to follow along
robgraham 4 years ago
aw man. What would you say is the best action script i can do on flash MX 2004?
dragonjiggy 4 years ago
Flash MX 2004 can do a number of things but ActionScript, like most technologies has gone through an evolution. Every time there is an update some things change.
There are ways to move objects in Flash MX 2004 but they don't necessarily match the approach I'm showing. You might look around to see if you can find an older book that covers Flash MX 2004 scripting specifically to help you along.
robgraham 4 years ago
it's fair question: I find that AS 2.0 is great for creating stand alone applications that don't require any data input from an external source. I also think its easier to explain to people starting to program how to attach scripts to objects instead of needing to create master scripts in the first frame of the movie.
AS 2.0 isn't going anywhere and is still very viable. AS 3.0 is perfect for creating database driven tools and websites. For many simple applications it's overkill.
robgraham 4 years ago
why are you using actionscript 2?
mykatanaiskool 4 years ago
lol! ActionScript 3 is so *piep*ing harder!
But I understand why you asked.
Kirvak 4 years ago