Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 28-09-2005, 16:06   #1 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
onRelease und onRollOut

hi,

habe auf meinen buttons ein onRollOver und onRollOut function, wo entsprechend sich die textfarbe ändert und ein bild angezeigt wird.

es kommt noch ein onRelease hinzu, dass das bild nach einem klick anzeigt.
doch leider verschwindet es wieder, sobald der button wieder verlassen wird.
wie kann ich das bild nach einem release weiter anzeigen lassen?

ActionScript:
  1. ausgabe.btn.onRollOver = function() {
  2. this._parent.btn.artikelcolor.textColor = 0x000000;
  3. _root["c"+i].loadMovie(this._parent.link);
  4. }
  5.  
  6. ausgabe.btn.onRollOut = function() {
  7. this._parent.btn.artikelcolor.textColor = 0xFFFFFF;   
  8. _root["c"+i].unloadMovie();
  9. }
  10.  
  11. //neu
  12. ausgabe.btn.onRelease = function() {
  13. this._parent.btn.artikelcolor.textColor = 0x000000;
  14. _root["c"+i].loadMovie(this._parent.link);
  15. }

gruss xlive

Geändert von xlive (28-09-2005 um 16:30 Uhr)
xlive ist offline   Mit Zitat antworten
Alt 28-09-2005, 16:12   #2 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Hallo!
Das macht so doch gar keinen Sinn?

1. Das Bild wird schon beim rollOver geladen...

2. Wozu dann das unload beim rollOut???
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 28-09-2005, 16:21   #3 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
jo, es wird die der artikelname angezeigt, bei rollover ändert sich die textfarbe (highlight), und das artikelbild wird angezeigt, bei rollout verschwindet das bild und die textfarbe ändert sich wieder.

das soll auch so bleiben, nur bei einem klick auf den artikelname soll das bild nun "dauerhaft" zu sehen sein und der artikelname gehighlighted.

findet nun nach einem klick weitere rollover über artikelnamen statt, sollen diese jeweils wieder gehighlighted und das passende bild angezeigt werden, bei rollOut wird wieder das bild angezeigt, dass zuvor geklickt wurde.
xlive ist offline   Mit Zitat antworten
Alt 28-09-2005, 16:27   #4 (permalink)
................
 
Benutzerbild von Der Frager
 
Registriert seit: Jun 2004
Beiträge: 15.890
Verstehe ich zwar immernoch nicht, aber ich versuch's mal:
ActionScript:
  1. ausgabe.btn.onRollOut = function() {
  2. if(!_root["c"+i].clicked){
  3.         this._parent.button..button.artikelcolor.textColor   = 0xFFFFFF;
  4.         _root["c"+i].unloadMovie();
  5. }
  6. }
  7.  
  8. //neu
  9. ausgabe.btn.onRelease = function() {
  10.         this._parent.btn.artikelcolor.textColor = 0x000000;
  11.         _root["c"+i].clicked = true
  12. }
__________________

ternärer Konditionaloperator

+++ Bitte keine Privat-Nachrichten bezüglich Flashfragen! +++
Der Frager ist offline   Mit Zitat antworten
Alt 29-09-2005, 16:57   #5 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
hi,

habe auf meinen buttons eine onRollOver u. onRollOut-function, wo sich entsprechend die textfarbe ändert und ein bild angezeigt wird.

jetzt soll noch ein onRelease hinzukommen, dass das passende bild bei einem klick anzeigt.
gedacht ist das ganze so, z.b. bei einem rollover über btn1 wird die textfarbe highlighted und bild1 angezeigt, bei einem klick ist bild1 „dauerhaft“ zu sehen und die schrift ist gehighlighted. bei einem rollover z.b. über btn2, wird entsprechend bild2 geladen (bild1 ist solange nicht zu sehen) und beide schriften sind gehighlighted, bei rollOut ist wieder bild1 mit der gehigh. schrift zusehen.

