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

Motion tween and actionscript color change

Community Beginner ,
Nov 11, 2008 Nov 11, 2008
Hello, I'm rather new to flash and actionscript, having been introduced to Flash MX recently. Everything was flowing smoothly until now. Here's the scenario:

I create a new document and create a Movie Clip symbol, then add a motion tween to it. So far, so good. Then I edit the symbol and on the first frame of the movie clip add the action "_alpha = 50;". Suddenly the motion tween ceases to function.

You can find a minimal fla file that exhibits the issue here: tweenproblem.fla

This problem has me totally stumped, as actions such as stop() and gotoAndPlay() in the same place don't affect the tween, while other color actions (such as Color.setTransform) display the same behavior. Any advice is much appreciated!
TOPICS
ActionScript
797
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

correct answers 1 Correct answer

Community Beginner , Nov 11, 2008 Nov 11, 2008
Thank you very much for your time kglad, however I managed to find a workaround for the problem by simply converting the symbol into a symbol again. It seems that only tweens in the immediate parent are affected, so the new symbol can be tweened normally while the original symbol is still affected by the actionscript.
Translate
Community Expert ,
Nov 11, 2008 Nov 11, 2008
you can't combine timeline tweening and actionscript tweening. use all one or all of the other.
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 ,
Nov 11, 2008 Nov 11, 2008
Hm, I see.. That's a rather strange limitation in Flash, considering I'm not actually trying to change the color over time, but only set it once based on a variable. Correct me if I'm wrong, but I don't believe the flash interface allows you to set components (such as alpha) based on a variable, so that's not an option. My last question then is this: Is actionscript tweening even possible in Flash MX? A google search brings up lots of information about the Tween object, yet the actionscript reference doesn't list it.
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 ,
Nov 11, 2008 Nov 11, 2008
assigning a color will stop the tween.

alpha is a property, not a component. properties can be assigned using variables.

actionscript tweening is routine. you can code tweens yourself using setInterval() or onEnterFrame loops, you can use the flash Tween class (see the components section in the help files) or you can use one of several tween classes made by others that are superior to flash'es Tween class. tweenlite is my favorite.
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 ,
Nov 11, 2008 Nov 11, 2008
Thank you very much for your time kglad, however I managed to find a workaround for the problem by simply converting the symbol into a symbol again. It seems that only tweens in the immediate parent are affected, so the new symbol can be tweened normally while the original symbol is still affected by the actionscript.
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 ,
Nov 11, 2008 Nov 11, 2008
LATEST
you're welcome.
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