I'm working on a Flash menu, and I've made some buttons, there has a effect when I turn the mouse over them; a effect with some lines going around the written stuff...
But I think, that it could be very nice, if the lines would draw back to the start point, they original started on.
In short, If we have some lines their extend when I put the mouse over the button, I would like if the lines would draw back to the beginning point, when I remove the mouse cursor...
Can that be done, and if it can, is it with an ActionScript or just a simple Button command or what?
I the Button edit area; there is only 4 items:
Up Over Down And the last one: Hit
But what about remove or out?
I've try to look in the ActionScript library for something to use, because, i slightly remember to have seen such a function before, somewhere...
That would most definatly be some ActionScript. The lines themselves would be drawn using AS as well. So when the MC detects the mouse it will begin to draw on a random or set path around point x. Then when the mouse leaves they can return to origin or fade out... you could really do anything with AS.
Depending on your target Flash Player there are a few ways to do this
Flash 5 and 6
on the button clip
on(rollOver){
//goto and play a frame animation that show lines moving out
}
on(rollOut)
{
//goto and play a frame animation that show lines moving back in
}
Of course this doesn't deal with what happens when somebody mouses out before the "out" animation finishes.
To do this you'd have resize the clip's characteristics based on what they currently are. For instance :
on(rollOver){
//maxWidth is the clip's maximum allowable width (say 40)
if(clip._width < maxWidth)
{
clip._width++;
}
}
on(rollOut)
{
//minWidth is the clip's minimum allowable width (say 10)
if(clip._width > minWidth)
{
clip._width--;
}
}
The Flash Player 6 equivalents are clip.onRollOver = function() {..} and clip.onRollOut = function() {...}
They can be placed independently of the clip (e.g on the timeline).
Bookmarks