At 10/2/05 09:09 AM, Ninja-Chicken wrote:
At 10/2/05 04:23 AM, -Toast- wrote:
AS: Combo:
Okay here is the things that are wrong with this thread
75% of them aren't wrong at all.
AS: Main – Teh one to rule 'em all?
Knowledge needed:
Basic actionscript knowledge: gotoAndPlays,
there is only 1 gotoAndPlay function
No, there are 4. Even if there was one, it is still needed.
if statements, onClipEvents,
You only need to know onEnterFrame
Nope.. if statements are also required...
and preferably _currentframe function (Which will be explained anyways).
Its a property
Introduction:
The "_currentframe" funtion:
Again its a property
It doesn't matter that much. property or function, it's good for AS.
What is it?
This function basically allows you to detect on what frame an object is(Teh object's timeline).
No obviously it can only detect MovieClip objects currentFrame (or anything which extends the class) and so isnt just for any old object
What about the _root.? A _root. timeline isn't a movie clip, right?
It is extremely easy to use yet a very useful function that can save you quite a lot of time.
It is mainly used for attacks in games, for example:
WTF?
if(_currentframe == 1 && Key.isDown(Key.SPACE)){// && Means "and".
If I were you I would do
if ((condition1) && (condition2))
It doesn't change anything.
this.gotoAndPlay("Attack frame");/*"Attack frame" is a frame labled "Attack frame" with an animation of some guy attacking.*/
}
What is it used for?
Simple: to find out what frame an object is currently playing.
Example:
if(_currentframe == x){
//action
}
Maybe use this._currentframe to avoid confusion
Dude, it isn't confusing...
Frame instances
To add an instance (name) to a frame, simply click the frame once and go to the propeties window. Then, type whatever you want in the textbox that should appear.
Then you can freely use gotoAndPlays or gotoAndStops using the name of the frame.
Frames dont have instance names they have labels
I didn't say instance names, I either said "names" or "instances".
The combo engine. (Finally).
The code may depend on your animations, it can totally contain 4 como animations, but you can modify it to your likes. If you have any questions about how to modify it, feel free to ask.
So basically your spoon feeding n00bs code
What the heck is wrong with you? Criticizing it means you'd like to delete teh code part, wtf? This is the essential part of a AS:
1. You need to have four animations in four different movie clips, all set in different frames.
2. When you've put all the 4 animations into the MovieClip, make sure every animation has the amount of frames that it actually contains. (See picture below).
3. Name the first frame of every animation "combo1","combo2", etc...
4. Finally add this code:
onClipEvent(mouseDown){
if(this._currentframe == 1){ // if the frame number is "one".
this.gotoAndPlay("combo1");//Plays animation number 1.
}
if(this._currentframe > 20 && this._currentframe < 29){/* change those numbers to the frames from where the player can begin the 2nd animation to the last frame of it.*/
this.gotoAndPlay("combo2");// Plays animation number 2.
}
if(this._currentframe > 33 && this._currentframe < 43){/* change those numbers to the frames from where the player can begin the 3rd animation to the last frame of it.*/
this.gotoAndPlay("combo3");// Plays animation number 3.
}
if(this._currentframe > 45 && this._currentframe < 54){/* change those numbers to the frames from where the player can begin the 4th animation to the last frame of it.*/
this.gotoAndPlay("combo4");// Plays animation number 4.
}
}
I hopr I have been clear enough, don't hesitate to e-mail me if you're having any problems.
Good luck :)
Anyways this is why toast you shouldnt be making AS:Threads because you only just figured out how to do this yourslef and you dont offer a deep enough explanation or other techniques
Yeah, right, the explanation was good, so shut up.