New Tutorial Complete!

Check out the tutorial for the effect below and tell me how it is or if anyone wants me to add anything:

[swf=http://www.macromotive.com/ebay/alpha_fade.swf width=400 height=400][/swf]

[color=red][size=5]<a href=http://www.macromotive.com/ebay/alpha_fade.htm>>>>>>>>>>>CLICK HERE FOR ALPHA FADE TUTORIAL<<<<<<<<<<</a>[/size][/color]

Above has been edited for david :stuck_out_tongue:

I have updated source for people that like it simple in MX, all you need is to follow the tutorial but now you don’t have to make an empty movie clip manualy and place the code on it…just put this code on frame 1:

/*
||== Title: Alpha Graphic Fade ==||
||== Author: dan4885 (Dan Alu) ==||
||== Site: www.macromotive.com ==||
||== Date: 8/12/02 ==============||
*/

//Creates a new empty movie clip to script.
**createEmptyMovieClip("script_clip", 0);**
//Loops out script movie clip every frame.
**script_clip.onEnterFrame = function() {**

	//Used to control the _alpha setting of 'graphic1' with dependency of the mouse position.
	**_root.graphic1._alpha = Math.ceil(_root._xmouse / 4) - Math.ceil(_root._ymouse / 4);**
	//Used to control the _alpha setting of 'graphic2' with dependency of the mouse position.
	**_root.graphic2._alpha = 100 - Math.ceil(_root._xmouse / 4) - Math.ceil(_root._ymouse / 4);**
	//Used to control the _alpha setting of 'graphic3' with dependency of the mouse position.
	**_root.graphic3._alpha = Math.ceil(_root._ymouse / 4) - 100 + Math.ceil(_root._xmouse / 4);**
	//Used to control the _alpha setting of 'graphic4' with dependency of the mouse position.
	**_root.graphic4._alpha = Math.ceil(_root._ymouse / 4) - Math.ceil(_root._xmouse / 4);
}**

yes… you should add a FLASH 5.0 tutorial. :slight_smile:

Not to ***** or nothing… but it strikes me that everyone is suddenly doing MX tutorials. Do none of you realize that these tuts are going to be useless for any serious business site for at least a year, if not two to three years? Just something to keep in mind next time you’re building something in MX. the 6.0 plugin does not even hold 20% of the market yet, so if you’re going to make a tutorial and it CAN be done in 5.0, even if you didn’t design it that way, I’d suggest adding a section that details how to convert it to 5.0 format.

ummmm…upuaut you have a good point, but if you actually took the time to click on the tutorial link in my post then you would notice that the tutorial was made for Flash 5 but in the post above I posted the alternative for MX users! Your a little too quick on the gun big boy, ease up before you scare away the good and we get stuck with the bad and the ugly lol.

simplicity is a b!tch

roflmao… too true sir… my apologies to you.

I had actually worked out this effect yesterday in 5.0, which is why i didn’t click on the link, but you’re right, I should have checked before jumping at you. Ultimately it’s just a sign that I suffer from program envy… but my logic is sound on that arguement… even if I want to be programing in MX too. :slight_smile:

again… sorry for snapping at you…that was ****ty.

We all know us flashers have mental breakdowns every now and then, I guess yours was today, I usually have mine every monday…must be all crazy **** I do on the weekend! Don’t worry bout it upuaut everyone needs to be a little b!tchy every now and then, I’m sure everyone has seen me turn into a two faced bastard every now and then!

:cool:cool:cool:

::hugs::

rofl

Hey Dan, great tutorial, but I have one flaw with it. Well it took me a while to figure out why the tutorial wasn’t working, but I did it (I knew I had a brain in there somewhere), you don’t specify in the tutorial that you must have the layers like this (with clips in them respectively)…

g_clip 1
g_clip 2
g_clip 3
g_clip 4
g_clip 5

I ended up doing…

g_clip 5
g_clip 4
g_clip 3
g_clip 2
g_clip 1

Since when you create a new layer it puts it on top, I just started from the bottom with 1. Maybe you should specify the order of the layers, it might help stupid people like me :slight_smile:

The order of the layers has no influence whatsoever because you give your mcs instance names, Lost. And that’s a good thing it hasn’t :slight_smile:

pom :asian:

Well if it doesn’t matter what order, then how come it doesn’t work when I had it in reverse order? I am confused…haha.

I had all the code right, and it wasn’t working, then I decided to change the order of my layers (just dragging them to move them) so they looked excactly like the picture in the tutorial. It worked perfectly after I did that.

I will put a little note in my tutorial to tell the user to make their layers look exactly like mine andI am also going to add inertia to the mouse so that it is more smooth!

That will be awesome. Inertia rules. Still learning the Physics part of AS, but I think I am getting the hang of it.

OMG, you’re right, Lost… I have absolutely no clue why it is acting like that. Strange strange…

pom :asian:

I am no longer confused. I was looking at the code when I realized that there is no _alpha change for graphic5 (which of course makes it always opaque), so if it is on top, you can’t see the change of the other picture. If it is in the middle, you can only see the change of the picture above graphic5.

So as long as graphic5 is all the way on the bottom, it really makes no difference how you order it.

slaps forehead but of course. Brilliant, man. Brilliant.

pom :asian:

Hello Everybody,

Sorry for the delay but I had a busy work week so I didnt have time to add the inertia into my code, I don’t have access to edit my tutorial on the weekend since I am not at work but I am going to paste the updated code for Flash 5 and Flash MX:

**[color=red]//FLASH 5 CODE[/color]

onClipEvent(enterFrame) {
    difx = mosx - _root._xmouse;
    dify = mosy - _root._ymouse;
    mosx -= difx / 10;
    mosy -= dify / 10;
    _root.graphic1._alpha = (mosx / 4) - (mosy / 4);
    _root.graphic2._alpha = 100 - (mosx / 4) - (mosy / 4);
    _root.graphic3._alpha = (mosy / 4) - 100 + (mosx / 4);
    _root.graphic4._alpha = (mosy / 4) - (mosx / 4);
}
[color=red]//FLASH MX CODE[/color]

_root.createEmptyMovieClip("script_clip", 0);
script_clip.onEnterFrame = function() {
    difx = mosx - _root._xmouse;
    dify = mosy - _root._ymouse;
    mosx -= difx / 10;
    mosy -= dify / 10;
    _root.graphic1._alpha = (mosx / 4) - (mosy / 4);
    _root.graphic2._alpha = 100 - (mosx / 4) - (mosy / 4);
    _root.graphic3._alpha = (mosy / 4) - 100 + (mosx / 4);
    _root.graphic4._alpha = (mosy / 4) - (mosx / 4);
};**

Definitely a great addition. There is one thing though, sometimes when I move the mouse, it doesn’t change, so I move it around some more, and nothing, then eventually it will start again, then it will stop, then start, then stop…off an on. Any idea why?

Well it could be that you have the inertia set by dividing by 10 with a low FPS if so set 10 much lower and maybe try making our FPS around 25-30 and set:

mosx -= difx / 5;
mosy -= dify / 5;

Nope didn’t fix it. I was messing with it more and noticed it will only fade if my mouse is somewhere in the upper right quadrant of the lower left quadrant. If it is anywhere else, I don’t get an effect.

Any ideas?

I think you have your layers and instances wrong, but thats just my opinion because it works perfectly for me…private message me and I will give you my AIM sn and I can send you my .fla through that so you can view what i did visually!