View Full Version : New Tutorial Complete!
telekinesis
August 13th, 2002, 06:29 PM
Check out the tutorial for the effect below and tell me how it is or if anyone wants me to add anything:
<a href=http://www.macromotive.com/ebay/alpha_fade.htm>>>>>>>>>>>CLICK HERE FOR ALPHA FADE TUTORIAL<<<<<<<<<<</a>
Above has been edited for david :P
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);
}
upuaut
August 14th, 2002, 12:55 AM
yes.. you should add a FLASH 5.0 tutorial. :)
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.
telekinesis
August 14th, 2002, 01:07 AM
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
upuaut
August 14th, 2002, 02:38 AM
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. :)
again.. sorry for snapping at you..that was ****ty.
telekinesis
August 14th, 2002, 02:41 AM
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!
andr.in
August 14th, 2002, 02:50 AM
:cool:cool:cool:
upuaut
August 14th, 2002, 03:00 AM
::hugs::
rofl
lostinbeta
August 14th, 2002, 03:05 AM
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 :)
pom
August 14th, 2002, 04:13 PM
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 :)
pom :asian:
lostinbeta
August 14th, 2002, 04:16 PM
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.
telekinesis
August 14th, 2002, 04:19 PM
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!
lostinbeta
August 14th, 2002, 04:23 PM
That will be awesome. Inertia rules. Still learning the Physics part of AS, but I think I am getting the hang of it.
pom
August 14th, 2002, 04:32 PM
OMG, you're right, Lost... I have absolutely no clue why it is acting like that. Strange strange...
pom :asian:
lostinbeta
August 14th, 2002, 05:33 PM
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.
pom
August 14th, 2002, 05:51 PM
*slaps forehead* but of course. Brilliant, man. Brilliant.
pom :asian:
telekinesis
August 17th, 2002, 06:03 PM
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:
//FLASH 5 CODE
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);
}
//FLASH MX CODE
_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);
};
lostinbeta
August 17th, 2002, 06:12 PM
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?
telekinesis
August 17th, 2002, 06:14 PM
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;
lostinbeta
August 17th, 2002, 06:18 PM
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?
telekinesis
August 17th, 2002, 06:34 PM
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!
telekinesis
August 17th, 2002, 07:16 PM
Ok well me and lostbeta tester it out for Flash 5 and it worked fine but when we use the new MX script to make a movie clip it gets all jacked up and instead of inertia it just goes on and on at different speeds...a dirty little bastard! Feel free to help us out!
EDIT: Problem Solved, I forgot to specify where to place my created movie clip and refered wrong variables in script!
akurth
August 20th, 2002, 12:06 PM
Below is the link to the plugin stats of macromedia, up to June, I presume that the Player 6 percentage share will much higher now, and certainly by the end of the year...I presume it should at least be 50% by the end of this year. MX does not only have a few command updates but to a certain degeree is revamped in certain areas...I doubt developers will forgo such a new technology, especially with the MX Server out, it opens the door for some increadible rich application development.
http://www.macromedia.com/software/player_census/flashplayer/version_penetration.html
pom
August 27th, 2002, 06:23 AM
Sure, Alex, but Macromedia releases a new player every other week, and this won't help the penetration at all :(
pom :asian:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.