?
Solved

moving object smoothly by pressing button

Posted on 2003-11-16
6
Medium Priority
?
246 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 27

Accepted Solution

by:
negatyve earned 400 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
Here are some practices and techniques that can be adopted into your Flash/Flex application development process. Note: Not all "performance tips" provide an immediately-recognizable benefit.   This article does not include timing validation data,…
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.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

765 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