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




Random Alpha...



Hi all, I have a simple light in the FLA attached, and I want to put it on top of a Christmas tree graphic. The only effect I want to add to it, is that I want it to have a random alpha, sometimes tweening randomly and smoothly back and forth between anything from 100 - 75%, and sometimes flickering in a single frame between the same parameters (100 to 75%). Can anyone tell me how this can be done? Thanks.



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 12-21-2004, 08:26 AM


View Complete Forum Thread with Replies

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

Random Alpha Changes?
What is the best way to approach this in actionscript?

I want to make a square flash by transforming
its alpha property every six seconds. I am going
to use it to overlay over an image I created in
Photoshop...

Thanks in advance for all your help! I have learned
so much from you all!!!

Mike

Random Alpha
I want to randomly fade in and out an image.
rather than using keyframes to get the same effect Id like to use actionscript.
Can anyone give me any pointers.

Random Alpha
I searched an found a lot of info, but not sure what the best way would be to do this.

I have 56 movieclips(boxes), that I need to be randomly faded in on run time.

I guess ideally, I'd like to make an array and have them randomly faded in, but is there an easier way? And can someone help me get started here?

Thanks

Random Alpha
i have many mcs and i want them to have randomly alpha
and they should change alpha all the time if its possible without any steps.

thx for help gbd

Random Alpha
I searched an found a lot of info, but not sure what the best way would be to do this.

I have 56 movieclips(boxes), that I need to be randomly faded in on run time.

I guess ideally, I'd like to make an array and have them randomly faded in, but is there an easier way? And can someone help me get started here?

Thanks

Random Alpha...
Hi all,

I have a simple light in the FLA attached, and I want to put it on top of a Christmas tree graphic.

The only effect I want to add to it, is that I want it to have a random alpha, sometimes tweening randomly and smoothly back and forth between anything from 100 - 75%, and sometimes flickering in a single frame between the same parameters (100 to 75%).

Can anyone tell me how this can be done?

Thanks.

Not Giving A Random Alpha
Im duplicating some clips on stage but there isnt a random alpha which i wanted..

Is this line of code wrong..

_root["ringInstance"+i]._alpha = random (30);

Creating Random Alpha...
Hi I need to create a box that has its ALPHA changed RANDOMLY... I know I need to do this with actionscript. Any info / help would be great. Thanks

Random Alpha On MovieClip
I have this code on a MC to make it's _alpha appear randomly:

Code:
onClipEvent (load) {
this._alpha = 0;
}
onClipEvent (enterFrame) {
if (this._alpha<100) {
this._alpha = random(50);
}
}
The MC "flickers" , but I'm attempting to make the random alpha "FADE" from one alpha level to the next so that the alpha appears more softly....

[F8] Random Alpha Fade
Does anyone know of a way to make an alpha fade more random. I know the basic way is by making a motion tween and setting the final alpha fade to zero.

But what i want is a fade that doesn't fade everything evenly it fades it unevenly. or to just make it fade from the egdes first.

Here is an example of what im trying to do.

EXAMPLE

if you click between like home and another page the kid on the right has like a white out fade effect. Thats what im looking to do.


Thanks

Random Alpha Speed
I used some actionscript to randomly move text around the screen. I would also like it to alpha in and out at random, so I put in code like this:


Code:
this._alpha=random(75)
Technically, it works... however, it basically blinks really fast. How can I slow down the rate at which it changes the alpha?

Your help is greatly appreciated!

Random Alpha Fade.
Ok I've looked in loads of places and found nothing. Can some point me in the direction of a tutorial or give me some help. I have a _mc of picture that fades to another and so on. And onto of that I'm gonna add about 40 squares and I want each square to have a random alpha to "0" a random amount of time at alpha "0" and then fade back.

Any help would be great! Thanks all!

Random Alpha Values
hi, could someone please help me for this...
i would like to make alpha fade-in and fade-outs with random values...
ex: several graphics which fade-in and out with random values, and if possible to limit the values between like 40% and 100%
is it possible using AS (knowing that i am a newbie at AS)

thank alot for those who read this

Random Alpha Change
Hi people. I want to make each of the squares (pictured below) change alpha every second or so. (fading).

Is actionscript needed to do this? can anyone help?



Cheers

[FMX]Random Alpha Fade In And Out
I have a picture on the stage that is coverd by 24 small squares (suare01, square02,..........square24) The alpha property for all squares is50. I would like the squares randomly fade to alpha 0 (stay on alpha 0 for approx. 8 seconds) and then fade back to alpha 50 again, while another one fade to alpha 0


