Solved

moving object smoothly by pressing button

Posted on 2003-11-16
6
243 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

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 last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

792 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