Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




An Alpha Button PROBLEM ...



Hi...

I want to do an tint button ( ex )
I have done a trasparent button for support only ( btn ) and an movie (anm ) with two tweens of tint:
Stop Stop gotoAndStop 1
1 red 0%------>10 red 100%-------> 20 red 0%

the AS3 is :
btn.onRollOver = function(){
anm.gotoAndPlay("1");
}
btn.onRollOut = function(){
anm.gotoAndPlay("10");
}
btn.onRelease = function(){
anm.gotoAndStop("10");
}

it works quite well ( the AS3 has no errors ) but it stucks when i double click on it after ( release ) it passes from red to white and viceversa from white to red without tweening ...
can you help me ... i want to make it regular ...

thanks in advance

A



FlashKit > Flash Help > Flash Newbies
Posted on: 06-16-2008, 04:52 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

How Can I Make A Button Go From Alpha 0 To Alpha 100
i wanna create a rollover button

i made the before and after pngs in PS
and i want to put the image that will appear over the original image with an alpha of 0 and when i roll over it the alpha to turn to 100 so it looks like the fade in


how do i change a graphic alpha ?

how can i do this please help

Alpha With Button.
This might seem like a n00b question, but, is it possible to change the alpha of an object with a button? what would the script look like? Thank you

Button Alpha=0 Help
Ok, I've asked this before I got a good answer but it's still not working....

What I want to do is turn a button invisible or non-clickable after it is selected and goes to antoher frame.

What I have now is this on a button:

on(release){
gotoandstop(50)
}

on(release){
bluebutton._alpha = 0
}


it goes to the next page and I have another button that just sends it back to the first frame. But the button still shows up. Anyone know how to get it to 0 when it comes back to the frame?

Thanks.

Button Alpha
I have a simple white button. I would like to do this. While on rollover the buttons alpha increases incrementally to 100, on rollout, incrementally decrease back to a set value, unfortunetly my brain isn't working. Can anyone help?

Thx

Setting Alpha With A Button
Ok, I have a button within a menu.

When you rollOver the button I want to change the alpha amount on a movie clip that is on the root timeline

I have the movie clip that I want to change the alpha on set with instance name AlphaChanger

Here is the existing code for the button

on (rollOver) {
play();
}
on (rollOut) {
gotoAndStop("Start");
}
on (release) {
getURL("page2.html");
}

Can you help me fill in the blanks.

Thanks
Rick

Using A Button To Change Alpha
How can I make a button so that when the mouse rolls over it, the alpha of a different symbol changes?

Is this possible?


Any help would be greatly appreciated.

Alpha 0% To A Button.. In One Frame :s
Hello people.

Well, I have a small problem with three buttons whose functionality depends on the on (press) and on (release) actions.

My buttons are snaped (startDrag) when the user clicks on them, but I need them to go from Alpha 100% to Alpha 0% just when they release them.

Anyway you can help me here?

Thank you very much.

Button.alpha... Is There An Alternative?
I just wish to make my buttons invisible upon certain actions.

for example if i clicked on button A, I want to hide Button B..

I normally would do this..

buttonA.onRelease = function() {
buttonB._alpha = 0;
}

I know alpha can kill system performance if the flash movie relies heavily upon it. Is there an alternative? I just want to hide my button's visibility, not its functionality.

Alpha Fading Button
I've made a button to use in flash, what I'm after now is some AS to make it slowly fade in and out of trasnparency.

I've got some of the code but its the part that tells flash when to fade in and when to fade out that eludes me. This is what I have so far, if its wrong please let me know.


Code:
button_1.onRollOver = function()
button_1._alpha
And thats where I become stuck, any ideas?

Control Alpha Of Mc With Button
I have a movie clip on my stage, in the first frame of the movie I set the alpha of the mc to 0,

this.mymovieclip._alpha=0;

Now when I hit a button I want the movie clip to go from 0 alpha to 90.

Can someone advise.

Thanks

mr mooch

Button: OnMouseOut Alpha Goes 0 How ?
Hi
I have a button and in the Over section I have a movieclip. All I want is that when the user scrolls out of the hit area of the button that movieclip goes alpha=0.
Thanks.

Changing Alpha To Zero With A Button?
hey,

I want to program a button so that when it is clicked, a movieclip on the timeline (call it 'my_clip') fades to 0% alpha. Any suggestions on how I can accomplish this?

cheers,
jen

Would LOVE Some Help With This Alpha Button
Hi,

I'm using the following code to fade a movie clip in and out. It works great. My only problem is that I need to set the MC to alpha=0 when the movie loads so the end user doesn't see the target until hi or she rolls over the button. Then it fades in.

Anyone help me with this one bit of code? Cheers!


Code:
but.onRollOver=function(){
_root.mc2.onEnterFrame=function(){
if(this._alpha<100){
this._alpha+=5;
}else{
this.onEnterFrame=null;
}
}
}
but.onRollOut=function(){
_root.mc2.onEnterFrame=function(){
if(this._alpha>0){
this._alpha-=5;
}else{
this.onEnterFrame=null;
}
}
}

Button Alpha, Help Please, Confused
Ok i'm trying to set it up so that when u roll over this button the alpha goes from 50 to 100, and when you're not over it it goes back to 50. I don't know how to specify the button though, I'm confused with the whole mybutton thing. The name of my buttonis "P", so can someone give me an example of what to do using P as the button name?

Changing Alpha On Button
Hi everyone! I'm new to flash cs3 and currently working in it. What I am trying to do is create a button that when rolled over the alpha=0 and when rolled off it goes back to 77%. I'm facing two problems. The first is that in as3 I am not sure where to place the alpha statement. Second, I'm getting this error
quote:1119: Access of possibly undefined property OVER through a reference with static type Class.







Attach Code

import flash.events.MouseEvent;

this.stop();

function monopolyover(event:MouseEvent):void {
monopolyplay.alpha = .0;
}

monopolyplay.addEventListener(MouseEvent.OVER, monopolyover);

Button Alpha 0% But Still Showing?
Hello,
I've made a button's alpha 0% but when I test it there is a light white transparency instead of being totally blended in. Does anyone know what I have to do to fix this?

Changing my background or button color does nothing to fix it.

Thank you for your help!
-Dr.

Controlling An Button's Alpha With If/else
I have an emptyMovieClip and a button on my stage. I'd like to control the alpha of the button depending on whether a movieclip is loaded into the emptyMovieClip or not. I'm just a beginner at Flash and have little programming experience.

if a movie is loaded in the emptyMovieClip, button alpha = 100%

else button alpha = 0%

I know. It's a sorry attempt . . .

Can someone help?

Toggling MC Alpha With A Button
Hey all, I'm trying to have one button turn an mc's alpha from 0 to 100, then next press from 100 to 0 but since I am new to action scripting, I am kinda just hit and miss with things.

I have this part done...

on (press) {
if ("mc-instructions",_alpha, "0") {
setProperty("mc-instructions", _alpha, "100");
}
}

Which obviously makes the alpho 0 mc appear, but when it comes to the same button going away, I am at a loss. I would assume some sort of 'if' statement, but, as an actionscript hack... I am not all that familiar with them.

Thanks

Button Alpha 0% But Still Showing?
Hello,
I've made a button's alpha 0% but when I test it there is a light white transparency instead of being totally blended in. Does anyone know what I have to do to fix this?

Changing my background or button color does nothing to fix it.

Thank you for your help!
-Dr.

Using A Button To Change Alpha
How can I make a button so that when the mouse rolls over it, the alpha of a different symbol changes?

Is this possible?


Any help would be greatly appreciated.

[button] Disable / Alpha
Hi,
I would like to know how to disable a button when clicked on then have the button go to 50%alpha. I know it's probably simple AS but could someone give me a hint on how to accomplish this. Thank you...

Button Alpha 0% But Still Showing?
Hello,
I've made a button's alpha 0% but when I test it there is a light white transparency instead of being totally invisible. Does anyone know what I have to do to fix this?

Thank you for your help!
-Dr.

Control An Instance Alpha With Button?
All I want to do is simple turn the alpha of a clip instance from 100 to 0 and back with a single button.

HELP!!!!!!!!!

Carter

Changing Alpha With Push Of A Button
here's a story of a movie with a button that when pushed, it needs to get another button to change its alpha to zero. i.e. when a button is pushed, it makes other buttons phase out. any idea how? tried using instances by changing the buttons to movies, but it seems like there would be an easier way.
HELP!!!

thanks in advance for the replies!

- nick

A Minor Alpha/button Problem
i have a minor problem i can't seem to get right..
please take a look at http://www.perkinsphotography.net

check any of the picture sections (children, family, etc).
I'd like to make the buttons for prev. and next gray out when the reach the last picture for that section.
The pictures are dynamically loaded. The buttons pull the next picture, "photo" + i + ".jpg", and increment or decrement the value of i depending on the button.

For example, the children section has 4 photos. THe value of i is set to 1 when the placeholder clip loads in, and photo1.jpg is automatically loaded. I'd like the prev. button to be gray an unclickable if i=1. as soon as i>1, then the button should be clickable and full alpha. The same to the next button, provided that i=4, etc...

i have tried a simple if-then statement, and it worked for the first section, being if i=1, but after the other button got clicked, the alpha never changed...

i realize i'm getting long winded here, so if you wanna see an FLA file (this is not the most recent, but i'm at work right now and can't upload the current one), try this link:

http://www.perkinsphotography.net/FL...erkinsSite.fla

thanks,
-myk

Alpha Change With A Button But Smooth...... How?
hi all,

i'll make it short... i have a _root.someMC...

i want my MC change its alpha value for example from 30 to 50... the problem is i can manage to do it but of course it changes from 30 to 50 quickly without a transition...

ok. what code, variable should i write or add to my 1st frame of the movie to make this fx smooth or in other words depending on a time interval??

my actions and variables are located at the 1st frame of my main timeline and of course a couple of codes attached to triggering button...

and i wrote a code but it just executes when i play the movie because its an onEventHandler... i want that fx to e controlled by the button statement...

My first trial was lookin like that one below...


mcAlpha = 2;
this.onEnterFrame = ChangeAlpha;
function ChangeAlpha() {
square._alpha += mcAlpha;
}


i hope my question and aim is clear...

thnx to all...

Alpha Button After Mouse Rollout.
I want my buttons to alpha in and out when you roll over them but I dont want them to stop one the mouse has rolled out. An exaple ishere at the top below where it says music box.Thank you for the help.

Change Alpha Of A Mc By Clicking A Button
Hi, How do you go about changing a MC's alpha by pressing a button i.e. form 0 to 100?

Alpha Movie On Button Rollover
I want users to click on a button in my flash movie which makes everything but the contents of the button go alpha 40%.
When the user rolls off the button the movie comes back full alpha.
Any advice, tutes, or actionscript?

Alpha Movie On Button Rollover
I want users to click on a button in my flash movie which makes everything but the contents of the button go alpha 40%.
When the user rolls off the button the movie comes back full alpha.
Any advice, tutes, or actionscript?
Using Flash MX Pro 2004

Reversible Scale+alpha On A Button
Hi again,

OK, I'm trying to script a button that does the following:

on rollover:
Rectangle scales from 0 to 188px, starting on the right, ending on the left
Rectangle alpha value goes from 0 to 100 as scale animation plays

on rollout
Both scale and alpha go in reverse (scale 188 to 0 and alpha 100 to 0)

How would I accomplish that?

Thanks!

Button To Control AS Alpha Tween
http://www.minoflow.com/

Hi,

Just a quick question. The links on the site above have a nice alpha tween effect. It looks like the rollover fades out the alpha so that the links appear brighter. When you rollout the alpha reduces.

What would be the best/most logical way to do this? I presume you create some AS that contols the alpha tween and keep this on the timeline as a function. Then for each button you call the function.

I'm a bit new to this so am just looking for some guidance before i go wrong! any tutorials you know of would be great.

cheers

