Moving objects using actionscript?

Greetings everyone,

New to the forum and looking for a little help (-:

I’m learning flash by doing it (making a complete website learning as I go) and have a question regarding how to move objects using actionscript.
Below I’ve attached an image of a menu on the website. What I want is to have the blue arrow move smoothly from menu item to menu item when the user maneuvers through the site. Preferably the arrow should move with easing as is possible with tweens. I ran through a tutorial on this sitg that dealt with moving objects using actionscript, but it only showed how to make the object move continously in one set direction. I was hoping that there was a way to add an action to each menu item that tells the blue arrow clip to move to a predefined set of pixel-coordinates.


MovieClip.prototype.easeY = function(tY){
this.onEnterFrame = function(){
this._y = tY-(tY-this._y)/1.2
this._y > tY-1 && this._y < tY+1 ? delete this.onEnterFrame : null
}
}
virksom.onRollOver = aktiviteter.onRollOver = referencer.onRollOver = kontakt.onRollOver = at.onRollOver = function(){
arrow.easeY(this._y);
}

The arrow movieclip will then ease to the y position of the registration point the button the is being rolled over :slight_smile:

Thanks Voetsjoeba!

Sitting here at work (the site is for my company) so thumbs up for the fast reply. Still, I’m not quite sure how to get the code you’ve provided to work in my .fla.

Should the virksom, aktiviteter, referencer, kontakt, at & arrow parts in the code be the instance names or the names of the movieclips and graphics as they are named in my library?

Oh, and I presume that the code goes in the arrow movie clip, right? Or should it be in a keyframe on a seperate layer?

The virksom, aktiviteter etc names I used in the script are the instance names of your buttons.

This code does indeed go on the timeline in which your buttons and arrow are in :slight_smile: