| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: Dec 2000
Location: London
Posts: 27
|
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 |
|
|
|
|
|
#2 |
|
Registered User
|
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. ![]() |
|
|
|
|
|
|
|
|
#3 |
|
Administrator
Join Date: Nov 2000
Location: Australia
Posts: 8,612
|
__________________
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. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |