Solved

moving object smoothly by pressing button

Posted on 2003-11-16
6
245 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 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
Technology Partners: 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

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. …
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to how to record live broadcast.

724 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