Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : Increment _x to the left



Van Garnett
5/6/2004 7:59:37 PM
I have a nav bar to the right of the stage. It's starting _x is currently 0.
When the mouse moves over an invisible button I need for the blue nav to
'slide' to the left until it reachs an _x of -224. I need for it to "slide",
not just pop in place. I know I can make a tween in the movieClip, but if the
mouse moves out before it reaches it's final resting place I want the blue nav
to "slide" back the other way (to _x 0). If the mouse enters the button before
the blue nav gets back to it's starting point, I need it to start "sliding"
back towards _x -244.

Here is what I have.
//=====================================================>>
// this makes the blue bkgd and bar in the nav move
_root.right_nav.nav_hotspot.onRollOver = function() {
if (right_nav.nav_box._x = -224) {
_root.right_nav ++;
trace ("nav reveals");
}
}
//=====================================================>>
//=====================================================>>
// this makes the blue bkgd and bar in the nav move
_root.right_nav.nav_hotspot.onRollOut = function() {
_root.right_nav.play("close");
trace ("nav hides");
}
//=====================================================>>

Oviously, it isn't working right, when the mouse enters the invis button it
just 'snaps' into place.
How do I make this work?

Thanks,
Van
Jack.
5/6/2004 10:24:50 PM
[quoted text, click to view]

start by using the correct syntax for comparison ("==")
in the code you posted, you are assigning ("=")

if (right_nav.nav_box._x == -224) {...}

hth
Van Garnett
5/10/2004 3:13:01 PM
that didn't work.
would you mind going to http://www.blookie.com/blookie/helpVan.htm and look at the fla file and see what i am doing wrong.

thank you.
AddThis Social Bookmark Button