Diashow

danke für die Anregung - klapt so noch nich - werd mich mal dransetzten - hoffe ich schaff es bis heut nachmittag...

cu
möp
 
ich bekomm es einfach nich hin...
Hat nich irgendjemand noch glorieche ideen oder lösungen für mein Problem?
Stehe langsam unter Zeitdruck muss bis 6 fertig sein.... :(

danke schonmal
cu
möp
 
PHP:
// Erstellen der Klasse
_global.PhotoAlbum = function(holder_mc, photos_arr) {
	this.holder = holder_mc;
	this.photos = photos_arr;
	this.schowPhotoAt(0);
};
// die methode, die bestimmt, welches bild angezeigt werden soll
PhotoAlbum.prototype.showPhotoAt = function(n) {
	var lastindex = this.photos.length-1;
	if (n>lastindex) {
		n = 0;
	} else if (n<0) {
		n = lastindex;
	}
	this.index = n;
	this.holder.loadMovie(this.photos[this.index]);
};
// die nächstes-bild mthode
PhotoAlbum.prototype.next = function() {
	this.showPhotoAt(this.index+1);
};
// die vorheriges-bild methode
PhotoAlbum.prototype.prev = function() {
	this.showPhotoAt(this.index-1);
};
// die skalierungs methode
PhotoAlbum.prototype.scale = function(breite) {
	this.holder._width = breite;
};
// container mc erstellen
this.createEmptyMovieClip("holder_mc", 1);
// array füllen
photos_arr = ["1.jpg", "2.jpg", "3.jpg"];
// instant erstellen
album = new PhotoAlbum(holder_mc, photos_arr);
prev_btn.onRelease = function() {
	album.prev();
};
next_btn.onRelease = function() {
	album.next();
};
scale_btn.onRelease = function() {
	album.scale(wert);
};

Hier mit Scale Button.
 
danke - das funtioniert schonmal...

jetz muss ich nur noch rausbekommen, wie ich ein bild im verhätniss kleiner bekomme... :(

mfg
möp
 
ist doch auch net sooo schwer.

Angenommen du willst das Ganze auf eine bestimmte Breite quetschen.
Dann rechnest du die "Breite des Bildes" / "Breite im Sollzustand"
Damit bekomsmt du ne Skalierungskonstante.
Anschlißend gehst du genauso mit der Breite vor:

"Breite vom Bild" = "Breite vom Bild" * "Skalierungskonstante"

MfG
Killy
 
cool danke das is der ansatz den ich gesucht hab... aber wie kann ich die breite auslesen? ich hab ja verschieden bildgrößen...

mfg
möp
 
Ausbaufähig:
PHP:
_root.Breite = Stage.width;
_root.Hoehe = Stage.height;
// Erstellen der Klasse
_global.PhotoAlbum = function (holder_mc, photos_arr) {
	this.holder = holder_mc;
	this.photos = photos_arr;
	this.schowPhotoAt (0);
};
// die methode, die bestimmt, welches bild angezeigt werden soll
PhotoAlbum.prototype.showPhotoAt = function (n) {
	var lastindex = this.photos.length - 1;
	if (n > lastindex) {
		n = 0;
	}
	else if (n < 0) {
		n = lastindex;
	}
	this.index = n;
	this.holder.loadMovie (this.photos[this.index]);
};
// die nächstes-bild mthode
PhotoAlbum.prototype.next = function () {
	this.holder._xscale = 100;
	this.holder._yscale = 100;
	this.showPhotoAt (this.index + 1);
};
// die vorheriges-bild methode
PhotoAlbum.prototype.prev = function () {
	this.holder._xscale = 100;
	this.holder._yscale = 100;
	this.showPhotoAt (this.index - 1);
};
// die skalierungs methode
PhotoAlbum.prototype.scale = function (breite, hoehe) {
	this.holder._width = breite;
	this.holder._yscale = this.holder._xscale;
	this.holder._height = (hoehe - 30);
	this.holder._xscale = this.holder._yscale;
	if (this.holder._width > breite) {
		this.holder._width = breite;
		this.holder._yscale = this.holder._xscale;
	}
};
// container mc erstellen
this.createEmptyMovieClip ("holder_mc", 1);
// array füllen
photos_arr = ["1.jpg", "2.jpg", "3.jpg"];
// instant erstellen
album = new PhotoAlbum (holder_mc, photos_arr);
prev_btn.onRelease = function () {
	album.prev ();
};
next_btn.onRelease = function () {
	album.next ();
};
scale_btn.onRelease = function () {
	album.scale (_root.Breite, _root.Hoehe);
};
 
Zuletzt bearbeitet:
dank euch allen für die schnelle Hilfe - bin jetz fast fertig - aber ein kleines Problemchen hab ich noch...

Ich hab ein Menü, das ich aus einer extrenen swf einlade un zwar auf level1.
Doch leider funtioniert der scale-Button nich...

PHP:
this.menu.scale_btn.onRelease = function () {
    _level0.album.scale (_root.Breite, _root.Hoehe);
};

..steht im ersten frame der externen swf...
warum klappt es nich? ich denk mal das es ein Pfadproblem is, doch ich komm nich drauf...

mfg
möp
 

Neue Beiträge

Zurück