Forum Topic: Having a movieclip go to a point AS

(92 views • 8 replies)

This topic is 1 page long.

<< < > >>
None

PhillipHan

Reply To Post Reply & Quote

Posted at: 11/5/09 02:25 AM

PhillipHan NEUTRAL LEVEL 02

Sign-Up: 03/25/07

Posts: 40

How would I make it where you click a button and move a movieclip to a certain coordinate? and smoothly too?


None

Fion

Reply To Post Reply & Quote

Posted at: 11/5/09 03:43 AM

Fion LIGHT LEVEL 34

Sign-Up: 08/21/05

Posts: 2,373

In pseudo-code:

btn.onbuttonPress {
    move = true;
}
mc.onEnterFrame{
    if(move){
        x += (xpos - x)/10;
        y += (ypos - y)/10;
    }
}

None

PhillipHan

Reply To Post Reply & Quote

Posted at: 11/5/09 03:46 AM

PhillipHan NEUTRAL LEVEL 02

Sign-Up: 03/25/07

Posts: 40

So is this where the movie clip will go from Point A to Point B by clicking button #1 and then clicking button #2 will go from Point B to Point A?


None

Fion

Reply To Post Reply & Quote

Posted at: 11/5/09 04:02 AM

Fion LIGHT LEVEL 34

Sign-Up: 08/21/05

Posts: 2,373

At 11/5/09 03:46 AM, PhillipHan wrote: So is this where the movie clip will go from Point A to Point B by clicking button #1 and then clicking button #2 will go from Point B to Point A?

The above pseudo-code is for mc to move from it's current position to (xpos, ypos) when btn is clicked.


None

PhillipHan

Reply To Post Reply & Quote

Posted at: 11/5/09 04:09 AM

PhillipHan NEUTRAL LEVEL 02

Sign-Up: 03/25/07

Posts: 40

Hmm all this time I was trying to use this code but it sort of failed.

var startX = 1200
var endX = 400
var speed = 10
camera._x = startX
function moveMe(targ){
targ._x+=(_root.endX-targ._x)/_root.spee d
}
journey.onRelease = function(){
setInterval(moveMe,30,_root.camera)
}


None

PhillipHan

Reply To Post Reply & Quote

Posted at: 11/5/09 05:37 AM

PhillipHan NEUTRAL LEVEL 02

Sign-Up: 03/25/07

Posts: 40

Actually I'm trying to create a Vcam that will be able to move to four seperate areas with a click of four different buttons.


None

Magyar

Reply To Post Reply & Quote

Posted at: 11/5/09 05:39 AM

Magyar DARK LEVEL 19

Sign-Up: 09/28/06

Posts: 1,583

thats impossible, sorry.


None

PhillipHan

Reply To Post Reply & Quote

Posted at: 11/5/09 03:33 PM

PhillipHan NEUTRAL LEVEL 02

Sign-Up: 03/25/07

Posts: 40

Well I saw this tutorial and on some one website and I forgot the link but it had the same thing where it had a minimap and 4 boxes on it clicking one of them moving the vcam around


None

PhillipHan

Reply To Post Reply & Quote

Posted at: 11/5/09 04:19 PM

PhillipHan NEUTRAL LEVEL 02

Sign-Up: 03/25/07

Posts: 40

Actually what I was trying to achieve was something like this when you click one of the menu buttons it leads to another part http://chroniclesofnever.com/


All times are Eastern Standard Time (GMT -5) | Current Time: 10:18 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!