Thanks in advance

Random Alpha Fade.
Ok I've looked in loads of places and found nothing. Can some point me in the direction of a tutorial or give me some help. I have a _mc of picture that fades to another and so on. And on top of that I'm gonna add about 40 squares and I want each square to have a random alpha to "0" a random amount of time at alpha "0" and then fade back.

Any help would be great! Thanks all!

Random Alpha Using Actionscript
Hi

I have a world map created from individual circles in Illustrator, I need to take this into Flash and fade the circles in randomly to create the map.

The map is made up of 100s of circles so obviously I want to avoid creating 100s of instances of the same movie clip and positioning them randomly on the timeline.

I am looking for any advice on the best way to achieve this using actionscript.

If the fading of the circles could be random each time the movie loads this would be a bonus but it's not a necessity.

Any help is much appreciated

Thanks

Random Alpha Values
hi, could someone please help me for this...
i would like to make alpha fade-in and fade-outs with random values...
ex: several graphics which fade-in and out with random values, and if possible to limit the values between like 40% and 100%
is it possible using AS (knowing that i am a newbie at AS)

thank alot for those who read this

Random Alpha Change
Hi people. I want to make each of the squares (pictured below) change alpha every second or so. (fading).

Is actionscript needed to do this? can anyone help?



Cheers

[FMX]Random Alpha Fade In And Out
I have a picture on the stage that is coverd by 24 small squares (suare01, square02,..........square24) The alpha property for all squares is50. I would like the squares randomly fade to alpha 0 (stay on alpha 0 for approx. 8 seconds) and then fade back to alpha 50 again, while another one fade to alpha 0


Thanks in advance

Random COLOR And Alpha Changer
Anybody have some quick ideas for a random COLOR changer and Apha changer...should I use the setTransform command?

thanks tv

Random Position With Alpha Fade
i am trying to make a leaf movie clip fly in from the left side of the screen and fade away as it reaches the right side. it's start _x and _y position is randomized.

i would also like the leaf movie clip duplicate itself when it a certain _x value and have it's alpha fade to 0%.

psuedo code (what else i want to happen):

when mc._x= 350
--duplicate leaf movie clip at random _x & _y position on left side of screen.
--mc alpha fades out to 0%.

if you need a test file, i can post one, thanks.

Random Image Alpha Cycling
Okay here's one I'd appreciate some help with - I've been asked to include a small random picture cycling area for a website I'm developing. There'll be three images and basically they have to randomly fade in and out constantly (preferably swapping places with each other while doing so). Is there any decent actionscript out there to do this quickly and easily?

Cheers guys

Making A Random Alpha Effect 0-100%
Hey Kirupa people!!! Whats up!! id like to thank all of the people who helped me with the lemmings movement! I now have a new question at hand!!


I have a lightpost and i want the light on the post to randomly turn on and off the name of the glow is g_glow so how would i be able to do this??? (i want the alpha to go 0% - 100% randomly)

Random Animation Of Alpha Property
Hi all, I've been racking my brain for way too long on how to do this and I'm not sure where to start anymore.

Here's what I want to do:

I have a movieclip called smoke_mc and using function I make it fade in. Once it is fully visible I'd like to have it randomly fade in and out at different rates using AS instead of tweens.

If anyone can point me in the right direction it would be greatly appreciated.

TIA.

DUPLICATE,ANIMATE,ALPHA,SIZE All Random
How do I make a movie clip duplicate 50 times on a stage of 800x600 and animate each randomly on the stage, each starting from on point and all spreading randomly across the stage togather.. Also each movie clip should scale to 1% and the alpha sholud fade out to 0%....phew...

and can anyone give me the script for this in Flash 4.0


very very urgent...

Thanks in advance

How Can I Make Little Squares Glimmer With Random Alpha?
Hi im trying to make grid of about 100 little squares (5x5 pixel) which are on there own layer flash independently of each other by giving them a random alpha value which changes. it will give the grid a kind of glimering appeal. i want to be able to control the range of minimum and maximum alpha and i want to be able to control the rate of change between each state so that it can be quick or slow. also i want it to fade between the random alpha transistion so that it fades between each random value smootly.

i have animated each square to do something specific in the intro and then i want to apply this action script to each layer for the rest of the time line which will be on a loop back to the start of the action script section.

this is a component which i will load into my main fash file as a .SWF with a load movie function

