ActionScript 2.0 :: Button That "remembers" If It Has Already Been Clicked Or Not?
Oct 10, 2004
code for a button that "remembers" if it has already been clicked or not. For instance, the button is blue, once its clicked it turns red and does go blue ever.
I have 4 navigation button and like home, about us etc.... And i want to disable home when it is click and cannot clicked it until the user click another button first. means if a visitor is at home page then home navigation is disabled, and all other are active, and when they click at aboutus button then the pages goes to the about us page and the about us button is disabled and other get active. I want this solution in AS3 with oop concept.
I've got about 6 buttons laid out, one on top of the other in a list format. In their normal state the buttons are grey in colour, when I rollover them, the buttons flash and turn to orange. Now, what I need to happen is this: I want the buttons to stay orange once clicked and only roll out back to grey when the user has clicked on another button in the list. I've been told that the best way to do this is via adding a listener, however I am a little unsure as to how to go about this. I've checked the flash help file and have a basic understanding of how listeners work...but can't really wrap my head around applying it to this situation. Perhaps I will need to have all the buttons as separate broadcasters?
I'm not very sure how to explain my situation... In short codewise: I have a movieclip that listens for a click-event, set trought addEventListener. At a certain point I 'addchild' a button to that movieclip AND disable the eventlistener of the buttoncarrying movieclip. (the button is over the movieclip on the screen, and clicking the button must NOT trigger the mouseclickevent of the parent movieclip.)
when clicking the button, i need to do some actions (works ok) AND get the movieclip listening to NEW clicks. But from the moment I add the evenlistener to the movieclip again, it seems to 'remember' the OLD moueclick meant for the button. That's what I can't have, I start to think that I need to flush a clickingbuffer belonging to the movieclip or something... Now in words: It's about a minimized login-window (=movieclip), that needs to maximize when clicking on it (anywhere on the window). When maximizing I add a form and some buttons. When clicking my "cancel"-button I want to minimize my login-window again and let it listen for mouseclicks again so we can maximize it again..
I have a menu with five nav buttons (atcually MovieClips). Each has three frame labels: "on", "stay", and "off". The rollover and rollout animations play flawlessly, but I'm at a loss as to how to give each button a sticky "active" state. I'd like the button to stay in it's active state until another button is clicked, then I would like it to play it's "off" animation. Each MC has this code:
how to write a actionscript code for a button when the button is clicked it should move to the nextframe.
// About and smile1 button scripts stop(); _root.smile1.onPress = function() { if (mouse_over_smile1) {
[code]....
i have given 3 functions as onEnterFrame,onPress,onRelease. i tried all these but didnt get the result.smile1,smile2,smile3 are button instances which are declared on the monie clip.my main thing is i hav a button, when i click on that button it should go the next frame which i have declared in "gotoAndPlay(6)" method.
Anyway what I need to do is have a movie clip finish playing when a button is clicked and then go to the frame label associated with the button. I hope I'm explaining myself ok. So if I had say 4 buttons Home Gallery About Contact If Contact is clicked then I want the Home page to play (Which is a fade out) and then go to Contact Page (which will fade in). Then If Gallery is clicked then I want Contact to fade out and then go to Gallery page and fade in.
I'm trying to figure out how to disable a button after it is click and then enable it once another button is clicked. I'm stuck on how to enable the button.
on (rollOver) { this.gotoAndPlay("s1"); _root.slideshow.gotoAndPlay("s4");
I want to make a button (or graphic) active and visible if another button is clicked. But it must be invisible and unclickable before the other button is clicked. (this is a "find the differences between the 2 pictures game" and I want circles to appear over the differences that the user finds but only after he clicks it)
The button (or graphic) I want to become active has instance name of "sockcircle_btn" The button you click to make it appear is called "sock_btn"
In the first frame of the sockcircle_btn layer, this is my code
sockcircle_btn.addEventListener(MouseEvent.CLICK,sockcircledisable); function sockcircledisable(evt:MouseEvent):void{ sockcircle_btn.mouseEnabled = false; }
In the sock_btn frame (frame 3) this is my code
sock_btn.addEventListener(MouseEvent.CLICK,sockcircleenable); function sockcircleenable(evt:MouseEvent):void{ sockcircle_btn.mouseEnabled = true; }
The file is setup to loop between frames 2-3. But the sockcircle_btn never enables even when sock_btn is clicked.
Pretend a button is selected - when that button is selected it goes to the active frame which shows that the button is selected. When you click another button it currently resets itself - BUT - I want it to go to and play frame "mouse_out" and than reset itself. Below is the code I am currently working wtih:
I have created a flash project all in the 1st frame of my main timeline, so i can only do this via action scripting as i dont want to go back into my sub timelines, i just dont know how to write the coding! this is what i want to do: button2.visible=false but if button1 is click then button2.visible=true
I have a simple question for someone --Im very new at Flash. I have a box and 3 different colored buttons at the left. When a person clicks the red button the box turns red, green button turns the box green, etc. My question is I would like the text color of the box to appear under the box according to what button they press. Here is my code to turn the box red. What line would i add to have the word Red show up under the box when the red button is clicked. Do I type the word Red and make it a movie clip? Then what?
I have created a box with 5 buttons with their corroesponding color names beneath them at the left. When you click on a button it will change the box to that color. How do i get the color name that is clicked to show up under the box?
im working on a new project, and its finished - but there is one issue.... to travel to the next page, you must click the button 2 times ( even if the clicks are 30 seconds apart )....what would cause this? the method we were asked to do was to base the page transition on the timeline rather than embeded in its own MC like previously. that is easy, and here is my set up ( frame and actions ):
[Code]....
and on frame 132 is the frame label "start" and this code:engage.play(); the buttons are in their own MC on frame 125 and are coded correctly ( here is an example of btn 1 ): function btn1Click(event:MouseEvent):void{ MovieClip(root).gotoAndPlay("trans"); MovieClip(root).page=1;} btn1.addEventListener(MouseEvent.CLICK, btn1Click); btns 2, 3 and so on are written the same.... now, i get no errors, but you must click each button twice ( and if its in the middle of the transition sometimes 3 times
I've got a button underneath a mc, is there any way the button cannot be clicked. Because now, even when the button is under the mc, the mouse-hand appears and you can click it..
I have a button within a MC and when clicked i want to go to another scene,I have tried
_root.gotoAndStop("MyScene",1); gotoAndStop("MyScene",1); gotoAndPlay("MyScene",1); and _root.gotoAndPlay("MyScene",1);
but it doesn't work. all element have instance names and a trace(); on the button confirms it has been clicked, but it just wont switch to the new scene,
I'm working on a project where there's this girl standing still and she's supposed to jump to the front when clicked on, but she doesn't jump. She's set as a button symbol like such: [Up] standing still, instance is a png file [Over] Bends down and swings her arms repeatedly. It leads to a movie clip with another movie clip file inside and this works successfully [Down] When clicked on she gets into this position pre-jump. Instance is a png file
I have created 4 buttons so far and when pressed they change the color of a box on the screen. I will be putting more buttons on the page. When a button is pressed, how can i get a black outline to show around the button to let the person know that was the button they selected--it would then go off when the next button is selected.
red_btn.onRelease = function() { var boxColor_color = new Color(box_mc); boxColor_color.setRGB(0xFF0000);
I've got a button underneath a mc, is there any way the button cannot be clicked. Because now, even when the button is under the mc, the mouse-hand appears and you can click it...
i need some action script for a button to load another swf file when clicked. new window needs to be at the same size as the swf movie and without toolbars etc. also need a similar code to load swf file but to go on a button on a html page.
I'm trying to create a button that sends you to a url when it's clicked. Whenever I test the movie, I get the compiler error "1046: Type was not found or was not a compile-time constant: MouseEVENT."
Here's the code:
homeBtn.addEventListener(MouseEvent.MOUSE_DOWN,mou seDownHandler); function mouseDownHandler(event:MouseEvent):void { navigateToURL(new URLRequest("url")) }
I'm making a page with multiple soundclips - each one launched by a separate Flash button.
Problem: If someone clicks a button and then clicks another button without first stopping or pausing the original soundclip, the two play at the same time. Press another and three clips play at once.
How do I make it so that when you push the next button it stops the first clip and then plays the second one?
I am trying to run a function upon a button being clicked. I want that function to call a seperate function outside of the Click function. It tells me it needs an argument but not sure what argument to give.
I don't have much experience with buttons and barely any with action script. I am trying to make a button that is a non-animated symbol on up, a glowing version of the symbol on over, and on down the symbol swaps to an animated symbol that moves across the screen.
But, on the down state, the symbol does not animate like it is supposed to. When I hold the mouse button down, the glow goes away, but the symbol just does not animate as specified in the symbol that appears during the down state.
I tried experimenting with making the button move on the main timeline, adding a stop() command in one of the layers of the up-state symbol, and then adding a play() command to one of the layers of the down state symbol, but nothing seems to work.[code]...