Actionscript 3.0 :: Can't Seem To Find The Correct Code To Change A Movie Clip's Alpha?
Feb 1, 2009I can't seem to find the correct as3 code to change a movie clip's alpha.
View 4 RepliesI can't seem to find the correct as3 code to change a movie clip's alpha.
View 4 RepliesI am an AS3 n00b with hopefuly a simple question I am designing a simple game in flash. This code creates an array of movie clips and asigns a picture to each one. It is a map screen. What I need is when I click on one of the created movie clips, I need it to return either the index of the clip in the array or the name of the clip. Basicaly anything I can use to tell them apart in the code. Here is the code:
[Code]...
Now all this works fine, it creates the map and assigns the correct picture and places them in the correct X,Y position and it is the correct grid of 27x27 squares. The problem is with the name, when I click on the movie clip, it returns "Instance2" or "Instance5" or whatever. It starts with 2 and then increases each number by 3 for each clip, so the first one is 2, then 5 then 8 and so on. This is no good. I need it to return the name that I assigned it. If I put the code in trace(MapSquare[1]) it will return the name "MapSquare1" so I know the name was assigned, but it isnt returning.
I'm new to action script and was wondering how to change the alpha of a movieclip from 0 to 100% gradually or instantly when the mouse is moved ( like the navigation bar on a media player) when the mouse is still i want the alpha to be at 0, i am totally new to actionscript but am familiar with code syntax.
View 2 RepliesI'm trying to get in the habit of using AS in the first frame on the main timeline as much as possible. but sometimes i hit a snag. like getting a movie clip to change it's alpha when it hits a certain frame in an attached MC.
View 8 RepliesIt it posible to change the movie clip name with code.Something likemc1._name = 'mc2';
View 2 RepliesI have this code for a coloring application:
/** ActionScript 3.0 Coloring Book
* @author dRooza
*/
package {
import flash.display.MovieClip;
import fl.controls.ColorPicker;
[Code]...
I want to load the movie clips OutLines and Colorable into another movie clip, instead of just on the stage, so that I can use the jpeg encoder class on that movie clip.
Q1) The registration point of a created clip is top left - my question is how can I dynamically change it's registration point - say to center center?
(I am trying to attach a movie clip to a created clip and I wanted it to be centered inside the container - a related sub-question, how can I find the x-y coordinates of the attached movie clip within the created movie clip?)
Q2)When I tried to create two different movie clips, I found I had to create them at different depths, else the first would load and the second would not. Why would that be so? I'm on MX 2004 Pro.
I'm trying to do a math exercise, but with images (MCs) instead of variables. For 1+1, I want them to drag into the answer box a MC that corresponds to 2 (a picture with 2 apples on it) I'm OK with most of that, but how do I evaluate the MCs to tell them they got the problem right? or is there
View 12 RepliesI want to reduce the alpha of a movie clip when mouse is rollOver the movie , the alpha will be continuously reducing over frames, i dont want to use tween.
[Code]...
i this code when i rollOver the mouse on a movie clip, it shows the alpha reducing over time , and at roll out alpha increases over time. but if i rollOver and rollOut in fractions of seconds , it flickers (like 60-100 instead of from the current alpha lvl), So i am looking for some code that can help me in fixing this problem.
It's supposed to cause each of five movie objects to correspond and go to a different named frame when they are clicked. The problem is that regardless of which one is clicked, it always goes to "animation." I tested it out by changing the name of the animation frame. The result was that it then always went to the "publication" frame. It would seem that it goes to the last valid named frame in the script.[code]...
View 2 RepliesI can find the stage size of a movie thusly:
myStageWidth = Stage.width;
is there a way to do this to find the framerate of the movie the code resides in, or a loaded movie? eg (in pseudo code)
I have 4 shapes which fit into 4 boxes and would like to modify my code so when a shape is placed in the correct box a movie clip appears e.g. if a triangle is placed into a triangle shape the movieclip for triangle appears. if the shape is placed into the wrong box a message appears saying try again.
View 9 RepliesThe thing should work like this: theres a movie clip in frame 10 of the timeline with two buttons inside, by clicking one of them the movie should jump to frame 15 and take the alpha of two Mc there (they are inside a different movie clip) to 0. This is what ie been trying (code on the button, btw):
on (release) {
McScene2.lettuce._alpha = 0;
McScene2.pumpkin._alpha = 0;
[code].....
I'm having trouble getting my movieclips to have trails that fade behind it. I'm having the dupilcate movieclips delete themselves once their alpha reaches a certain point. what's wrong with my code? I'm pretty sure it has something to do with the counters. You can view my fla here: [URL]
View 5 RepliesI'm having trouble getting my movieclips to have trails that fade behind it. I'm having the dupilcate movieclips delete themselves once their alpha reaches a certain point.
View 5 RepliesI have a button and when this button is clicked, I want it to make a box which is a movie clip to ease alpha out.
newsButton.onRelease = function() {
gotoAndPlay("News");
};
how to increase the alpha of a movie clip when you rollover a button.
View 1 Replieswould like to know the AS code for getting a movieclip object to move to a specific x,y position on stage and change its alpha at the same time... would be nice if the movement was done with a nice tweening also.
View 3 RepliesWhen a movie clip is clicked on, another movie clip will fade out.The problem is that the clip that needs to fade out just disapears in a second, is there a way to controll the speed.I read a lot of info about this for complicated setups, is there a simple fix for this.I was hoping I could just do this designR_mc._alpha = 0/4;But that does not work.HERE IS THE CODE
design_mc.onRelease = function()
{ designR_mc._alpha =0;
}
[code].....
How can i change movie clips apha property slowly one by one in for each loop? I can't undestand what's wrong((( From XML data i create for each loop, where my MC creates. But i can't chang their alpha property slowly. When i'm trying
Code:
mc.addEventListener(Event.ENTER_FRAME, alphaShow)
function alphaShow(e:Event):void{
e.target.alpha += mcAlphaPlus;
[code]....
I can't seem to access the alpha property of a movie clip. I can change it's y x position but not the alpha....
This works great: loader2.lettercontainer.letter_mc1._y=50;
But this doesn't do anything: loader2.lettercontainer.letter_mc1._alpha=50;
The movieclip "letter_mc1" contains a createTextField with one letter in it. I'm completely lost why this isn't working....
I have 3 mc's that I have placed a tween on that fades them from 0% - 100% Alpha (simple fade-in effect). The animations are fine if I test the movie within Flash. However, after publishing, I lose all those tweens in my swf, and all I see are abrupt changes from 0% - 100% alpha. What could I be doing wrong?
View 2 RepliesI'd like to know how to gradually fade in a movie clip using alpha values? I'd like it to go from 0 to 1 in about 2 secondsish
View 5 RepliesI've been trying to find this topic on the internet for what seems like forever but haven't had any luck. What I'm trying to do is remove a child movie clip and have an alpha transition when it is removed.
What I have so far can be found at: [URL]
Basically what I'm trying to do is when the video player is closed, instead of simply disappearing, I want it to fade to an alpha value of zero
this is the code I have so far:
ActionScript Code:
stop ();
MC_btn.addEventListener(MouseEvent.CLICK, vimeo_embed);
function vimeo_embed (e:MouseEvent):void {
var OpenEmbedPlayer:Vimeo_MC_PU = new Vimeo_MC_PU();
[Code].....
how I can use the location of the mouse to control the alpha of a movie clip. I have 3 images that are the full stage width/height. One image will be in the background and does not need to be changed. However the other images I want to fade in when the mouse is moved from the middle to the left or the right. So I know I need to set a min and max value to be the range of the alpha, but I have never worked with mouse position before. I can't use the mouse over function like many tutorial's show due to images being full screen.
View 6 Repliesiam trying to bulid a slider which will change the alpha of another movie clip named light.how do i do this. here is the actionscript i have so far:
Code:
onClipEvent (load) {
top = _y;
[code]....
Here is my dilema. I need to know how to find what level a specific movie within a movie on the main timeline is on.
I am confused because I am not even using external swf's so there should be no levels
I have tried finding the level using
_root.moviename
_level0.moviename
but when i try to assign this to an array variable it outputs as undefined.I have been able to put some other movies in arrays using _level0.moviename
but these movies are nested inside a main movie that is found on the main timeline.
How do I find say the left edge of a movie clip?
View 2 RepliesI have a gallery made of 3 layers : actions, buttons, and images. Fore every image i have a keyframe that plays a movie clip by fading from 0 alpha to 1. I made a new keyframe that has no image so the page doesnt display the big photo from the start just the thumbs(which are the buttons). What i want to do is that the big images to be dispalyed only while i hold the mouse button, and on release to go back to the first frame state (no image).
View 3 Replies1) In the attached file, I have a movie clip that quickly comes across the top of the screen (following a short distance). I want it to start out with 0 alpha and i want it to fade in to 100 alpha. However, I want to do this using Actionscript while I'm EASING the movie clip. I'm trying to NOT use the timeline and do automated tweens for this function. If I combine them, it compliles but the output gets all messed up.
2) The quality of the text shown as the movie clip is not the same as how it looks in FLASH. I jacked up the quality of the output to 100% and it's still the same. any reason why?