Im new to flash and i hope im not asking to much here. im using flash 8, if you can tell me how to do any of the above i would be gratefull as i would love to get going with this and knowing some of the above functions are better than knowing none!!!

Does anyone know how to achieve this with action script?

Thank you in advance!

RANDOM ALPHA FADE Doesn't Work
Hi all, I am reasonably new to AS so would value some imput.

My goal:-
I want to create a continuous random alpha fade that takes a picture and makes it randomly more and then less transparent. Im going to use the some code numerous times on several other photos for dynamic effect.

My problem:-
It won't loop. I traced the this._alpha value and found that it ignores my fade value and increments with float values, i.e. figures after the decimal point. which means it never arrives at the targetalpha value because that is always an integer value. How can i get the script to increment in integer values so that it can reach the target and then generatea new random target?

I was intending to place this code on the various movie clips on the stage time line. However i understand that creating a function and then calling the function from the movieclip would be better, but i don't know how.

Here is the code:-



onClipEvent (load) {
var fade = 1;
targetalpha = 10*Math.ceil(Math.random()*10);
}

onClipEvent (enterFrame) {
if(this._alpha > targetalpha) {
this._alpha -= fade;


} else if (this._alpha < targetalpha) {
this._alpha += fade;

} else if (this._alpha == targetalpha) {
targetalpha = 10*Math.ceil(Math.random()*10);
}
}

BitmapData Alpha Breaks When Changing Alpha Of Container Sprite
Hi,

I posted this in Flash CS3 forum on Friday, but have had no replies, and am still stuck, sorry for cross-posting.

I have the following structure:


Code:
Pane:MovieClip
Content:Sprite
image:BitmapData
Pane is an asset in the Library, and is dynamically placed inside another Sprite. The Library asset Pane already contains the Content sprite which contains the image BitmapData.

The image is originally a 24-bit PNG, and it doesn't seem to matter to the problem whether I use Lossless or Photo compression.

My problem is when I change the alpha on the Content Sprite in the Pane class, the alpha transparency image on turns to a solid black.

Also, not sure if this is related, two textboxes in another Pane's Content Sprite get two horizontal white lines, above and below, them--while I am changing the alpha of the first Pane.

Anybody know how to fix this?

This is my first AS3 project, so apologies if I missed something obvious.

Scrllpane Comp Changing Alpha But Not Contents Alpha.
I've had a go at this a few times it seems the scrollpane component can change the _alpha of it but that changes the content mcs ect that is in the comp to the same alpha as well. I want to make the scrollbars of it alpha 50 and the mcs in it stil 100 normal. It involves loading many more mcs swf's into the scrollpane so just need it set to main content at 100 percent alpha and so be able to change the scrollbars to alpha 50 or whatever?

Couldn't Control Alpha Of The Children Mc After Set The Parent's Alpha
Hi,

I have 4 little thumbnails mc in a parent mc, and I set the alpha of the
parent mc to 0, then I want the child to appear one by one, but flash
won't respond to that unless I set the alpha of the children seperately
to 0, does anyone know how to solve that? thanks in advance.

-c

Changing Alpha Programatically - Alpha Values Not Whole Numbers
I'm doing alpha changes on an image programatically in an onEnterFrame method. My code is this simple:

trace(mc1_mc._alpha);
mc1_mc._alpha -= 2;
trace(mc1_mc._alpha);

The output is:
100
97.65625

My question is, how is 100 - 2 = 97.65625? What is going on here? It gives this answer even if I use Math.round() on it. Any ideas?

Advancing Alpha Counter...as In Alpha Numeric
Is there a way to get an advancing alpha counter, such as a, b, c, d, etc. instead of 1, 2, 3, 4, etc.

Other than creating an array of a, b, c, d

advancing = new Array("a", "b", "c", "d");

i++;

advancing[i];

Thanks.

_t

Calling Alpha Value To Start Another Alpha Fade?
hey all!

okay so here's the deal I'm on a mission to make these buttons fade in one after another using a.s

and I'd like all my code to be in one frame [don't we all though ]

so far i have one fading in using


Code:
this.onEnterFrame = function() {
if(btn1._alpha < 100) {
btn1._alpha += 10;
}
}
now when i said i wanted the buttons to fade in one after another i was kinda fibbing ... what i really want is when btn1 reaches an alpha of 40 i want btn2 to start this same fade in process, then when btn2 reaches 40 i want btn3 to do the same and so on...

see the effect here [you have to enter the site] when you click on work, troops & contact

