Motion Tweening With Actionscript

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.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 4th, 2004, 05:05
Junior Member
Join Date: Jun 2004
Location: USA
Age: 25
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to DocBoy52 Send a message via AIM to DocBoy52 Send a message via Yahoo to DocBoy52
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?

  #2 (permalink)  
Old Sep 4th, 2004, 16:40
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I need to install Flash (new installation of windows) and have a little play to get this working, so bear with me please.
  #3 (permalink)  
Old Sep 5th, 2004, 05:18
Junior Member
Join Date: Jun 2004
Location: USA
Age: 25
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to DocBoy52 Send a message via AIM to DocBoy52 Send a message via Yahoo to DocBoy52
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.
  #4 (permalink)  
Old Sep 5th, 2004, 06:16
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
That's the one :wink: well done! It's always better when you figure things out for yourself.
Closed Thread

Tags
motion, tweening, actionscript

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 15:02.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43