Copy link to clipboard
Copied
Hi, I'm learning character animation. I'm going to try coding for the first time. I looked at many tutorials but they were all interactive and with buttons. I collected all the movements of a character in a single movie clip. My aim is to call some of these movements to the main scene with code. However, when I opened a new scene, I could not call the movement I wanted in the same movie clip. Am I on the right track? For example, how can I call only the running and stopping movement from the movements in the image to the main scene with code? Thank you very much in advance
Copy link to clipboard
Copied
don't use scenes. they add little and cause extra complications with code.
use gotoAndPlay() etc to do what you want, at least, while starting.
Copy link to clipboard
Copied
Thanks. but it still feels too complicated. my goal was to be faster because I saved each movement in different .fla files (as a graphic symbol), but in a scene with many characters, using such a code for each character's movement is not very effective, do I think I'm right? should I continue to do it the same way?
Copy link to clipboard
Copied
and you need to add stop() on the at the end each action (eg, "jump"). and it's easiest to disable character changes until the current change is completed. otherwise, you have a character in the middle of a jump animation immediately changing to a "crouch" animation with no transition.
Copy link to clipboard
Copied
Hi.
In the main timeline, select this Movie Clip instance containing your animations, open up the Properties panel (Ctrl + F3) and give it an instance name. Then you can call methods on it to play an animation/label. For example: character.gotoAndPlay("jump").
As for the animations/labels inside of the Movie Clip, you can add a stop call or a gotoAndPlay("someIdleAnimation") to the end of each animation/label spam if you want that to play only once (a punch, for example). Or you can add a gotoAndPlay(currentLabel) call to the end of a label/animation spam that you want to be played in a loop.
Please let us know if you need an example.
Regards,
JC
Copy link to clipboard
Copied
hello, as you mentioned, I added gotoAndPlay() to the first frame in all movie clips, and stop(); to the last frame of each one.
I went back. I opened a new layer in the scene, right clicked and selected actions. then I typed the scene I wanted to bring, but there was no change in the layer. how and where should I do the order of these scenes? my question is very novice, but I couldn't find it in any tutorial, so sorry 😞
Copy link to clipboard
Copied
I mean, I understood the logic of this as follows: let's collect all the movements of the character in one place in a movie clip. and call the necessary ones in the scene according to their place. for continuity. I thought I could call similar movements of the same character from this movie clip in different animations. so I thought this movie clip was actually a library. for example, I want to use only two of these movements in the scene consecutively. is it possible to organize this? or is my logic wrong from the beginning?
Copy link to clipboard
Copied
yes, that can be done. and yes, you can use one movieclip as a library of the character's behaviors.
but that's going to be a little more complicated. we can show you how to do that, but (as an analogy) you're trying to walk before you've learned to crawl.
Copy link to clipboard
Copied
I would be grateful if you could explain it by analogy and let me know where to start. When I save each character's movement as a graphic symbol in separate .fla files and use them in main scene, it's like I'm using an editing program and they get mixed up. So I wanted to try this way 😄 Thank you in advance!
Copy link to clipboard
Copied
the simplest would be to use buttons to control the characters movements.
Copy link to clipboard
Copied
gotoAndPlay shouldn't be on that character timeline. the stop()'s should be.
the gotoAndPlay() 's should be on the character parent timeline using code suggested by @JoãoCésar
Find more inspiration, events, and resources on the new Adobe Community
Explore Now