now i have also been searching for a easy to understand tutorial on how to make your own functions [that's the one where you can write a whole bunch of code stuff then call it later using only a little code, right?

well obviously i want to use this idea so i don't have to write out [okay lets be real here - copy and paste] the fade in code each time.

that way i figure i can say

if(btn1._alpha = 40)
do the function thingy to btn2

i tried this a.s, it only results in btn2 fading in as asked but btn1 stops fading at 40


Code:
if(btn1._alpha = 40) {
this.onEnterFrame = function() {
if(btn2._alpha < 100) {
btn2._alpha += 10;
}
}
}

any ideas would be the shizzel bo dizzel nizzel!

cheers fo' all the help so far!

-demian

Calling Alpha Value To Start Another Alpha Fade?
hey all!

okay so here's the deal I'm on a mission to make these buttons fade in one after another using a.s

and I'd like all my code to be in one frame [don't we all though ]

so far i have one fading in using


Code:
this.onEnterFrame = function() {
if(btn1._alpha < 100) {
btn1._alpha += 10;
}
}
now when i said i wanted the buttons to fade in one after another i was kinda fibbing ... what i really want is when btn1 reaches an alpha of 40 i want btn2 to start this same fade in process, then when btn2 reaches 40 i want btn3 to do the same and so on...

see the effect here [you have to enter the site] when you click on work, troops & contact

