Hallo kristkindl
Also bevor ich mich da durch den Code wurschtel, gucke dir doch mal dieses Beispiel an.
So auf den ersten Blick würde ich mal sagen, reicht es wenn du this.onPress=function() umschreibst in this.onRollOver=function()
Huhu..habe ein fade in & out menu gefunden..klappt auch...nur muss man auf die buttons klicken um erst den effekt zu sehen.
geht auch ein mouseover? anstatt pressbutton??
hier is das script:
;PHP-Code://we set the visibility of all menues to false.
_root.square._visible=false;
_root.circle._visible=false;
_root.triangle._visible=false;
//we define the variable i and set it to 0, since we need a status 0 and 1.
i=0;
//we define the general function for the menues to fade in or out. Our object here
//is the button we press to initiate the fade in and out. There is one
//parameter, which is the menu name.
MovieClip.prototype.pressButton=function(menu){
//now we set the alpha value of the menues to 0, since this is
//required for the fade in function.
_root.square._alpha=0;
_root.circle._alpha=0;
_root.triangle._alpha=0;
_root.kontakt._alpha=0;
//when the button is pressed...
this.onPress=function(){
//...and i=1, which is not the case the first time a button is pressed,
if(i==1){
//we define an interval function for the fade.
myPause = new Object();
myPause.interval = function() {
//prevMenu is a var, which will hold the menu name for the menu,
//which is just active. Here we fade out prevMenu to fade in the
//new menu.
if(prevMenu._alpha<=100){
prevMenu._alpha-=10;
if (prevMenu._alpha < 0){
prevMenu._alpha = 0;
prevMenu._visible=false;
clearInterval(myTimer);
}
//once prevMenu has alpha value of 0, we can fade in the new menu.
if(prevMenu._alpha == 0){
fadeIn(menu);
}
}
}
//here is the interval parameter, which we can change.
myTimer = setInterval( myPause, "interval", 50);
//if no button was so far pressed, we also fade in the menu.
//prevMenu here is not yet defined.
}else if (i==0){
fadeIn(menu);
}
}
}
//this is the fade in function with menu name as a parameter.
function fadeIn(menu){
//we first set the menu visibility to true.
menu._visible=true;
//then we fade in the menu.
myPause = new Object();
myPause.interval = function() {
if(menu._alpha<100-20){
menu._alpha+=20;
}else {
//once done, we now define prevMenu and set it equal to the
//menu now shown on stage.
menu._alpha = 100;
prevMenu=menu;
//we also set i to 1 to execute the if statement in the button function.
i=1;
clearInterval(myTimer);
}
}
myTimer = setInterval( myPause, "interval", 70);
}
//here we execute the button function for each button. Since this script
//is within a movieclip, we have to refer to the menues with _root to go
//back to the main timeline.
circleText.pressButton(_root.circle);
triangleText.pressButton(_root.triangle);
squareText.pressButton(_root.square);
kontaktText.pressButton(_root.kontakt)
da am ende steht das mit dem pressbutton...ich denke das bezieht sich auf das klicken, wenn man mit der mouse auf den link klickt.
ich kenne mich mit actionscript net sooo gut aus..aber hoffe ihr könnt mir deshalb weiterhelfen..brauch es für die arbeit
schüüüüss
kristin![]()
Geändert von Wanderratte (02.12.2005 um 16:41 Uhr) Grund: Ich habe mal den Code formatiert, so ist der doch besser lesbar :)
Hallo kristkindl
Also bevor ich mich da durch den Code wurschtel, gucke dir doch mal dieses Beispiel an.
So auf den ersten Blick würde ich mal sagen, reicht es wenn du this.onPress=function() umschreibst in this.onRollOver=function()
Geändert von Wanderratte (02.12.2005 um 16:45 Uhr)
Gruß
Wanderratte
Gebildet ist,
wer weiß,
wo er findet,
was er nicht weiß.
4bugs
Home
Amazon Wunschzettel
hey danke ..das is gut..geht auch so.aber das wird grau beim mouseover..weil alpha...hm....kann man da evetuell noch die farbe ändern? brauch ein orange![]()
merci
Geändert von kristkindl (05.12.2005 um 10:01 Uhr)
Das liegt ja an der Grundfarbe und Hintergrundfarbe. Eventuell erreichst du dein Orange, wenn du hinter den Button eine farbige Fläche legst.
Gruß
Wanderratte
Gebildet ist,
wer weiß,
wo er findet,
was er nicht weiß.
4bugs
Home
Amazon Wunschzettel
Ja super..guter trickgeht..aber die volle farbe kommt net ganz durch..weil ich denk dass das alpha net ganz tranzparent is...sind das die 99? hab auf 100 mal gemacht..dachte dann würds ganz verschwinden..aber nich wirklich
![]()
neeeeeee der Alpha geht ja nur bis 50 % runter ausserdem mußt du den Wert dann auf 1 Setzen
100 % voll Anzeige
0 % nicht mehr Sichtbar
Gruß
Wanderratte
Gebildet ist,
wer weiß,
wo er findet,
was er nicht weiß.
4bugs
Home
Amazon Wunschzettel
aaaaaaaaaaaah *gg* okidoki
merci
Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)