This is a discussion on "Motion Tweening With Actionscript" within the Flash & Multimedia Forum section. This forum, and the thread "Motion Tweening With Actionscript are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Motion Tweening With Actionscript
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Motion Tweening With Actionscript
Alright here is what I am trying to do:
I am trying to make a power meter, that goes up and back down, which will basically be a rectanglular movie clip, whose height is incremented until a certain height is reached, then decremented back to one, then repeat. I would do this with a regular motion tween, but this is for a game, and as the levels progress I want the bar to move faster, which basically means incrementing the height by more. The problem is, I cant figure out a way to do this for some reason. One would think it would be easy, but that isn't proving to be true. Although perhaps I am overlooking some very obvious detail. As of now, here is how I've been approaching this: I have a movie clip symbol with a rectangle in it, sized appropriately. I have a second movie clip symbol, which has an instance of the rectangle inside of it (in the 2nd frame). The rectangle movie clip instance has an instance name of "meter". This second movie clip has two frames. The first frame has the following actions in it: gotoAndPlay(2); The second frame has the following actions in it: _root.meter._height = _root.meter._height + 2; updateAfterEvent; gotoAndPlay(1); What I am hoping to do is, in the 2nd frame increment the height once, and then loop back to frame one then repeat the process over and over again.. at any rate, it isn't working. Can you guys give me any other suggestions on better ways to approach this? |
|
|
|
|||
|
I need to install Flash (new installation of windows) and have a little play to get this working, so bear with me please.
|
|
|||
|
I figured it out. I decided to approach this in a different manner, and it worked like a charm.
What I did was, I made the rectangle into a movie clip, and gave it an instance name. Then I made a function which determined whether the meter was expanding or shrinking, and incremented or decremented it accordingly. From there, I used the setInterval command to periodically call the function every 1/10th of a second. I put all of this in the first frame of the movie, and it worked like a charm! Just thought that I would post this in the event that somebody else was curious as to how to do it. |
![]() |
| Tags |
| motion, tweening, actionscript |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I do the motion video thing? | shammy2007 | Flash & Multimedia Forum | 1 | Apr 27th, 2008 22:06 |
| jerky pngs when tweening | funkydreadman | Flash & Multimedia Forum | 5 | Sep 25th, 2007 16:57 |
| Motion path in flash? | Zonglars | Flash & Multimedia Forum | 7 | Jul 26th, 2007 04:19 |
| MOTION GRAPHICS for WEB & VIDEO...I DO! | xemola | Introduce Yourself | 4 | Jun 16th, 2007 04:07 |
| Motion Guides are killing me | Webforumz Staff | Flash & Multimedia Forum | 5 | May 20th, 2004 15:27 |