now i have also been searching for a easy to understand tutorial on how to make your own functions [that's the one where you can write a whole bunch of code stuff then call it later using only a little code, right?

well obviously i want to use this idea so i don't have to write out [okay lets be real here - copy and paste] the fade in code each time.

that way i figure i can say

if(btn1._alpha = 40)
do the function thingy to btn2

i tried this a.s, it only results in btn2 fading in as asked but btn1 stops fading at 40


Code:
if(btn1._alpha = 40) {
this.onEnterFrame = function() {
if(btn2._alpha < 100) {
btn2._alpha += 10;
}
}
}

any ideas would be the shizzel bo dizzel nizzel!

cheers fo' all the help so far!

-demian

[jpeg Alpha Load] Loaing Jpg In To A Mc With Alpha
ok i am loading a jpeg into a empty MC and when it load in i would it to alpha from o to 100

please can you help

i have been trying with this

onClipEvent(data) {
_alpha == 0;
_parent.images = int(getBytesLoaded()/getBytesTotal()*100);
if (getBytesLoaded() != getBytesTotal()) {
isloaded = 1;
}
}
onClipEvent(enterFrame) {
if (isloaded) {
alpha ++;
if (_alpha == 99) {
isLoaded = !isLoaded;
}
}

but not get any luck

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 Alpha Alpha And Er.. Actionscript?
i need a script for a button, when the mouse is taken over it the alpha increase slowly to 100 when the mouse is out the alpha goes down to about 75?

thnx.

Making Alpha 0 To Alpha 100
Dear All,

I was just wondering if anybody knows, how to change alpha 0 to 100 for a perticular layer ?? I would really appreciate for the help, Thanks !!

-Ankur

Alpha Changes In A Gradient With Alpha
Hi there I am having a bit of a problem.

I have a gradient which goes like this:

100% Black -----> 60% Black

This gradient is over an object. And the whole form a movieclip.

Now if I want to apply a tween effect to that movieclip, lets say, frame 1 mymc is 100% alpha and tweens to 0% alpha in frame 20, this makes the gradient dissapear wile tweening showing the object that was beneath it in the movieclip. The gradient is not a mask, and even if I convert it as a mask and tick the Use Runtime Bitmap caching, and I create it from AS3 it does the same.

I don't know if I explained myself properly, but I'd like some input from you guys

thanks!

Random Random Random Timer... Problems
Heyy guys. I know you guys know this stuff backwards & forwards so maybe you can help.

This is a 2 part problem. Part 1 is Im trying to create a timer that functions at random intervals, the function in this case is playing a MC of a car driving on a freeway in 1 to 10 second intervals to give the feeling of, well, randomness. (I've attatched the .fla file if that'll help).

So it works, but not quite as it will generate intervals only twice before it repeats the second interval over and over. So the car will 'drive' in say, 7 seconds the first time and then it will drive in 3 seconds, then again in 3, and in 3 and in 3 seconds. Ive tested it so much I know its not coinsidence.

Here's the code Im using (located in the freeway MC):

var interval:Number = random(10)+1;
function someCodeToRun() {
_root.freeway.diffcars.drive01.gotoAndPlay(2);
}
setInterval(this, "someCodeToRun", interval*1000);

Part 2 is I also wanted the cars to be different colors, which is why there is a diffcars MC with different frames of cars, but now Im not even sure I was headed in the right direction with that.

Ultimately Id love to have different colored cars driving on the freeway at different intervals. Can anyone figure this out?

PLEASE HELP - URGENT Load Random Swfs From Individual Random Sets
I have two target mcs I would like to load different random swfs into

I have eight folders (a-h), each with 12 swfs (001-012)

I need to load a random swf (001-012) from a random folder (a-h) into the "card1" mc

I have figured out how to specify which one I want:

loadMovie("a/a001.swf","card1")
stop();

however, I need it randomized....

then, I need to load another random swf into my "card2" mc (001-012) from another random folder (a-h, ...except for the folder from which the first swf was loaded)

can somebody please help??????

Random Movie Clips To Play For Random Amount Of Time
hi,
i am loading external movieclips randomly into 4 seperate emptymovies, i now need a way to get these random clips that i am loading to play for a random amount of time and then load the next clip.
i need some help with the code...

how do i get the clips to loop, then assign each a random number and have flash check if the random num is = to current frame...if it is, have that clip stop and a new one load?

i have no idea how to write the code for this
any help would be great

thanks

this is what i was given so far..but don't know what to do with it.

Code:
var rnd = Math.round(Math.random(mc._totalframes));
mc.onEnterFrame = function() {
this._currentframe >= this._parent.rnd ? unloadMovie(this) : null;
}

Script Needed: Random Picture On Random Place By Click
I have a small question about a script I'm trying to find. I don't have a lot of experience with Flash, but I have to do this thing for school for which I need this script for my website.
I need a script which does the following: When you click on a button (or just on any place if the first is not possible) with you mouse, there appears a random picture (one out of ten or something) on a random place in a field (so not the whole page).
I hope you understand what I mean. I don't know the script, I only know that it's supposed to exist :) Does anybody know this script or where I can find such a script?

Thanks for helping me!

Elfie

Help: Multipule Random Positioned Duplicate Random Movie
Does anyone know a way that i can produce a button that when rolled over will duplicate x amount of movies each with random _x and _y positions? Basically i have a movieclip that will
gotoandPlay(math.Round((math.Random()*10)+1)
which randomises that frame that is played. This instance will then do some form of tweening and then gotoandPlay(1) again. I need a script that will then keep generating more duplicate movie clips whilst a button is moused over. i tried the following

on(mouseover){
i = 0;
rand_num = math.Round((math.Random()*29)+1);
while(i<20) {
duplicateMovieClip(_root.movie, "movie"+i,i);
setProperty("movie"+i, _x, _root.movie._x+(rand_num*5);
setProperty("movie"+i, _y, _root.movie._y+(rand_num*5);
i++
}
}

where movie = movieclip name

but this seems to generate all the clips on top of each other @ different depths. I want movies that are all in different positions. Can you help?

Random Movieclip @ A Random Partly Defined Position
Ok I´ve searched this forum to death but i didn´t REALLY
find the answer to my question! I think it can´t be that
difficult but i´m new to action-script and so i gotta hope
u´ll know the answer :

I´ve got an movie. (uh yeah ^^) in this movie there are
many movieclips that contain animations. now i want these
mcs to appear randomly @ a random position of a few defined
positions.

I really got NO idea how to do this !*prayinforyahelp*

ok thx 8]

Detecting Which Random AttachMovie Loaded From Random Array
I'm building a Freecell type card game. I've got an array that loads all of the cards (actually, the linkage names for each card loaded from the library with attachMovie). I randomize the array before I "deal the cards" onto the stage.

Here's a little code snipet where "deal" starts off equaling 0 and "cardDeck" is the value from my array (for example, c5 equals 5 of Clubs):


Code:
if (deal<52) {
_root.createEmptyMovieClip("card"+deal, deal);
_root["card" + deal].attachMovie(cardDeck[deal],cardDeck[deal],deal);
deal++
}
There's more, of course. My problem is - How can I detect which card loaded into which movie? For example, I know I have a movie called _root.card6 at the bottom of the first column, how can I know what card is loaded into _root.card6?

Movieclip Showen In Random Places At Random Time
How can I make my movieclip appeare in diffirent places at diffirent time? And the movie clip is this flying mobilephones(you can see it in swf http://www.hot.ee/at03/flying-mobs.swf).

Thanx in advance!

Random Script Help (action That Makes Things Go By Random)
Is it possible to make things go randomly by using AS? If so what AS should I use, please write it out....anything appreciated!

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