Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Actionscript 3.0 timline control

Community Beginner ,
Jun 26, 2025 Jun 26, 2025

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

 

animation.jpg

284
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2025 Jun 26, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 26, 2025 Jun 26, 2025

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2025 Jun 26, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2025 Jun 26, 2025

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 26, 2025 Jun 26, 2025

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 😞mainscene.jpg1anim.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 26, 2025 Jun 26, 2025

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2025 Jun 26, 2025

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 26, 2025 Jun 26, 2025

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!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2025 Jun 26, 2025
LATEST

the simplest would be to use buttons to control the characters movements.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2025 Jun 26, 2025

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 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines