PDA

View Full Version : Mask Dynamic Text


JamesHoven
06-27-2005, 07:54 PM
Hi,

I've created this Music Player http://www.nedoweb.com/Clients/Other/MediaPlayer.swf

The effect I'd like to create is a little tricky.
If you click on the Up arrow to load the Playlist, you will see a song called Hello and further down a song called Lose Tomorrow.

From these songs, I would like the rest of the songs to fade out into the background.

This would be simple enough if it were sitting on that grey background but this Music Player (MediaPlayer_mc) is loaded into the main site which has a lot of color.

So what I'd like to do is use a mask that fades from a color to transparent. But the color must not show. So in other words, it will look like the words are fading off into the background.

Does this make sense?

Thanks,
J

Billystyx
06-29-2005, 12:01 PM
Is the list part of a movieclip? Why don't you just fade the words?

If the fonts are embedded in the textfields, then you can use something like
txt1._alpha -=10;

to fade them
billystyx

JamesHoven
06-29-2005, 01:52 PM
Hey Billystyx, how you going?

Yeah this one is a little difficult to explain. What I'll try and do is create it in FireWorks as an image so you can see what I mean.

Will get back to you on this.
Thanks

Billystyx
06-30-2005, 09:32 AM
ok:)

JamesHoven
06-30-2005, 03:41 PM
ok, this is what I have.

http://www.nedoweb.com/Clients/Primecircle

If you click on the Media Player and bring up the playlist, you will notice that the songs overlap the rest of the content...

This list will eventually scroll up and down, based on the position of the mouse in a smaller area than it is being displayed in right now. So in other words, there will only be about 5 or 6 songs showing, using a mask.

The from the bottom, needs to fade in and when it scrolls to the top, it has to fade out. This would not be a problem, if it were on a solid background, but how would I create this effect using a "tranparent" fade?

No small order! :p

Billystyx
06-30-2005, 04:39 PM
still not sure I understand - if the list is a movie clip with sub mcs inside (like now I am guessing), then you could move the whole mc up or down according to the mouse position, and if the clips are above or below a certain point call a function to fade them out and vice versa.
prevY=_root._ymouse;
soundno=10;//no of sub mcs
onMouseMove=function(){
if(_root._ymouse>prevY){
mymc._y -=5;
}else if(_root._ymouse<prevY){
mymc._y +=5;
}
for(i=1;i<soundno;i++){
if(_root.mymc["sound"+i]._y>200){//you mini mcs should be named sound1,
//sound2,sound3 etc for this to work
fadeout(_root.mymc["sound"+i]);
}
if(_root.mymc["sound"+i]._y<100){
fadein(_root.mymc["sound"+i]);
}
}
prevY=_root._ymouse;
}
function fadeout(mc){
if(mc._alpha>0){
mc._alpha -=10;
}
}
function fadein(mc){
if(mc._alpha<100){
mc._alpha +=10;
}
}


something like this, maybe? (not sure if it works - haven't tested it)

billystyx

JamesHoven
06-30-2005, 04:47 PM
Have to be careful I don't abuse you for your code. I need to learn how to do this as well but the logic and lack of AS terminilogy escapes me so thanks Billystyx. :)

I've applied your code and liked what it's doing. Dont have the fade working 100% yet but I will see what I can do.

This is what I've got: I've put in additional comments so that I can understand the code better.



//Billystyx.com

onClipEvent (enterFrame) {

//Variable to track current Y mouse position
prevY=_root._ymouse;
//Variable for no of songs in playlist
NoTracks=14;
//Start mouse move function
onMouseMove=function(){
if(_root._ymouse>prevY){
this._y -=5;
}else if(_root._ymouse<prevY){
this._y +=5;
}
for(i=1;i<NoTracks;i++){
if(this["Track"+i+"_mc"]._y>200){//you mini mcs should be named sound1,
//sound2,sound3 etc for this to work
fadeout(this["Track"+i+"_mc"]);
}
if(this["Track"+i+"_mc"]._y<100){
fadein(this["Track"+i+"_mc"]);
}
}
prevY=_root._ymouse;
}
function fadeout(mc){
if(mc._alpha>0){
mc._alpha -=10;
}
}
function fadein(mc){
if(mc._alpha<100){
mc._alpha +=10;
}
}
}