Solved

moving object smoothly by pressing button

Posted on 2003-11-16
6
244 Views
Last Modified: 2010-04-03
Hello!

I have a menu bar with three buttons and an object(movie clip) above them.
What I want is:
  1. by pressing the button the object to move and stay above the pressed button.
  2.when roll-over a button the object moves smoothly above it. Like tweening.

What I did was I change the _x coordinate but it goes very quickly.

Thanks in advance!
0
Comment
Question by:mihaylina
  • 3
  • 3
6 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 100 total points
ID: 9760429
0
 

Author Comment

by:mihaylina
ID: 9766026
Hello,

Thanks for sending me this solution. I still have a question: I can sort of gigure out your idea but I can't find where the following properties are defined: startx, endx, rames?

Thanks
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9772577
this is the script assigned to the moving rectangle:

onClipEvent(load){
      this.startx = this.endx = this._x;
      this.frames = 5;
}
onClipEvent(enterFrame){
      // this is the decelerated motum formula
      this._x += (this.endx - this._x) / this.frames;
}

buttons change this variables with:

on(rollOver){
      this._parent.moving.endx = this._x;
}
on(rollOut){
      this._parent.moving.endx = this._parent.moving.startx;
}
on(release){
      this._parent.moving.endx = this._parent.moving.startx = this._x;
}
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mihaylina
ID: 10000168
Hi,

Now I am trying to add a scroll bar down but it doesn't appear. When I create a new document everything is fine. But with the one with your code I cannot see the scroll bar. What is the problem? Thanks
0
 
LVL 27

Expert Comment

by:negatyve
ID: 10004637
What kind of scrollbar?
0
 

Author Comment

by:mihaylina
ID: 10008557
Sorry,
I found the problem.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question