im trying to make a site navigation that does the following…
1.) on mouse over, the navigation buttons’ alpha will become 0
2.) a small movieclip with an instance name of “movingBar” should follow the X position of the current button being hovered over…
so i have created a custom class for all my buttons:
[LEFT]
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class NavClass extends MovieClip
{
public function NavClass()
{
addEventListeners();
this.buttonMode = true;
this.useHandCursor = true;
}
public function addEventListeners():void
{
this.addEventListener(MouseEvent.MOUSE_OVER, followCursor)
this.addEventListener(MouseEvent.MOUSE_OUT, removeNavGlow)
}
function followCursor(event:MouseEvent):void
{
this.alpha = 1;
Object(root).updateBar();
}
function removeNavGlow(event:MouseEvent):void
{
this.alpha = 0;
}
}
}
[/LEFT]
and on the main timeline, here’s the code:
[LEFT]
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var moveBarTween:Tween;
var resizeBarTween:Tween;
function updateBar():void
{
trace("code running");
moveBarTween = new Tween(movingBar,"x",Regular.easeOut,movingBar.x,event.target.x,1,true);
resizeBarTween = new Tween(movingBar,"width",None.easeNone,movingBar.width,event.target.width,1,true);
}
[/LEFT]
if i try to publish the movie, the following error shows:
“1120: Access of undefined property event.”
if i try to comment-out the other two statements like so:
[LEFT]
function updateBar():void
{
trace("code running");
//moveBarTween = new Tween(movingBar,"x",Regular.easeOut,movingBar.x,event.target.x,1,true);
//resizeBarTween = new Tween(movingBar,"width",None.easeNone,movingBar.width,event.target.width,1,true);
}
[/LEFT]
the trace statement works and no errors are reported…
so it means theres some sort of problem with those two statements which i just cant figure out…