Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > General Chat

Reply
 
Thread Tools Rate Thread Display Modes
Old 01-03-2001, 01:50 AM   #1
case
Registered User
 
Join Date: Dec 2000
Location: London
Posts: 27
Question

Can anyone please tell me how to tween/animate a graphic(or movie clip)from one point to another purely using actionscript.(frame based,although mouse events are welcome)I have a limited knowledge of actionscipt and hav been trying for ages, but i cannot seem to get the coding right.

I will also be greatful for any variations on the theme e.g:controlling the speed,setting start and end points e.t.c.

Thanks for listerning

case

case is offline   Reply With Quote
Old 01-06-2001, 05:06 AM   #2
seventhmonkey
Registered User
 
Join Date: Dec 2000
Location: Down Under
Posts: 48
Send a message via ICQ to seventhmonkey
Default

This probably should have been asked in the actionscripting forum, and perhaps a nice mod will move it there for you, but anyway...

Say you have a mc to move with an instance name of "bob".

In the parent mc or main timeline do:

First Frame:
startypos = 25.4; //these are the start positions of the mc
startxpos = 34.1;
finishypos = 354.9; //these are the finish positions of the mc
finishxpos = 482.4;
ydist = finishypos - startypos; //this is the distance to be travelled
xdist = finishxpos - startxpos;
ymove = ydist/100; //this is the distance to be travelled each incrementation.
xmove = xdist/100;

Second Frame:
if (_root.bob._y<finishypos){
_root.bob._y = _root.bob._y + ymove;
}
if (_root.bob._x<finishxpos){
_root.bob._x = _root.bob._x + xmove;
}

Third Frame:
gotoAndPlay (2);


The bigger the number on the denominator of the fraction in the ymove/xmove variables, the slower the mc will move. This allows you to control the speed.

Hope taht taht helps you out/is what you were after.
seventhmonkey is offline   Reply With Quote
Old 01-06-2001, 07:09 AM   #3
Jesse
Administrator
 
Jesse's Avatar
 
Join Date: Nov 2000
Location: Australia
Posts: 8,612
Default

Also see our new tutorial:
http://www.actionscripts.org/tutoria...se/index.shtml

Cheers

Jesse
__________________
Cheers

Jesse Stratford
ActionScript.org Cofounder
Email: presented in this way to stop spam-bots: My email is composed of my first name (jesse) followed by my last name (stratford) followed by @ followed by actionscript.org

Please don't email or PM me Flash questions, that's what the Forums are for!

Please don't rely on me reading my PMs either. Email me about important stuff.
Jesse is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
animation via actionscript yusuf-abdalla ActionScript 2.0 1 08-15-2006 12:22 AM
animation via actionscript yusuf-abdalla ActionScript 2.0 1 08-14-2006 10:46 PM
Why is my very simple ActionScript animation extremely choppy? sofakng ActionScript 2.0 6 02-04-2006 09:38 PM
Controlling a Collapsing Menu Animation with Actionscript apprentice Simple Stuff (Newbies) 2 02-19-2002 05:53 AM


All times are GMT. The time now is 05:22 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.