Share Posted February 15, 2013 (Newbie) how to create slide up or down animation, from first frame to second frame.. Thanks... Link to comment Share on other sites More sharing options...
Share Posted February 15, 2013 Hi and welcome to the GreenSock forums. To make an object move vertically you would tween its y property: ActionScript 3 import com.greensock.*; import com.greensock.easing.*; TweenLite.to(mc, 1, {y:100}); That code will move an object with the instance name mc to a y position of 100 over the course of 1 second. I'm not so sure what you mean by from "first frame to second frame". Are you referring to frames in a timeline or something else? I would strongly suggest that you read this page http://www.greensock.com/tweenlite/, examine the code and experiment with the Interactive Demo a bit. Link to comment Share on other sites More sharing options...
Author Share Posted February 15, 2013 Hi and welcome to the GreenSock forums. To make an object move vertically you would tween its y property: ActionScript 3 import com.greensock.*; import com.greensock.easing.*; TweenLite.to(mc, 1, {y:100}); That code will move an object with the instance name mc to a y position of 100 over the course of 1 second. I'm not so sure what you mean by from "first frame to second frame". Are you referring to frames in a timeline or something else? I would strongly suggest that you read this page http://www.greensock.com/tweenlite/, examine the code and experiment with the Interactive Demo a bit. Yes, I mean "Timeline"... (sorry my bad english) Link to comment Share on other sites More sharing options...
Author Share Posted February 15, 2013 I tried this TweenLite.to(mc, 1, {frame:2, ease:Sine.easeInOut}); that code is successfully move from frame 1 to frame 2, but there is no animation like slide up or down... help me please Link to comment Share on other sites More sharing options...
Share Posted February 15, 2013 Yeah, I think there is a little misunderstanding here. You can't slide content on frame 1 into frame 2. The content you are trying to animate must all be on the same frame. When using scripted animation, for the most part, you won't use the Flash timeline at all or multiple frames. You can either place the contents of frame 1 and frame 2 into a parent movieclip and then move the parent movie clip OR keep all your "frame assets" as separate clips and individually move them around. I've attached an example of nesting 3 moviclips into a frames_mc that has its y value tweened so that each "frame" is revealed with a vertical sliding motion. The code is very basic and looks like this: import com.greensock.*; TweenLite.to(frames_mc, 1, {y:-200, delay:1}); TweenLite.to(frames_mc, 1, {y:-400, delay:4}); This is what it looks like: http://www.snorkl.tv/dev/panelslide/ is that the effect you are trying to achieve? panelSlide_cs5.zip Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now