das problem ist, wenn ich btn1 klicke, dann auf btn2 klicke, und jetzt auf btn1 ein rollOver, erscheint das highlighting auf btn1 dauerhaft und auf btn2 verschwindet es.
das ganze liegt daran, weil this.onRollOut = this.onRelease ist und wenn ich auf einem btn der vorher mal geklickt wurde einen rollover mache, gilt dies ein onRelease.
denke mal, ich muss das jedesmal löschen?!
hat jemand eine ahnung wie ich das problem lösen kann?
hier mein script:
ActionScript:
  1. with (content_mc["player_" add playernum].button) {
  2.     aktivColor = 0xFFFF00;
  3.     overColor = 0xFFFF00;
  4.     outColor = 0x0A510A;
  5.     outColorTemp = outColor;
  6.     trace("outColorTemp: "+outColorTemp);
  7. }
  8. content_mc["player_" add playernum].button.onRelease = function() {
  9.     trace("Release");
  10.     //Zuvor geklickter Button erhält bei einem neuen Klick dunkelgrüner Farbe
  11.     btn.button.artikelcolor.textColor = outColor;
  12.     this._parent.button.artikelcolor.textColor = aktivColor;
  13.     btn = this._parent;
  14.     //---
  15.     this.outColor = (this.outColor == this.outColorTemp) ? this.aktivColor : this.outColorTemp;
  16.     this.onRollOut = this.onRelease;
  17. };
  18. content_mc["player_" add playernum].button.onRollOver = function() {
  19.     this._parent.button.artikelcolor.textColor = overColor;
  20. };
  21. content_mc["player_" add playernum].button.onRollOut = function() {
  22.     this._parent.button.artikelcolor.textColor = outColor;
  23. };

gruß xlive

Geändert von xlive (29-09-2005 um 17:39 Uhr)
xlive ist offline   Mit Zitat antworten
Alt 03-10-2005, 01:01   #6 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
hi,

wenn jemand eine gute idee hat wie man das problem lösen kann, habe die fla mal gezipt.
http://www.flashbanditen.de/btn.zip

gruß xlive
xlive ist offline   Mit Zitat antworten
Alt 03-10-2005, 09:00   #7 (permalink)
tracer
 
Benutzerbild von andretti
 
Registriert seit: Jun 2004
Beiträge: 4.415
aloha!

ActionScript:
  1. _global.clicked;
  2. ausgabe.btn.onRollOver = function() {
  3. if(this!= _global.clicked){       
  4. this._parent.btn.artikelcolor.textColor = "0x000000";
  5.         _root["c"+i].loadMovie(this._parent.link);
  6. }
  7. }
  8.  
  9. ausgabe.btn.onRollOut = function() {
  10. if(this != _global.clicked){
  11.         this._parent.btn.artikelcolor.textColor = "0xFFFFFF";
  12.         _root["c"+i].loadMovie(_global.clicked._parent.link);
  13. }
  14. }
  15.  
  16. //neu
  17. ausgabe.btn.onRelease = function() {
  18. _global.clicked.parent.btn.artikelcolor.textColor = "0xFFFFFF";
  19.         this._parent.btn.artikelcolor.textColor = "0x000000";
  20.         _root["c"+i].loadMovie(this._parent.link);
  21. _global.clicked= this;
  22. }
__________________
Viola per Sempre
Alle Angaben ohne Gewehr!
trace your open mind in variables !
andretti
ActionScript Dictionary
andretti ist offline   Mit Zitat antworten
Alt 03-10-2005, 13:16   #8 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
oooookay. genial einfach! super.
habe mich hier mit tmp und this.onRollOut = this.onRelease; rumgeärgert.

vielen dank.

gruß xlive
xlive ist offline   Mit Zitat antworten
Alt 05-10-2005, 10:33   #9 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
hi,

für alle die mal vor der gleichen aufgabe stehen;-)
hier die lösung.
http://www.flashbanditen.de/downloads/btnsolution.zip

gruß xlive

Geändert von xlive (05-10-2005 um 10:55 Uhr)
xlive ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an



Alle Zeitangaben in WEZ +1. Es ist jetzt 23:59 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele