Zurück   Flashforum > Flash > ActionScript > ActionScript 1

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 14-07-2004, 12:26   #1 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
verknüpfung zwischen 2 funktionen

hi,

habe drei buttons, bei einem rollover soll entsprechend für jeden button das passende bild
erscheinen, dass in dem mc info im 7.frame liegt.
meine idee ist es den mc "info" so einfach wie möglich zu erstellen, d.h. alle bilder sollen
im frame 7 liegen, und mit _visible = true/false sichtbar gemacht werden.
nur wie kann zwischen beiden funktionen eine "verknüpfung" erstellen?
mit prototype?

im ersten frame von mc info liegt eine stop();
Code:
_root.bt_1.onRollOver = function() {
	_root.info.labelTxt = "Bild 1";
	_root.info.gotoAndPlay(2);
};
_root.bt_1.onRollOut = function() {
	_root.info.gotoAndPlay(1);
};


_root.bt_2.onRollOver = function() {
	_root.info.labelTxt = "Bild 2";
	_root.info.gotoAndPlay(2);
};
_root.bt_2.onRollOut = function() {
	_root.info.gotoAndPlay(1);
};


_root.bt_3.onRollOver = function() {
	_root.info.labelTxt = "Bild 3";
	_root.info.gotoAndPlay(2);
};
_root.bt_3.onRollOut = function() {
	_root.info.gotoAndPlay(1);
};


_root.info.onEnterFrame = function() {
	if (this._currentframe == 7) {
		_root.info.bild1._visible = true;
	} else {
		_root.info.bild1._visible = false;
	}

/*----> ????????? 
	if (this._currentframe == 7) {
		_root.info.bild2._visible = true;
	} else {
		_root.info.bild2._visible = false;
	}

	
	if (this._currentframe == 7) {
		_root.info.bild3._visible = true;
	} else {
		_root.info.bild3._visible = false;
	}
----->!!!!!!!
*/
};
gruss sven
xlive ist offline   Mit Zitat antworten
Alt 14-07-2004, 12:38   #2 (permalink)
-
 
Benutzerbild von pape
 
Registriert seit: Jan 2004
Beiträge: 3.002
ActionScript:
  1. _root.bt_1.onRollOver = function() {
  2.             _root.info.labelTxt = "Bild 1";
  3.             _root.info.gotoAndPlay(2);
  4.             _global.mypic = 1;
  5.            
  6. };
  7. _root.bt_1.onRollOut = function() {
  8.             _root.info.gotoAndPlay(1);
  9.             _global.mypic = 0;
  10. };
  11.  
  12.  
  13. // ...
  14.  
  15. _root.info.onEnterFrame = function() {
  16.             switch (_global.mypic) {
  17.                 case 1:
  18.                     _root.info.bild1._visible = true;
  19.                     break;
  20.                 case 2:
  21. //...
  22.  
pape ist offline   Mit Zitat antworten
Alt 14-07-2004, 12:50   #3 (permalink)
FBx
 
Benutzerbild von xlive
 
Registriert seit: May 2003
Beiträge: 968
hi,

danke für deinen lösungs ansatz.
so ähnlich habe ich es auch. wollte eigentlich "_global" vermeiden.
mir ist nicht ganz klar, wie die beiden functionen von einander vererben können? sollte aber gehen.
also heisst die schönen neuen flashbücher wälzen.

gruss sven
xlive ist offline   Mit Zitat antworten
Alt 14-07-2004, 13:00   #4 (permalink)
-
 
Benutzerbild von pape
 
Registriert seit: Jan 2004
Beiträge: 3.002
mit global.variablenname deklariert man nur eine gloale variable, die von überall aus ergal welcher stufe (also verschachtelte mcs oder so) erreichbar ist, ohne nden kompletten Pfad angeben zu müssen!
das hat nix mit vererbung oder OOP zutun!

GRuss
Robert
pape 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 14:22 Uhr.

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


Copyright ©1999 – 2012 Marc Thiele