ActionScript 2.0 :: Change Alpha Of Movieclip On Button Click?
Feb 18, 2011I am unable to change alpha of movieclip on button click using as2.[code]...
View 1 RepliesI am unable to change alpha of movieclip on button click using as2.[code]...
View 1 Repliesi am developing one small imteractive game.in that i'm getting one difficulty.Difficulty is: i want to play a moviclip whenever i 'll click on button ,and .For that i hav applied logic in following way.
function onMouseClick(event:MouseEvent):void
{
this.alpha=0; (alpha of 1st movieclip will 0 )
[code]......
i am developing one small imteractive game.in that i'm getting one difficulty.Difficulty is: i want to play a moviclip whenever i 'll click on button ,and .For that i hav applied logic in following way.[code]whenever i'am clciking on first movieclip(btn), it definitly goes to 0(i.e off), but 2nd movieclip(instance name "alpha") is not coming to 1.
View 3 Repliesi was making asimple menu .
ActionScript Code:
var currentLink:MovieClip = a_mc;
//buttons mode[code]...........
when i click on the button the alpha of this button will be 0.5 , when i click on another button the alpha of the previous button is still 0.5 , and so if i clicked on all buttons the alpha of all buttons will be 0.5,,,i didn't want that , i want when i click on the button , alpha return to 1 for the previous button .
Basically, I want to change the alpha value on my movieclip. I start my mc with an alpha of .08 (8%).
mc.alpha = .08;
What I then want to do is increment it to .9 (90%) and when it hits that, decrement it back to .08, and then when it hits that, increment it again to .9 etc.
I have tried
if(mc.alpha==.9){
mc.alpha -= .01;
}else{
mc.alpha += .01;
}
Ok. I am new again so I hope I am describing this correctly. I don't know the best way to do this but this is what I've dreamed up so far: I have a number of movie clips on my screen, all thumbnail sized images, each with an instance name (ex: tw_lifeoftheparty, tw_xmen, tw_xfiles, tw_diehard, etc.).
In each movieclip there are 2 layers: the thumbnail image(bottom layer) and a black border(top layer). The black border is an object named wk_border and isin each of the thumbnail movieclips.
I have given wk_border the same instance name in each thumbnail movieclip "border"
[Code]...
How can i change the alpha value of a movieclip through actionscript?
View 1 RepliesI've been trying to change an MCs alpha with actionscipt. the movies FPS is 30. Here's the as:
onClipEvent(load) {
var alpha = blue._alpha;
alpha = 50;
var forwardA = true;
var changeA = true;
[Code] .....
Btw, "blue" is the MC that I want to change the alpha of, and this code is on that MC.
I want to make a button to change the alpha of an instance but I dont know how to make it.
Thats what I want: When I click the button, then the movie clip appears (alpha 100)When I click the button again, then the movie clip disappears (alpha 0)
I am making a website/online gallery. I have all my buttons assigning a frame number or value eg. [code]...
and then have all different movie clips loading depending on the the 'frameno'
My problem is that i want the button alpha to change when you are on that page. So i am assuming it would be something along the lines of.[code]...
I have an .5 alpha layer that I want to fade out when any 1 of 5 buttons is clicked.
1) The alpha layer is on the screen, but its not at 50%, its solid
2) Its not fading when a button is clicked
3) Its not in the right position
4) I am getting an output error message that says:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::MovieClip@3f7e34c1 to colorbars.
at flash.display::MovieClip/gotoAndPlay()
at Colorwheel/goColor()[Colorwheel::frame1:17] (
This code is telling the int_btn to go to the alpha layer frame, which continues thru frames 1 and 8) the code they are referring to is on frame 1 with a button that is also on frame 8 that I don't want the mouse up function to affect the alpha layer. The 4 other buttons on frame 8 should affect the alpha layer. The code on frame 8 tells the mouse up function to fade out the alpha layer:
var colorscreen:colorbars = new colorbars;addChild(colorscreen) //this is working its the alpha layer mccolorscreen.x = 0;
//this is not workingcolorscreen.y = 51;
colorscreen.height = 513;colorscreen.width = 612;colorscreen.alpha = .5; //not working
// all buttons below work but wont fadeout the alpha layer
[Code] .....
How do I tell it not to listen to the int_btn on mouse up? Should I be using an array or enter_frame or remove event listener or use all three to achieve my goal of fading out the alpha layer when any of the 4 btns are clicked?
I have a MovieClip with white background and would like to change it's Background color and alpha settings at runtime. How can I?
View 1 RepliesWhen I mouse over a movieclip, I want its alpha level to change. Here's what I have:
ActionScript Code:
object.addEventListener(MouseEvent.MOUSE_OVER, mouseOverObject);
object.addEventListener(MouseEvent.MOUSE_OUT, mouseOutObject);
function mouseOverObject(e:MouseEvent){
if(!inventoryOpen){ e.currentTarget.alpha = 100; }
} function mouseOutObject(e:MouseEvent){
if(!inventoryOpen){ e.currentTarget.alpha = 50; }
}
It does work, but the mouseover only registers when the cursor is over certain areas of the movieclip.
I'm creating pages with text supported by wav files for training. on the bottom of the page is a progress bar. I want to make a button that when clicked will permenantly
raise the alpha of a movie clip (on a different layer) to 100%. (it is currently set to 0) within the movie clip (hazpop) is a button that will turn the alpha to zero (click to close window) so in theory (not as2) it should be: on mousedown alpha.hazpop=100 I've been combing the forums for days and no-one is talking about alpha.
I am trying to change the alpha property of a button using actionscript 3.I dont want to create external AS file. Can you guide me on this?
Code:
circle_mc.addEventListener(MouseEvent.CLICK, clickHandler);
function clickHandler(event:MouseEvent):void {
[code]........
I have 3 movieclips on a stage, all being instances of a square (mc_square01, mc_square02, mc_square03).What I want to do is on every reload to have a random movieclip to be the 'correct answer' - and this is the bit I'm struggling with.The way i'm testing this out is just to change the alpha of a movieclip on the stage.Here's my code....
var myArray:Array = [mc_square01, mc_square02, mc_square03];
mc_square01.addEventListener(MouseEvent.MOUSE_OVER , chooseMe);
mc_square02.addEventListener(MouseEvent.MOUSE_OVER , chooseMe);[code]....
I am having problem making classes to communicate. I have main class which loads external swf that contains one image at this time. I want to change alpha for that image using button (created from library) from main swf. Don't know how, various methods I tried gave various error messages.
View 5 RepliesI am building a flash interface and I would like a menu where it is hidden to begin with (just a tab). You click the tab to expand it, and click again to collapse it. I've made a movieclip with animation of the menu opening up and closing, but I can't seem to work out how I'd go about making the movieclip open and close properly.
View 4 RepliesIf I have say 7 buttons, each containing text that changes color on rollover using the "Up" "Over" and "Down" keyframes in the buttons' timeline. Is there a simple way to get the button's text to change color when clicked, stay that way, and then change back to the original color once one of the other 6 buttons are clicked?
The only thing I can come up with is writing pages of code for each button that changes the color of every other button regardless of whether it was active.
I want to design a music button for a game like geochallenge
View 1 Repliesby the way you need to make a symbol and need to export for ActionScript and class name is "ball". And the button instant name is:bButton. So here's the script I wrote so far.
var boundaryRight:Number = stage.stageWidth;
var boundaryLeft:Number = 0;
var balls:Array;[code]....
As you can see that code made the multiple ball go to left and looping over and over again. So here's what I want to do. I want to make a button and when I click the button it'll change direction like click and it change direction to right. I click it again and it'll go left again. How do I write the code for that?
can someone give me an idea how I would use a function to enlarge and change the alpha of a button but make it span over a period of time like it was an animation.a long time ago on gear78.com I think he used functions to make his buttons do what they did and it was badass. if I find another site I will post a link. if you don't know what the heck I am talking about tell me and I will try and explain it more.
View 2 RepliesI'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:
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.
[URL] i want the object to fade out but in the object there's a lot of overlapping pictures and each becomes half transparent. how to make the movieclip to change the alpha as it was without objects?
[Code]....
How can i resize my stage or embedded swf by a button click event? My Code is not working and my stage is not resizing.
var mcStage:Stage; mcStage.scaleMode = StageScaleMode.EXACT_FIT;mcStage.align = StageAlign.TOP_LEFT;mcStage.stageWidth= 980;
mcStage.stageHeight = 690;
I want a button's image to change upon click, but I need it to change between two images, one of which will always be on the button. The thing is, I want a button that says either "Running" or "Stopped" (each has its own image). When I click the button when it says "Running," the button image should change to "Stopped"; when I click the button when it says "Stopped" it would change to the button image for "Running." How can I do this?
View 2 RepliesI wahnt to change button appearance when it was clicked.
<?xml version="1.0" encoding="utf-8"?>
<s:Button xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"[code]..........
Is there a method using states? I could then use the skin convention.
i am trying to make it so that an image (0. or 00. in my example file) changes to a new image when a button is clicked.... (01 02 03 etc in example)how can i do this?
View 1 RepliesThis is the website that I'm working on. Not much going on yet but I have this invisible button that turns the radio on and off.. what I would like to do is have an image of the radio that I made up where the light is on for when it turns on and then back to off for when it's off.
[URL]
I have two frames( frame1 and frame2). In frame1 I have a button and in frame2 have a textfield. I want with click button(in frame1) to change the text of textfield (in frame2).
View 3 Replies