How: Button Alpha Determined By Y-position?
i have 5 btns above each other (all visible), which will slide into position with some actionscripting.
when on position they should be 100%visible.
lower or higher makes their Up state more and more transparent.

should be easy, but i just don't know how?
what I tried is making a movie with the button in it and the movie has this script:
onClipEvent (enterFrame) {
if (this._y>100) {
this._alpha = 50%;
}
}
but that doesn't work, maybe it's a real newbie way to try this
thanks in advance for any help!

pock

[MX04] Button Alpha Question
Hey guys,

Any idea how to change the alpha of a button (a photo) so it is 100% in an 'up' instance but changes to 50% alpha in 'over' instance of a button in Flash MX 2004?

Thanks so much.

Alpha Tween Graphic Within Button?
I have a map of the US, when the movie loads and you click on hub locations, it loads the us map with each US city as a button on the map. Im trying to get it so that once you rollover each city it fades in a small text box(rectangle with text within it) which would be a graphic, then when you rollOut, it goes back to the start of the map.

What I was trying to do was create a graphic within a button(the city) and then do an alpha tween starting at the over state keyframe of the button to fade in the text box, but that didn't seem to work?

Any help would be appreciated.

Change Alpha Of Button On The Stage...
I have a button on the stage called infoButton. In the button is a some text which says info. The button has linkage set to export for actrionscript.

I want to change the alpha of the button when it is pressed. I am using...


PHP Code:



infoButton.onPress=function(){
infoButton._alpha=50
}; 




This isn't working. Any ideas? If I change it to _visible this works but i don't want it to completely disappear.

Thanks

Set Object Alpha On Button Click
Hey all.
Sorry if this seems like a newbie question, but I only have done flash in school, and this problem is really bugging me, and no one can seem to figure it out.

I'm trying to set the alpha of a button, after I press THAT button.

I have tried a lot of things, even with script assist I can't figure it out.

How would I go about doing this?

I have tried:

Code:
on (release) {
set(objectName._alpha, 0)
}

Code:
on (release) {
objectname._alpha = 0
}
Neither seem to work

Button Click Behind Video W/ Alpha
I have a rather large video (flv) with alpha of someone walking around, however under the video are buttons thats cannot be clicked because the video is on top. I can't really but hidden buttons on top to trigger the buttons below, as the rollovers etc. won't fire.
Any thoughts on how to access the buttons?

Thanks,

Alpha Movie On Button Rollover
I want users to click on a button in my flash movie which makes everything but the contents of the button go alpha 40%.
When the user rolls off the button the movie comes back full alpha.
Any advice, tutes, or actionscript?
Using Flash MX Pro 2004

Wrong Button & Alpha Shadow
1)On the FLA, when i go over the buttons, there must play a movie clip (a button effect), but when i go over them, that animation sometimes plays at the true position, sometimes behind the menu. It must play between menu and the buttons.
A bit confusing? Have a look at the FLA. How can i solve it?

FLA

2)I lowered an objects alpha and put another object onto that object. Second object's shadow falls on the 1st one. How can i solve it?

Button Alpha To Correspond With Images
Hi,
I'm very new to actionscript and would be eternally grateful for some help. I'm creating a portfolio which has tiny square buttons (one for each image) and arrows buttons to navigate through the portfolio. Everything is working just great, but I need the square buttons, when pushed, to change alpha or turn to dk grey instead of lt grey, and remain this way until the next image is shown. They should act as indicators as to where you are in the portfolio. The code I'm using is as follows:

picture._x=24;
picture._y=31;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images5.xml");
/////////////////////////////////////

p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
button1.onPress = function() {
if (p=0) {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
};


Please let me know if anyone has any suggestions for how to go about finishing this script (if (p=0) {button1._alpha = 100} else???).

P.S. the arrow buttons should also activate which square button changes state.
Thanks so much!!!

Wrong Button & Alpha Shadow
1)On the FLA, when i go over the buttons, there must play a movie clip (a button effect), but when i go over them, that animation sometimes plays at the true position, sometimes behind the menu. It must play between menu and the buttons.
A bit confusing? Have a look at the FLA. How can i solve it?

FLA

2)I lowered an objects alpha and put another object onto that object. Second object's shadow falls on the 1st one. How can i solve it?

Button Bar With Alpha Fading Buttons
Hello,

I am relatively new to flash, but I know how to tween (motion and shape), operate on symbols to change their appearance, and I know a little about how to make simple buttons. What I am wanting to know, however, is how one would go about making a button bar, or navigational bar with the following characteristics:

1. When one button is "rolled-over" the others should fade to 0 alpha
2. The button "rolled-over" would then move to the center of the button bar.

Can someone explain in detail how I would go about accomplishing this? Please help, I am having no luck searching online for a solution to this issue.

Many thanks,

Dan

Button Alpha Fade With Actionscript?
In a recent thread, someone posted the following nice piece of code, which is a function and then an example usage of that function. However, it does not seem to work when the (clip) in question is a button and not a movie clip.

Can this code be modified to work with buttons? When I try to use it with buttons, the _alpha = 0 line works but the increment function fails. I'm guessing it has something to do with the fact that the function starts with the "MovieClip" class. I tried the word "Button" instead, but no luck. Thanks for any help for a beginner actionscripter.

MovieClip.prototype.Increment = function(maxAlpha, speed) {
this.onEnterFrame = function() {
this._alpha += speed;
if (this._alpha>=maxAlpha) {
this._alpha = maxAlpha;
delete this.onEnterFrame;
}
};
};
with (clip) {
_alpha = 0;
Increment(100, 2);
}

Creating An Alpha Effect On A Button..am I Missing Something?
For some odd reason when I apply an alpha of say 30% on a button that only consists of text, it does not seem to take effect in preview mode even though it shows up while editing the movie? Is there a step I'm missing??

Thanks.

++ Setting Alpha Level W/ A Button State ?
Hi, I wanted to change the alpha level of a movie w/ a button, when the button is in a mouse over state, I want to change the transparency level of a movie say to 90% and then at the same time change another movie to 80% and 70% etc, to achieve this cool fade effect that Im after. Ive never used AS to change the transparency, usually I would just set the movie up w/ different fill levels and have the button target a frame w/ the fill level, but thats pretty amateur! So how would I go about this, I assume its fairly easy-
thanks for any help-
Justin

Changing The Alpha Of A Property When Clicking A Button
I have this code in AS 3.0:

stop();
myBtn.buttonMode = true;
myText_mc.alpha = 0;

myBtn.addEventListener(MouseEvent.CLICK, ClickFunction);
function ClickFunction(event:MouseEvent):void{
myText_mc.alpha = 1;
}

I want the alpha of the movieclip called myText_mc to start at 0 (not seen) and then appear when clicked...it does not work, what did I do wrong?

Thanks

Button Alpha Change On Text Event
Hi:
im a newbie so bare with me a little please.
im not that new to Flash but i am used to make simple videos or games even web pages but this time i've got a harder task on my hands

im on flash CS3 using AS2
im working on a project that at the end has a little test
that text is sent to the manager of the person doing it... i had no trouble with that.
but in order to be able to go to the next screen the user MUST enter at least some text on the input text... the easiest way i thought of was to change the "next" button alpha to "0" and change it to 100 when the user writes something...

but i have no idea how to do this... i saw there are commands like onChange etc. but i have no idea how to use them

basicaly i need to change the buttons alpha from "0" to "100" when a user writes something on the text field called "TEXT1" the button is called "Nextbut"
Thanks in advance for your help i really appreciate it!

Radio Button Changing Label Or MC Alpha
Hi folks,
Im having a Radio Button issue.

I have a form with 3 separate groups of buttons that function fine, but what I need to do is once these buttons are selected a submit button is clicked and the movie goes to another frame and the choices that are selected have their labels go to a 50% alpha state (just the labels). I tried doing this in a separate mc and it didnt seem to work.

Any suggestions/solutions?

Thanks,
Michael

Copyright © 2005-08 www.BigResource.com, All rights reserved