Jump to content
Search Community

Need help on three image animation

SarasotaSam test
Moderator Tag

Recommended Posts

After some time away from tweening, I am back working on a project. I remember how helpful you were on the last project I was working on and need some help on this one.

This is a three image animation with each image on it's own layer (all on frame 1). The animation goes back and forth between the images (fading and scaling each). The project is a smile simulation with before cosmetic digital enhancement and after enhancement.

I am trying to use the TimelineMax method and and having limited success. I have commented the code where I am having difficulties.

import com.greensock.*;
import com.greensock.easing.*;

var myTimeline:TimelineMax = new TimelineMax();
//First image loads and than fades. There is a image below in the timeline that is revealed.
myTimeline.append( new TweenMax(back_mc, 4, {autoAlpha:0, delay:5}) );
myTimeline.append( new TweenMax(back_mc, 1, {autoAlpha:1, delay:5}) );
//Hides the images in the timeline.
myTimeline.append( new TweenMax(before_mc, 1, {visible:0}) );
myTimeline.append( new TweenMax(after_mc, 1, {visible:0}) );
//Scales both images. Just the before_mc is visiable.
myTimeline.append( new TweenMax(before_mc, .01, {scaleX:0.2, scaleY:0.2, x:300, y:200}) );
myTimeline.append( new TweenMax(after_mc, .01, {scaleX:0.2, scaleY:0.2, x:300, y:200}) );

myTimeline.append( new TweenMax(back_mc, 2, {scaleX:0.2, scaleY:0.2, x:300, y:200}) );
myTimeline.append( new TweenMax(back_mc, 1, {autoAlpha:0, delay:3}) );
//There is an issue here where there is a delay of about 2 seconds where the stage is blank and
than the before_mc loads.
myTimeline.append( new TweenMax(before_mc, 3, {autoAlpha:1, visible:1}) );
myTimeline.append( new TweenMax(before_mc, 1, {autoAlpha:0, delay:3}) );
//Same issue as the precvious where the stage is blank for about two seconds.
myTimeline.append( new TweenMax(after_mc, 5, {autoAlpha:1, visible:1}) );
myTimeline.append( new TweenMax(after_mc, 3, {scaleX:1, scaleY:1, x:350, y:-100, delay:3}) );
//The animations is not done yet. Want to get the above issues taken care of before proceeding.

Thank you in advance for your help on this - Sam

P.S. - Once I get this right. I would like to be able to load the images dynamically using PHP. Would this be possible?

Link to comment
Share on other sites

it will be much easier to troubleshoot if you upload a cs4 fla with only this code and the necessary assets. thanks.

 

as a general tip, there is no need to combine autoAlpha with visible... although i doubt that is causing any trouble.

Link to comment
Share on other sites

it seems your file wasn't attached.

 

please save as CS4 as requested

zip the fla before posting

 

if you find your can not include the images for some reason, please have simple movie clips on the stage with the proper instance names so that I don't have to rebuild assets to get it to work.

 

thanks

 

Carl

Link to comment
Share on other sites

Hi Carl - for some reason I am not able to upload he ziped file. It is 11mb, so maybe it is too large.

 

Anyway you mentioned that "there is no need to combine autoAlpha with visible". I did not know of another way to make an image on the stage not visible durning the animation. As I said I have three layers on frame one. If I animate two layers without hiding the third layer, it shows during the animation before I want it. Is there another way to hide and make visible a layer?

 

Thanks again - Sam

Link to comment
Share on other sites

in the future, use smaller images or replace your images with simple vector art to make the fla as small as possible. even if you could upload the fla, people don't want to have to download such large files.

 

 

i did a test with my own movieclips.

 

where you do

 

 

myTimeline.append( new TweenMax(before_mc, 3, {autoAlpha:1, visible:1}) );

myTimeline.append( new TweenMax(before_mc, 1, {autoAlpha:0, delay:3}) );

//Same issue as the precvious where the stage is blank for about two seconds.

myTimeline.append( new TweenMax(after_mc, 5, {autoAlpha:1, visible:1}) );

 

remove visible:1

 

autoAlpha automatically sets the visible property to 1 so there must have been a conflict

 

 

after making this change there was no time that the stage was blank

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...