ActionScript 2.0 :: Changing A Color Of A Button When Clicked?

Nov 24, 2004

I am changing a color of a button when clicked. How every i have ten buttons. Each instance name is like this Person1. Person2 etc.I can change the color of the button when clicked, however I want to make sure when you click on a different button, it changes the previous button back to its original color.I know i can do this the ghetto way and list out all the buttons i want with no color each time but if later i have 50 buttons i dont want to list them. So i built a loop but the loop is not working right. Can someone help?

This code is an example of what might be on the first button:

Code:
on(release){
for(i = 0; i<11; i++){
var tmpPerson = new Color("Person"+i);

[code]....

View 7 Replies


Similar Posts:


ActionScript 2.0 :: Active Button - Stay The Rollon Color After It's Clicked And Then The Rolloff Color When Another Button Is Clicked?

Sep 29, 2008

How can I make it stay the rollon color after it's clicked and then the rolloff color when another button is clicked?

[Code]...

View 7 Replies

Flex :: Color Of Icon When Changing Color Of Button?

Sep 16, 2011

I have a button with an icon. I want to have the button in gray so I change the chromeColor but when I do that, the icon became darker.On the left the button without changing the color, on the right, the gray button with and darker icon.How can I have a gray button without changing the icon color?

View 2 Replies

ActionScript 3.0 :: Changing Button States When Clicked?

Aug 4, 2009

I have been working on a button class and ran into a little bit of a snag.

Here is the class I created:
package
{
import flash.display.*;
import flash.events.*;

[Code]....

Now while this class is working, I can't seem to figure out how to make it so when you click on one button it makes sure all the other buttons are sent back to the offState. I am using _mc's for my buttons. I think I need to put my buttons into an array and keep track of them at way, but I'm not sure about how to do that. Would I be able to get this effect to work in this .as file or would i need to write another one to control the buttons and where they are in there states(up/down/over).

View 5 Replies

ActionScript 2.0 :: Background Changes Color When Button Clicked

Jun 27, 2003

I have a menu animation where my background changes colour when clicked by a button. > This works fine. But when I click the button the second time it doesnt go to that colour, it goes to another colour.

View 1 Replies

ActionScript 2.0 :: Change The Color Of The Button When Clicked?

Nov 24, 2004

can change the color of the button when clicked, however I want to make sure when you click on a different button, it changes the previous button back to its original color.I know i can do this the ghetto way and list out all the buttons i want with no color each time but if later i have 50 buttons i dont want to list them. So i built a loop but the loop is not working rightThis code is an example of what might be on the first button:

Code:
on(release){
for(i = 0; i<11; i++){

[code].....

View 7 Replies

ActionScript 3.0 :: Changing Simple Button Color?

Sep 23, 2008

I have a map of the US. Each U.S. state is a simple button.I'd like to change the button fill color (and potentially, theoutline color) in AS3. I've created the buttons in Flash,not inS3 (just graphically). How do I change the button fill color?Sample code:

function addButtonListeners(btnInstance:SimpleButton) {
btnInstance.addEventListener( MouseEvent.ROLL_OVER,
handleRollover);

[code].....

View 7 Replies

ActionScript 3.0 :: Changing Stroke Color Of Simple Button?

Oct 3, 2008

How do you change the stroke color of a simple button? I have 50 simple buttons representing the 50 U.S. states. When I change the fill color with the following algorithm, I also eradicate the outline (stroke) color. How do I code in a stroke color?

View 1 Replies

Professional :: Button Color Not Changing In State Edit

Apr 3, 2012

I'm learning how to use flash CS5.5 and i'm unable to continue a lesson because my button editing seems to not work properly. -When i double click or right click and click edit on my button I go into the symbol edit screen, where i can see the basic button states "Up, Over, Down, & Hit" but when I try to change the appearence of the button in each state the color and any sort of editing done to it does not happen, it is red in the "up" keyframe and when i try to change it to gray in the "over" keyframe it stays red.

-I found that double clicking the button in the edit screen goes into another edit screen labled "symbol 1" and in there i can change the color of the button, but any edits in that screen remain ineffectuall to the actuall button on the main screen. I don't know what is wrong with it, or if I am missing something, i've tried in both action script 2 and 3 and both have the same results.

View 2 Replies

ActionScript 2.0 :: Changing Bg Color In Html From A Flash Button

Sep 5, 2011

I have two flash pages, one black and one green, and I need the html background color to change accordingly. What I think I need to do is code the button to change the b/g color.

I've been following this tutorial so far: [URL]

but for some reason it's not working.

It might be a securities issue, it opens up the page asking me if I want to run the JS. When I click 'yes' it opens up the page but the background color is the same. So while it opens the page it might not be running the script?

or, I'm not putting the JS in the right area of the html code. Right now I'm putting it after the first <head>.

Is java script my only option? a friend mentioned using css, but I have nothing to go off of as to how to make that work.

View 3 Replies

ActionScript 2.0 :: [F8] Changing Text Color In Input Txtbox With A Button?

Nov 20, 2007

I know a few things...draging stuff...play buttons...the basics...But I need to know how to make a button be able to change the color and text style in an input textbox...I've tried various things, but I always got 2+ errors...it's annoying.

View 5 Replies

ActionScript 3.0 :: Flash Changing A Button's Color Via A Mouse Click?

Jun 8, 2011

I'm trying to learn a simple way to code a button's color to change when you click on the button itself. I got the button's alpha to work by doing the following: Create a text field with the word "Preflight" and convert it to a button. Drag the button onto the stage and give it an instance name of "Preflight1". On the first frame of the timeline, insert the following code:

import flash.events.MouseEvent;
import flash.geom.ColorTransform;
Preflight1.addEventListener(MouseEvent.CLICK, Preflight1Click);

[Code].....

Now when you test the movie, anytime you click the button "Preflight" the button's alpha drops (dims) by 10%. Works perfect and easy. Now, how can I do this exact same thing with the button's color? When you click the button, its color changes to some new color? I've tried colorTransform, but no luck.

View 6 Replies

ActionScript 2.0 :: Changing Color Objects - Stay The Same Color That User Selected After Going To Another Scene?

Aug 5, 2004

i'm doing a school project of mine and i am having trouble doing the changing color objects. here is an axample of the script that i;m using:

on (rollOver) {
var colorful = new Color("_root.shapes");
colorful.setRGB(0x003366);
}

For this script it does change color, but how do i make it to stay the same color that user selected after going to another scene?

View 2 Replies

Flex :: Changing The Background Color And Border Color On Selection On A Tilelist?

Apr 23, 2010

I am using a tilelist I want to change the border color and the background color of the tile on selection.

View 1 Replies

ActionScript 2.0 :: Changing Lots Of Movieclips Color And Border Color Separately?

Dec 23, 2008

I am in the making of a isometric level editor, and I have about 15 movie clips with more to come. I want to let people change the color of tiles to what they want from a list of colors, so how can I let them change the color of a tile dinamicly with actionscript so that it changes a tile's color while preserving changes of "shadows"? I mean I have let's say a cube and to make it look 3D I need to change each face to make a feeling of 3D and not a flat one.

View 1 Replies

ActionScript 2.0 :: Interactive Coloring Book - Large Blank Box At The Top Of The Color Pallet Isnt Changing Color?

Apr 27, 2009

i have been doing this tutorial http:[url]..but i am stuck on PART 8, i have done everything the tutorial has said so far (although my image and the colors used are different) but the large blank box at the top of the color pallet isnt changing color when i click on any color from the pallet.

Also this tutorial doesnt say what version of flash and actionscript is best suited for this.Currently i am using CS4 & Action Script 2.0 but i don't know if this is correct. below there is a link to the fla. file that Coloring_Book.fla.

View 1 Replies

ActionScript 2.0 :: Way To Change The Color Of An Object WITHOUT Changing The Color Of A Glow?

Sep 22, 2011

I have a few movie clips that change color when they are rolled over and rolled out of which is great and works correctly but now I have add glows to those buttons to serve as borders or a stroke and when you roll over the buttons the color and the filter color changes.

View 3 Replies

ActionScript 2.0 :: Dynamic Changing Movieclip Color And Text Color?

Jul 28, 2009

I have a movie clip where it contains an instance of text

I able to change the movie clip and text color individually

but when i try to change both at once the text color is same as movie clip color

ActionScript Code:
myColor = new Color(myMovieClip);
myTextColor= new Color(myMovieClip.myText);

[Code].....

View 3 Replies

ActionScript 3.0 :: Changing Text Color & HTML Background Color

Jun 18, 2009

So i'm working on this website and I want to be able to switch out the entire color scheme on the website everytime a button is pressed, I've stepped away from flash for awhile and actionscript 3 is new me. Plus I haven't quite found any truely useful stuff on forums yet.
 
What i can't figure out is when a button is pressed the HTML background color changes to one of 5 preselected colors (that alternate ever time the button is pressed). Then for each background change the text changes too as it is part of a entire new color scheme.
 
What I've managed so far is to change the color of the background thats within the Flash file. What i did was to make a movie clip that plays to a next frame and stop everytime the button is pressed. Now i just need to also get to change the HTML color and the font colors.
 
//"homeText" being the name of dynamic text field and "Button" the name of the button and "background" being the movie clip that is the background within the flash file.
  
Button.addEventListener(MouseEvent.CLICK, Button_CLICK);
function Button_CLICK(e:MouseEvent):void{
background.play();    homeText.TextFormat(color "0x000000");}
  
I'm not sure if my code is just sloppy or if i'm completely going the wrong route here.

View 1 Replies

ActionScript 1/2 :: Changing The Color Of MC Changes The Color Of The Text?

Dec 16, 2009

My buttonMC is build of:

1. shape (a rectangle gray color) converted to MC named = Bar

2. (on top of 1) DynamicText named = buttonText converted to MC named = buttText in order to change the color of the shape I decleard a veriable
 
cButton = new Color(this.Bar);
 
I then add actionscript onRollOver
 
cButton.setRGB(nRed << 16 | nGreen << 8 | nBlue);
 
but it also changed the color of the text so I added a veriable for the text field
 
tButton = new Color(this.buttText.buttonText);
tButton.setRGB(0xFFFFFF);but that didnt help

this is bad becuse the text on the screen is unseen.

View 5 Replies

ActionScript 3.0 :: Detect Wheather The Button Is Clicked Or Not And Disable It If Clicked?

Jun 9, 2010

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.

View 6 Replies

ActionScript 2.0 :: Buttons To Stay Orange Once Clicked And Only Roll Out Back To Grey When The User Has Clicked On Another Button In The List

Feb 7, 2007

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?

View 2 Replies

Changing The Look Of A Submit_mc When Clicked?

Sep 5, 2009

I have created a basic movie clip form:

Email
Name
Message
Submit
 
All is working exactly as it should but when you click on the submit_mc it's look remains the same whether the mouse is up, down or over. It works and sends the email to the named email address but if I was a new user to this form - I would probably click and click and click - not knowing if the message actually went as we are all use to seeing the button area change shape and color when clicked (looks like you are depressing the button)

I can skin the submit_mc but that only changes it's color/shape, it does not change up, down or over interaction with the mouse.

View 3 Replies

ActionScript 3.0 :: Get A Movieclip Fill Color To Change Once Clicked

May 23, 2009

I'm trying to get a movieclip fill color to change once clicked. I'm able to get the mouseover and mouseout working. But the click state isn't working properly.

Here's my code:

Code:

my_mc.addEventListener(MouseEvent.MOUSE_OVER, onFolderOver, false, 0, true);
my_mc.addEventListener(MouseEvent.MOUSE_OUT, onFolderOut, false, 0, true);
my_mc.addEventListener(MouseEvent.CLICK, showMovieclip, false, 0, true);

[code]....

When I use the above code, nothing happens once clicked. I tried using the color property, but, although that made a color change (black), it wasn't the color I had indicated (white).What I have is a movieclip ("my_mc"). Inside the movieclip are other movieclips. When one is clicked, only that movieclip ("my_mc.movieclip01"), is highlighted.

View 1 Replies

ActionScript 3.0 :: Buttons Fading From Color To B&W And Staying Down After Clicked?

Apr 1, 2010

I have an image that I want to make into a button/movie clip that starts out color then fades into black and white (that has text on top when it fades into black and white) when its clicked, and stays that way.....how can I achieve this?[URL]His is reversed from B&W to color, and stays in color after it clicks. I want something like that but B&W when its clicked instead (with text on top)

View 6 Replies

ActionScript 2.0 :: Nav Button States - Button To Stay In It's Active State Until Another Button Is Clicked

Dec 17, 2004

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:

[Code]...

View 2 Replies

ActionScript 3.0 :: Color Picker Affects Only Objects With A Certain Name + Only When Double Clicked?

Apr 14, 2011

ActionScript Code:
import fl.controls.ColorPicker;
import fl.events.ColorPickerEvent;
import flash.geom.ColorTransform;

[code]....

I was going to use this code and modify it to work with the previous code.

ActionScript Code:
var OBJECTcolorInfo:ColorTransform = OBJECT.transform.colorTransform;
cpOBJECT.addEventListener(ColorPickerEvent.CHANGE, colorChange);

[code]....

A quick note, the OBJECT is there to show it's supposed to refer back to the "["bg"+String(i)]" bit is. I just don't know how to tell the code to look for it.My main goal is to have an object, for instance a rectangle, be draggable (and placeable). You would then set a series of color pickers to said rectangle, changing areas of it's colors once you double click it.However, the rectangle must move as a whole and not have to have each individual color part be repositioned along with it.

View 1 Replies

ActionScript 3.0 :: Flash Click On Color Button And Write In Textarea With That Color Font?

Oct 6, 2010

I want to do as follows: * click a "red" button write in textarea with red color font click "blue" button
* write in textarea with blue color font Isn't this possible in flash 10 using AS3 I tried using setTextFormat but the problem is i have to have text before inserting format on that.

View 14 Replies

ActionScript 3.0 :: Click On Color Button And Write In Textarea With That Color Font

Oct 6, 2010

click a "red" button write in textarea with red color fontclick "blue" buttonwrite in textarea with blue color font  Isn't this possible in flash 10 using AS3 ? I tried using setTextFormat but the problem is i have to have text before inserting format on that.

View 20 Replies

ActionScript 2.0 :: Script An Animated Button Of A Square (no Fill) Where On Rollover The Stroke Color Changes From One Color To Another

Jun 16, 2003

Hoping someone can point me in the right direction with this. Instead of creating a button and nesting movie clips for each state, I'm trying to script an animated button of a square (no fill) where on rollover the stroke color changes from one color to another (tweening the tint). I want to do this to the button symbol so it's the same for all instances. Is this possible or do I have to go the button > nested MC route? Sorry if this is lame...it's been awhile since I've used Flash and I've forgotten quite a bit.

View 7 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved