Scripting A Hover State On A Button?
Is it possible to use ActionScript to tell a button to stay on the hover state?
I would like to tell a button to stay on a hover state without having the user actually hover over it with their mouse.
Thanks in advance, Joseph
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-28-2002, 11:13 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Hover State On Button Won't Work In MC?
Hello all,
I've hit a wall on this, arrggggg maybe someone can tell me what I'm doing wrong.
I have a series of buttons in a MC. When I put in the action scripting the over state of the buttons stops working. (the button grays out when I hover the mouse over the button - at least it's suppose too). Clicking on the button still opens the correct page.
I have attached a sample file:
any help would be appreciated.
thanks!!
SCRIPTING A "VISITED STATE" After Clicking A BUTTON
hello.
i'm a designer who is learning flash. this is my first site:
http://www.bobcreative.com/
after entering, i'm tring to figure out a simple way to have the directory buttons on the left display a different color after being clicked, ie. a way for someone to know which images they have already seen.
please help.
thanx.
b
Lock Mc On Hover-state
I am looking for some quick advice/tutorial on having a series of numbered rollover buttons in a row, where on(release), that button stays in the over position. Then if you click the next number in a row, the hover state turns off on the previous and locks on the new one. Sorry if this is confusing. Thanks in advance!
Nate
p.s. I know these have to be mc's, and I know the code for doing all of the rollovers, I just don't know how to lock a button in that certain "state."
Rotating Hover State
Does anyone know how to approach making a hover state like in a photo gallery on this site:
http://www.andyfoulds.co.uk/flash_design.html?
You have to click "enter", "website designs", "samples", and it's the "Moving Images/Pages" one on the top right. Sorry it's so many levels in
The images rotate (in what seems like a random manner?) and scale up slightly. I can't figure out how the mouse hover and what the image is actually doing correlates.
Hover State Click
Ok, I've had a search for a solution but I feel that question is too basic for the serious flash work on here.... I'm a newbie in flash. ( you'll soon see that )
1. I have designed a map with country borders drawn out.
2. On the right hand side are location names in a square panel.
When a user hovers on a country inside the map OR on the names in the square panel they both change colour - ie. basic button hover state.
What i want to do is have a line appear which links the country in the map to the name in the square panel, but every time i put this line in the hover state and then preview the movie, the line is ALSO clickable and I don't want that!
How do i make this linking line appear but make it NOT clickable?
Does this make sense?
all help appreciated..
thanks
Individual State Hover Effect
I am trying to map an interactive map. What I want to do is when an invisible button is rolled over it displays a fancy image of the state. The problem is that instead of the button just being the outline of the state it a box that spreads into the other states which activates the other state and highlights it. I have found tutorials on this, but all have just done fill effects not displaying an image on rollover.
Here is what I have so far.
(example) - www.menofmurdough.com/flashmap
(map) - www.menofmurdough.com/flashmap/SW_map.jpg
(Texas) - www.menofmurdough.com/flashmap/TX_hover.png
(Oklahoma) - www.menofmurdough.com/flashmap/OK_hover.png
(New Mexico) - www.menofmurdough.com/flashmap/NM_hover.png
Notice how if you mouseover the panhandle of Texas it activates Oklahoma. Any thoughts are appreciated. Thanks in advance.
Seth
Hover Effect With Scripting - Anyone Know?
I have buttons on my flash site that I want to have a "floating/hover" type effect. Does anyone know if there's a way I can do that with actionscript or do I have to try and create a MC?
Thanks
Scripting Hover Tags For A Map - Assistance Really Neeeded
I've created a map in Flash MX, you can have a look at it here:
http://www.scottwilson.com/decmap.html
Anyway, if you click on Africa, you'll see that there's a flashing dot at the bottom of it - higlighting South Africa.
I've got about 100 or so locations to add to this map - i'm looking to add it into the downloadable movies section on flashkit, but...... I can't script to save my life, so i'm in need of someone to help me out - i'll obviously give them full credit on the finished product.
I want people to be able to mouse over the various locations and a hover box appear with location details in (similar to an html alt tag) but to do this without using xml/sql or a data file of some sort will take an age.
So I need someone who can do the code side - make the movie relate to a data file to call all of the location details from.
Can anyone help - i'll send them the swf if you want to see it.
Thanks
Olli
Down State In Drop Down Menu-then Return To Up State When Other Button Is Clicked?
Hi - nice to meet everyone,
The drop down menu I'm referring to is located in the main movie. The menu is a movie clip with the buttons inside and I have each button as 'track as menu item' in the properties. The buttons are linked to external swfs that load into an empty movie clip on the main stage. Everything loads perfectly no problem. The problem is that I can't seem to figure out the right code to put on the sub-menu items/buttons in the drop down menu to show the 'down' state when the corresponding movie is loaded (i.e., about-main button, philosophy [menu item], philosophy movie loaded). Then get it to go back to the 'up' state when another button is pressed in the same drop area part of the menu? I hope I explained myself clear enough without confusing anyone!
I would appreciate any help - I think I'm going to lose my mind - this is driving me crazy!!
Thanks - Allee
Active Button State/3 State Buttons
http://www.thecodebehind.com/code/flash ... state.aspx
Does anybody know anything about implmenting the above - but via an external class (.as) file?
I'm still learning, and so it's a bit much to wrap my brain around...
Button In A Button Hover/drop Down Menu
I'm trying to do the following, it's for a mock up so really doens't have to be 100% professional functional.
i have a text type left navigation bar, when hovering over the link, i need it to display a sort of pop up( preview of next page) which is just an image but the image needs to remain when you are inside of it. it works if you make the "hit " of the button the same as down and over...but the problem with that is that when you go anywhere the image appears upon hover, it displays (not just when you hover over the links) i only need the "preview image "to go to one frame, so the internal words need not be clickable. i know this seems confusing, i'd be happy to send the .fla file to anyone willing to help.
Button In A Button...hover/popup Menu ?
I'm trying to do the following, it's for a mock up so really doens't have to be 100% professional functional.
i have a text type left navigation bar, when hovering over the link, i need it to display a sort of pop up( preview of next page) which is just an image but the image needs to remain when you are inside of it. it works if you make the "hit " of the button the same as down and over...but the problem with that is that when you go anywhere the image appears upon hover, it displays (not just when you hover over the links) i only need the "preview image "to go to one frame, so the internal words need not be clickable. i know this seems confusing, i'd be happy to send the .fla file to anyone willing to help.
Button Hover Up And Down, How?
Hey all!
I am having some problems with my button. I want it to do this:
on rollover hover up
on rollout hover down
Could somebody please show me how to do that?
Thank you!
ps. here is the file also.
regards: Diasy
FLASH 8 - Toggle Button/released State/pressed Button
I have a series of buttons inside an array. I am trying to get the buttons so that once they are pressed, they remain in the over state. Which is a darker color than the up state. So that people know which button they have pressed. Is there an easy way to do this for buttons?
Please help someone,
Thanks,
M
Hover Scroll Button?
how can i script a button so that when you hover over the button it scrolls continuosly?
can i use this somehow in it?
on (rollOver) {
text.scroll = Number(text.scroll)+1;
}
this only scrolls +1 on rollover...
some math perhaps?
Hover Button With Animation
Hi, I'm trying to make what is effectively a hover button. Where you move your mouse over the button (without clicking anything) and it triggers an animation on a seperate movie clip located next to the button.
I'll tell you what it is i want to do:
the button is on the right, you hover over it, it makes a movie clip symbol, next to it, slide over to the other side of the page, once you move the mouse off the button, the movie clip now moves back.
I'm struggling to work out how to do this. If anyone knows where to find a good tutorial, or could tell me here, I would be very greatful
Thanks
Button Hover Problem
Hey guys,
I have a document with a few simple buttons set with rollovers. Here's what it looks like without hovering:
When rolling over the buttons, the hover makes visible a new box with more information about the link. Here's the hover in action:
The only problem is, when I mouse over the area where the box exists in the hover, the button gets activated and the box shows. In other words, I need to have the button only activate/show the description box when the button *itself* is being hovered over.
Does this make sense? Has anyone else run into this problem? Any help is greatly appreciated.
Thanks,
- Jack
[F8] Hover Button Problem
hey,
I have a simple square graphic that when you rollover it, text appears above it explaining what that link will show you.
Problem is that even when the text is not visible (the up state), if your mouse wanders over the text, it's appears and initiates the over state. Essentially, the text is a part of the button.
I just need to make the text "null" with the square graphic the actuall button.
Thanks in advance
Want To Play MC When I Hover Over A Button.
Hey folks,
Sorry for the newbie question, but I haven't used Flash in years and I am rusty! I have a MC named TextMC that I wish to play once a user hovers over a specific button. However, I want it to go to a specific frame of that movie as I have different buttons which will call on the same MC.
Help please?
Button That Changes Color When I Hover On It
I am having problems on scripting. Hopefully someone can help me out.
I want the button to tween into a different color or tint when I hover on it.
If I named my button home_btn what script do I put in to make it work?
Keep A Button Set To Hover Once Clicked
Hi,
I was wondering if there was a quick way to set a button to it's hover state once clicked?
I know how to do this by having it be a movie clip and changing its time line position onRollOver. onRollOut and onRelease. I am just trying to do this quick using a button so didn't want to deal with all that. Thanks!
Button States - How To Keep Button On Rollover State When Clicked.
on (rollOver) {
this.btn_about.gotoAndPlay("mouseover");
setProperty(this.btn_about, _x, 25);
setProperty(this.btn_about, _y, 29);
}
on (rollOut) {
this.btn_about.gotoAndPlay("mouseout");
}
on(release){
_parent.gotoAndStop("about");
}
There's my button code. Now a rundown on my delima.
I have a movie "company.swf" that is loaded into an empty MC "content" that is located within my main movie "main.swf". My buttons are all located inside an MC "subnav" inside of company.swf. I have seperate MC's for each button with an actual button with just a "hit" area. I would like each button to stay in the rollover state when clicked so a user knows where they are in each section. I hope I'm being clear here. My rollover and rollout works fine.
Please help!! Thanks
Movie Clip Within Button - How Do You Disable Down State Of Button?
Hi - I have created a menu down the side of my flash site which is in the form of a button so that when the user rolls over the button, it brings up the menu. Within, this button is just text - the names for each page the user can select to go to (text is within movie clips so I can add actionscript to them).
However, I want to add on (press) {gotoAndPlay("home",1); } etc for each movie clip within this button but when i test the site, this code does not work as the buttons down state has priority over the movie clips within it.
Is there some actionscript code which could disable the down state of a button? (as i only need the button as a rollover anyway and i need the movie clips within the button to have priority in terms of actionscript for linkage etc)
Thanks
Playing Another Clip From Button Hover
How do I....
Have it so that when a visitor hovers over a button that another movie clip in the same .swf plays at a certain frame!!
Hopefully this is simple enough to anser - thks!!
Hover Button Shows Different Frame
Can anyone tell me how me make a button that when you haver, it shows a different frame?
Please explain it simple and step by step so that I can understand.
Thank you in advanced!
Hover-captions Atop Button, Possible?
Hi all. I've been looking into this new hover caption effect by kirupa.com:
http://www.kirupa.com/developer/mx/captions.htm
It works fine as the tutorial says, but i need to modify it a little.
My scenario:
I have buttonA(which doubles as a window for information) on the mainstage that has the AS to allow it to be dragged.
Code:
on (press) {
startDrag ("");
}
on (release) {
stopDrag ();
}
But, in the captions AS, there is also a startDrag function. This apparently cancels each startDrag out. How would i modify this? thanks
take care.
Link Button Hover With Text
Hoping someone can help me out here.
I am creating an interactive map indentifying our locations throught the UK with flash. I have created interactive buttons (map pins) which when moused over change slightly in size followed by a link to the relevent page on click. Due to the size of the map (being quite small) I don't have room to add the location names along side the buttons, and I do not want small text box pop-ups next to the button on mouse over. Instead I have a list of locations down the side of the map in a column/table. My aim is to link a change of colour in the tables text when mousing over the button within the map and vice versa.
I hope some of this makes sense. Any advice greatfully received.
[CS3] AS2 Button Hover Over/out Function Not Working
To make a line of text a button I have used a square shape with alpha 0% and added actions to it - I have to do this as I cannot get the correct font in Flash CS3.
I need to make a shape appear when the button is hovered over so I use this code:
Code:
stop();
faq_pointer_1._visible = false;
forks.onRollOver = function()
{
faq_pointer_1.visible = true;
}
forks.onRollOut = function()
{
faq_pointer_1.visible = false;
}
I get no faq_pointer_1 appearing at all - I have to use the stop(); as otherwise it goes to the next page. Is this the problem? or is there any other possible reason.
Help appreciated
Show Text While Hover Over Button
Hey Actionscript Experts,
I have 5 buttons, I want, that everytime you scroll over each button it shows you a text in a field, next to these buttons. You can see it in the screenshot.
I use Actionscript 3 and I found out, for that I have to use ROLL_over or MOUSE_over but I'm a complete newbie and don't understand Actionscript.
Can somebody help me where do I have to put it in my current code, which I made somehow so far:
This is my action for these buttons:
Code:
stop();
var ignoriereStop : Boolean = false;
segmentbtn0.addEventListener(MouseEvent.MOUSE_DOWN,SegmentHandler0);
function SegmentHandler0(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay(0,"demo");
}
segmentbtn1.addEventListener(MouseEvent.MOUSE_DOWN,SegmentHandler1);
function SegmentHandler1(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay("segment2","demo");
}
segmentbtn2.addEventListener(MouseEvent.MOUSE_DOWN,SegmentHandler2);
function SegmentHandler2(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay("segment3","demo");
}
segmentbtn3.addEventListener(MouseEvent.MOUSE_DOWN,SegmentHandler3);
function SegmentHandler3(event:MouseEvent):void {
ignoriereStop = false;
gotoAndPlay("segment4","demo");
}
segmentbtn4.addEventListener(MouseEvent.MOUSE_DOWN,SegmentHandler4);
function SegmentHandler4(event:MouseEvent):void {
ignoriereStop = true;
gotoAndPlay(0,"demo");
}
and I think I have to create a textfield, convert it to MC, name it to "informationtext" for example and use MouseEvent.Roll_OVER or MouseEvent.Mouse_OVER and maybe Roll_OUT or Mouse_OUT if you leave the button.
I tried it to put it in there but I always get an error, I just don't get Actionscript, it would be great if somebody can tell me where exactly I have to put the code to make this work.
if you hover over, there should be just a normal text next to the buttons, not really a tooltip which is following the mouse until it's leaving the button.
Hope everybody understands what I mean and someone can help me.
I really appreciate your help
Multiple Buttons - Button On Hover Always On Top
Hi all,
As an example of what I'm doing, picture a map of Europe, divided into countries. Each country (which is a button) is obviously touching one beside it (if they share a border), and the countries are all on their own layer. The problem is, some countries that touch other countries have their 'glow' effect appear behind a country beside them (if they are on a layer below the other layer), and I want whatever country the mouse is hovering over to be always on top.
My question is, what code can I attach to each button to ensure that when I hover over it, it will be on top of the other buttons, regardless of what layer it is on? Also where do I put the code?
Thanks!
Making A Hover Effect For A Button
Hi,
This is probably a stupid question, but I am having trouble with it...
I was looking at the Flash MX photogallery with XML tutorial, and ,from what I understand, as long as we have the code correctly, we can have the interface anyway we want.
The problem I am having is how to make the interface. For example, how do you make a simple hover effect for a button? Just changing colors or something?
Can you do it with ActionScript, or is there a better way?
Any help would be greatly appreciated...Thanks in advance.
Subhash
BUTTON ROLL OVER STATE TO STAY.. But Not A Button
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
this is what i have to animate a button/movie clip - kinda like what www.newstoday.com has for their buttons.....
but when i press the button and go to a different section i want the over state to stay over...ive tried to add this but not sure where i going wrong...
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
} else {
this.prevFrame();
}
}
onClipEvent (mouseDown) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
this.nextFrame();
}
or do i need to go with a on script?
like this
Movie Clip Button With Hover Text...?
i have a movie clip as a button...how would i then have text which hovers over it...?
i knw how to do it with a normal button but not with a movie clip as a button...
i have attached the file if anyone can assist...?
thx
Hover Captions Showing Before Mouse Over Button
My hover captions are appearing as soon as the movie is loaded, even when the mouse is not over any button.To make them work fine, I have to rollover a button so the hover captions works fine.
Ho wto fix that?
Hover Captions Showing Before Mouse Over Button
My hover captions are appearing as soon as the movie is loaded, even when the mouse is not over any button.To make them work fine, I have to rollover a button so the hover captions works fine.
Ho wto fix that?
Hovering Button Caption Doesn't Hover Nemore
Hi,
In a Flash MX project, i created a 'box' MC within which are 3 buttons - 'click to drag', 'minimize' & 'close'. Made another 'hover' MC thats given a function to appear and tag along with the mouse pointer till the mouse hovers over any of the 3 buttons hit area. The 'hover' MC contains a dynamic text box that displays the respective buttons function.
The problem arises when the 'click to drag' button is clicked on and the mouse is then rolled over any of the 3 buttons again, the 'hover' MC appears in a fixed position and doesn't follow along the mouse within the roll over state. wonder why....please help!
Flash Button Rollover/Hover Not Working Immediatly
http://www.ekolinemedia.com/portfolio.htm
Here is the problem: In Opera and IE7, when you hover/rollover over a link you do not get my button animation immediatly. Instead you have to click on the button, and then when you hover over the button you get an animation
IE6 and FF allow the user to play the hover animation immediatly.
I think it is because the user has to allow the "control" to be activated. I am not sure how to fix this though.
Any help would be much appreciated!
First frame:
Code:
if(_root.getBytesLoaded()==_root.getBytesTotal()){
gotoAndPlay(3);
}
else{
gotoandplay(1);
}
Last frame:
Code:
stop();
Dynamic Text Ruins The Hover Button Effect
I have a Dynamic text that ruins the hover button effect!!
How can i solve that?
The Dynamic text belongs to the button itself, and i cant change it to a static text since i'm going to change it with the .text property.
Button Down State
I am trying to create a flash simulation of a security keypad. One of the required features is that a different action occur if the user holds down the button for 3 seconds rather than just releasing it. To accurately mimic the real-life keypad after the button has been held for three seconds certain lights should begin to flash and events trigger before the button is released.
I have tried countless things and none of them seem to be working. Is there a way to check the state of a button so I could do a "Do while" loop based upun it still being pressed?
Any nudging in the right direction is very appreciated.
Mc On Down State Of Button
If I create a movie clip that is the down state of a button how do I get it to finish playing even after button is released? Thanks
How Do You Set The State Of A Button With AS?
how do you set the state of a button with AS?
i have a button on the bottom of the stage, and another instance of the same button at the top of the stage (for visual effect). i'd like to make it so that when you roll over the instance of the button at the bottom of the stage, the instance at the top of the stage would show the rollover effect. any ideas? thanks in advance.
State Of Button
My requirement is that when I press a button the look of the button needs to change.In my case - a pause button - when clicked should change to a play button.
I've a deadline and I'm not getting anywhere.
Thanks
Hit State Button Help
ok, I put in an image inside of the already existing button, on the hit state of the button, how do i make it work when i click it????
Hit State Button Help
ok, I put in an image inside of the already existing button, on the hit state of the button, how do i make it work when i click it????
Hit State Button Help
ok, I put in an image inside of the already existing button, on the hit state of the button, how do i make it work when i click it????
On And Off State Of Button
Hi,
I have a button and it is suppose to bring up a pop up menu when a user hits it and when it is hit again (while the pop up menu is still up) the menu will disappear. This is what I have:
on (release) {
if(state=="off"){
state="on";
_root.gotoAndStop(65);
}
else
state="off";
_root.gotoAndStop(45);
}
However, this code doesn't work, I understand I need to initialize "state" somewhere, but I dunno how to or where to. how can I initialize the state? can someone help me please?
Thanks.
|