kellys
January 8, 2003, 12:41am
1
hey folks,
Been awhile since I was here but you have all been so much help I figured I’d stop in and ask about a cool effect.
Check out this site:
http://www.urban9.com/
If you click on the link that says Phase2…
Any idea how they get that grey background to sit there and fluctuate its appearance like that??
Thanks
Kellys
system
January 8, 2003, 12:59am
2
Just taking a shot in the dark here, and doing it the easy way.
Create a black block on a white background movie.
Make the black block a movie clip.
Now we will want to fluctuate the _alpha of it to give it that appearance, we will do this with a small Math.random function in the onClipEvent(enterFrame) so that it will change repeatedly.
onClipEvent (enterFrame) {
this._alpha = 1+Math.random()*5;
}
This creates the low number as 1 and the high number as 4 and chooses randomly between those values.
system
January 8, 2003, 2:16am
3
thanks…this sort of got me going.
Strangely, I had trouble with you script but got this to work
onClipEvent (enterFrame) {
_alpha = 1+Math.random()*5;
}
They looked identical to me!?
Maybe i messed up somewhere.
Anyway, it works now…thanks for getting me started.
kellys
system
January 8, 2003, 2:34am
4
Hmm, odd.
I just wrote that code out last time, didn’t test it or anything.
But I just tested it now, worked great for me.
All you did was remove the “this” part, but that shouldn’t effect it any if you put it on the movie clip you want to do that…hmmm.
Definitely odd.
system
January 8, 2003, 3:50am
5
Well since you figured out how to do it with a movie clip, might as well do it with the drawing API in Flash (im bored, don’t mind me)
yMin = xMin=0;
xMax = Stage.width;
yMax = Stage.height;
_root.createEmptyMovieClip("container", 1);
box = _root.container;
box.beginFill(0x000000, 100);
box.moveTo(xMin, yMin);
box.lineTo(xMax, yMin);
box.lineTo(xMax, yMax);
box.lineTo(xMin, yMax);
box.lineTo(xMin, yMin);
box.endFill();
box.onEnterFrame = function() {
this._alpha = 1+Math.random()*5;
};
This creates an empty movie clip with the instance name “container” on level 1. We define the variable “box” that calls _root.container so we don’t have to keep retyping that.
Then we define the fill color with beginFill() (0x000000 = black) and the starting alpha of that color.
Then we move the clip to 0x0 (xMin, yMin variables defined at top)
Then we draw the lines to form the square with the lineTo(x,y) according to xMin, xMax, yMin, yMax variables.
Then we stop the fill with endFill()
And finally create a dynamic event handler (onEnterFrame) to act as the onClipEvent(enterFrame) for box (aka _root.container). And we apply the code in there.
yeah, I am bored
system
January 8, 2003, 4:04am
6
Now we’re talking!!
This is quite cool.
Let me know next time you “get bored”
system
January 8, 2003, 5:06am
7
LOL, i’m bored all the time
system
January 8, 2003, 5:16am
9
Believe, me I am trying very hard to.
But apparently people don’t like to hire psychotic people who speak in actionscript
system
January 8, 2003, 5:19am
10
psychotic people who speak in actionscript ??
[size=4]LMAO [/size]
system
January 8, 2003, 5:32am
11
Well, its true :-\
if (ASSpeaker) {
myObj = this.noJob;
} else {
myObj = this.hasJob;
}
system
January 8, 2003, 6:01am
12
if (lostinbeta == ASSpeaker) {
lostinbeta = helpfulGuy@theForums
} else {
lostinbeta = noHelp
}
=)
system
January 8, 2003, 6:03am
13
function postReply(createPost) {
createNewPost()+createPost;
}
for (post = 0; post<1000000000; post++) {
_root.lostinbeta.postReply(post);
}
system
January 8, 2003, 6:08am
14
if (post >= 1000000000) {
lostinbeta = boringGuyWithNoSocialLife
}
system
January 8, 2003, 6:11am
15
if (_root.lostinbeta == boringGuyWithNoSocialLife) {
delete _root.lostinbeta;
} else {
postReply(post);
}
system
January 8, 2003, 6:16am
16
lol! i love the delete ‘delete _root.lostinbeta;’ part:P:P
system
January 8, 2003, 6:21am
17
ehmm … how long we will be doing this?? :sleep:
system
January 8, 2003, 6:21am
18
LOL, yeah, I was going to create a whole new function called killSelf(), but I figured deleting myself was easier
system
January 8, 2003, 6:32am
19
lol … definately you’re a funny guy
system
January 8, 2003, 6:34am
20
Thanks :geek:
Oh how I have longed for someone to say those words…