View Full Version : AS for moving movie clips
Amiridon
October 3rd, 2002, 12:38 PM
I just recently visited the site for j records @ jrecords.com
If you noticed everytime you click a button two of the MC's go to designated points from where everthey where previous
Would anyone be able to figure this code out????
lostinbeta
October 3rd, 2002, 12:41 PM
Read my tutorial on easing on mouse click. This will give you the basic idea. Just change it to only work on the _x axis and instead of clicking on the root, apply the actions to a button :)
http://www.kirupa.com/developer/mx/easing_mouseclick.asp
Amiridon
October 3rd, 2002, 12:57 PM
Oh I'm sorry I didn't explain myself fully. Within the movie there are two MC's
1 that show video's with a scroll bar to view different artists videos
and
2. an email submit input field with a submit button.
Whenever you click a button these two movie clips first clear the present contents, and you're see the boxes move to different locations, depending on whichever button you press.
the middle box is always and simple tween.
lostinbeta
October 3rd, 2002, 01:02 PM
Oh yes, I did not notice that...
Hmmm how to explain. There are a couple ways this could be done.....
What do you know thus far about AS motion?
cybergold
October 3rd, 2002, 01:10 PM
nice tutorial, how would you get a mouse move easing?
lostinbeta
October 3rd, 2002, 01:11 PM
I actually wrote a tutorial on that too....
http://www.kirupa.com/developer/mx/followease.asp
cybergold
October 3rd, 2002, 01:23 PM
great!
lostinbeta
October 3rd, 2002, 01:31 PM
Thanks :)
Amiridon
October 3rd, 2002, 01:44 PM
Most of the AS I do I'm most likely cut and pasting from a tutorial and adjusting it a little to go with my movie.
I know the easing tutorial would probably work for this but how would you go about make the MC ease to a location instead of the mouse location.
lostinbeta
October 3rd, 2002, 01:48 PM
Hmm, I can't think of how to explain it........
I am going to be leaving soon, and I won't be back until later tonight so hopefully someone else here can answer. If not I will see what I can do when I get back.
Amiridon
October 3rd, 2002, 02:25 PM
LOL dayum, feels like Im in line at the motor vehicle.
cybergold
October 3rd, 2002, 09:55 PM
Would you be able to replace the mouse click line(AS line which tells the MC to react to a mouse click) with an x/y coordinate instead. Would that work?
Scootman
October 3rd, 2002, 10:04 PM
heh those are great tutorials... i always thought that easing motion like that would be so much more complicated... thats great... i think im going to use that all the time now since i know how easy it is
lostinbeta
October 3rd, 2002, 11:20 PM
Hey Amiridon, probably about 1000 ways of optimizing this, but here is an example .fla file that you may be able to put to use.
I hope it helps:)
Oh yeah, and thanks for liking my tutorials:) Easing is Easy....haha.
pom
October 4th, 2002, 12:38 PM
Hey guys. The thing you have to understand is that you ease to a point. Whether it is the mouse, a movie clip location or I don't know what else, IT IS THE SAME FORMULA!!
pom :asian:
lostinbeta
October 4th, 2002, 12:48 PM
Yes, it is the same formula. And despite how difficult easing seems, the forumla is a simple...
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
comicGeek
October 7th, 2002, 08:20 PM
Originally posted by lostinbeta
Hey Amiridon, probably about 1000 ways of optimizing this, but here is an example .fla file that you may be able to put to use.
Hello lostinbeta! Can you please give me an example of your tut in flash 5? I am currently using Flash MX but for backward compatibility I have to export my SWFs in FLash 5 format!
Thanks
lostinbeta
October 7th, 2002, 09:59 PM
:-\ I have no way to convert them to Flash 5. You can use the same code in Flash 5 so all you would really have to do is rebuild in Flash 5 and you are set.
Just for quick reference... you can find the tutes here...
http://www.kirupa.com/developer/mx/followease.asp
http://www.kirupa.com/developer/mx/easing_mouseclick.asp
comicGeek
October 8th, 2002, 05:04 AM
Thanks!
I have done some changes to the script and came up with a version for flash 5. The problem now is that when I clicked the button the clip follows until its _x and _y are the same as that of the button clicked but not exactly! the movie clip doesn't really coincide with the _x and _y of the bottun being clicked. Here is the FLA.
Please help thanks.
comicGeek
lostinbeta
October 8th, 2002, 12:24 PM
?? I don't see anything wrong with it
comicGeek
October 9th, 2002, 07:24 PM
Thanks alot lostinbeta.
I don't know what's wrong with this but the movie clip really doesn't coincide with the clicked button's _x and _y. Sure it moves to a new location but it does not appear to flush. Like if the buttons _x and _y are 10 and 10 respectively the movie clip moves and stops at an _x and _y of 9.5 and 9.5. That is the problem I am trying very hard to solve!
:(
comicGeek
Scootman
October 9th, 2002, 08:03 PM
well if you want the movie clip to move to the buttons x and y... just have the end points be buttonInstance._x and buttonInstance._y...
lostinbeta
October 9th, 2002, 09:39 PM
For some odd reason, it doesn't work like that. If you assign it to go to buttonInstance._x and stuff it goes to (0,0). I have no clue why though.
I am not sure quite yet how to fix the problem you are having. But as of now I don't think the problem is that major. I didn't even notice a problem when I first tested it.
comicGeek
October 10th, 2002, 06:54 PM
Thanks all!
If you check out www.theory7.com's new site, I'm sure you'll understand what I'm trying to accomplish. I want to follow their menu system where you see a glass like movie clip follow the mouse when it hovers over a button. The thing is their glass movie clip coincides exactly to the position of the buttons.
comicGeek
:(
lostinbeta
October 10th, 2002, 07:36 PM
If you notice on their site, the white block moved behind the buttons.
Perhaps the outlines of the buttons could actually help cover up this tiny flaw.
comicGeek
October 10th, 2002, 09:36 PM
Of course. Now why didn't I think of that?
I try it now! Thanks lost in beta!
comicGeek:)
lostinbeta
October 10th, 2002, 10:19 PM
No problem, let me know how it goes!
comicGeek
October 10th, 2002, 10:25 PM
Hi!
A friend sent me this modified version of what I did and I must admit it did the job well!
:)
comicGeek
lostinbeta
October 10th, 2002, 10:42 PM
WHAT!? NO ONE IS ALLOWED TO MODIFY MY FILES!!! :scream:
Haha, just kidding. Good job =)
comicGeek
October 10th, 2002, 10:54 PM
hahahahahahaha lol
And I thought you were really angry!
comicGeek
thanks
lostinbeta
October 10th, 2002, 10:57 PM
I know, I can be very convincing sometimes :P
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.