Added: 4 years ago
From: robgraham
Views: 5,699
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (29)

Sign In or Sign Up now to post a comment!
  • Can you tell me how to make a wall so when my object hits it it stops.

  • 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'm doing this on 3.0. Its saying to change the "onClipEvent (load){"

  • I cant find Actions Movie Clip. 2:06

  • I cant find Actions. 2:06

  • Great help! Thanks a lot =]

  • Nice tutorial, it's very helpful! But, how can I jump and use grafity?

  • Thank you...the way you explain it makes it so easy to follow and understanding the script!!

  • That sure helps

  • Awesome tutorial!! ive been looking for ages for one that actually explaines the code. Thank you!!

  • Comment removed

  • Hey Rodney:

    I'd need to see the whole file to figure out what went wrong. What you are showing looks right.

  • 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?

  • 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?

  • thanks a bunch this helped me out a lot

    been trying to figure this out for a while now hahaha

  • 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 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

  • 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?

  • lol moon walk

  • 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

  • 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){

  • Sorry, hard to know what's going on without seeing the entire script...

  • how do i make a game with a health bar and enemies attacking me and i want it to be a sniper game

  • 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

    thanks

  • 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.

  • could u reply to this with the Action script u used to do this, b/c i think mines wak

  • The script is designed to work with ActionScript 2.0 but not AS 3.0. Could that be the problem?

  • 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.

  • Is there a way to move objects in an early version of flash?

  • It depends on how early. What version do you have?

  • macromedia flash MX 2004

  • 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

  • aw man. What would you say is the best action script i can do on flash MX 2004?

  • 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.

  • why are you using actionscript 2?

  • lol! ActionScript 3 is so *piep*ing harder!

    But I understand why you asked.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more