Autor |
Nachricht |
crazyjunk
Threadersteller
Dabei seit: 27.09.2006
Ort: -
Alter: 36
Geschlecht:
|
Verfasst Mi 08.10.2008 09:08
Titel slideshow navigation automatisieren ... |
|
|
hallo!
ich hab mir mit diesem tutorial einen flash-header gebastelt:
http://www.layoutgalaxy.com/html/htmnewletter43-page1.htm
aussehen tut das ganze bisher so:
http://breitschopf.probeseite.at/assets/flash/home.swf
Nun, fehlen mir sozusagen noch 2 features:
Das ganze sollte automatisch laufen. das heist jedes bild etwa 10sek. stehenbleiben und dann automatischer switch zum nächsten pic. die möglichkeit das ganze über die sidebar als user zu beeinflussen, sollte aber trotzdem bestehen bleiben.
und ich möchte die rollovers noch umswitchen so dass gezeigt wird wo ich mich in der slideshow befinde. wie kann ich per actionscript einen button in den rolloverstatus versetzen?
Nochmal das AS zum überblick.
Das is im ersten frame des hauptclips:
Code: |
stop();
// _root.imagewidth defines the width of the image//
_root.imagewidth = 418;
// _root.speed defines the speed of the sliding images//
_root.speed = 3;
/* _root.trig.xposnew defines the x position of the sliding images */
_root.trig.xposnew = -(_root.imagewidth);
// About us Button action
but1.onRelease = function() {
_root.trig.xposnew = -(_root.imagewidth);
};
// Products Button action
but2.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*2);
};
// Services Button action
but3.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*3);
};
// Clients Button action
but4.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*4);
};
// Contact Us Button action
but5.onRelease = function() {
_root.trig.xposnew = -((_root.imagewidth)*5);
};
|
Dieses script läd die bilder (sollte also so bleiben können):
Code: |
/* Loading the images in their appropriate Movie Clips from the folder named as 'images' */
loadMovie("images/image1.jpg","clip1");
loadMovie("images/image2.jpg","clip2");
loadMovie("images/image3.jpg","clip3");
loadMovie("images/image4.jpg","clip4");
loadMovie("images/image5.jpg","clip5");
/* Setting the x and y position of Movie Clips in which images are loaded */
setProperty("clip1",_x,_root.imagewidth*1);
setProperty("clip1",_y,0);
setProperty("clip2",_x,_root.imagewidth*2);
setProperty("clip2",_y,0);
setProperty("clip3",_x,_root.imagewidth*3);
setProperty("clip3",_y,0);
setProperty("clip4",_x,_root.imagewidth*4);
setProperty("clip4",_y,0);
setProperty("clip5",_x,_root.imagewidth*5);
setProperty("clip5",_y,0);
|
das ist die animation:
Code: |
/* Below is the formula created for moving the 'scroller' Movie Clip in an ease out form */
xpos = getProperty(_root.mainscroller.scroller,_x);
xpos2 = xposnew-xpos;
xmove = xpos2/_root.speed;
setProperty(_root.mainscroller.scroller,_x, xpos+xmove);
|
habt ihr zufällig tipps für mich wo bzw wie ich am besten ansetze? habe hier erstmal eine kleine denkblockade.
mfg
Flo
|
|
|
|
|
phihochzwei
Moderator
Dabei seit: 08.06.2006
Ort: Mülheim an der Ruhr
Alter: 46
Geschlecht:
|
Verfasst Mi 08.10.2008 09:16
Titel
|
|
|
Also einen RollOver machst Du indem Du z.B.
Code: | but5.onRollOver = function():Void{
//hierhin das was er machen soll wenn die Maus drauf geht.
}
but5.onRollOut = but5.onReleaseOutside = function():Void{
//hierhin das was er mahcen soll wenn die Maus runter geht.
}
| [/quote]
|
|
|
|
|
Anzeige
|
|
|
crazyjunk
Threadersteller
Dabei seit: 27.09.2006
Ort: -
Alter: 36
Geschlecht:
|
Verfasst Mi 08.10.2008 09:30
Titel
|
|
|
danke, aber so weit bin ich schon ... ich möchte den button ja ohne mit der maus drüberzufahren sondern bloß per as in den rolloverzustrand versetzen.
weist was ich mein?
sollte das eventuell so funktionieren?
Code: |
but1.onRelease = function() {
_root.trig.xposnew = -(_root.imagewidth);
but1.gotoAndStop(2);
};
|
Zuletzt bearbeitet von crazyjunk am Mi 08.10.2008 09:31, insgesamt 1-mal bearbeitet
|
|
|
|
|
phihochzwei
Moderator
Dabei seit: 08.06.2006
Ort: Mülheim an der Ruhr
Alter: 46
Geschlecht:
|
Verfasst Mi 08.10.2008 09:32
Titel
|
|
|
Achsooooo.... Quasi ein Autoplay...
Da gehst Du einfach hin, packst das was Du in dem Mouseover drin hast, in eine Funktion und die rufst du dann per setInterval auf
|
|
|
|
|
crazyjunk
Threadersteller
Dabei seit: 27.09.2006
Ort: -
Alter: 36
Geschlecht:
|
Verfasst Mi 08.10.2008 09:34
Titel
|
|
|
oha! das werd ich probieren, sobald ich im büro bin
setInterval hilft mir schonmal verdammt viel weiter!
danke
edit: ahja und autplay is der treffende name für mein problem
Zuletzt bearbeitet von crazyjunk am Mi 08.10.2008 09:35, insgesamt 1-mal bearbeitet
|
|
|
|
|
crazyjunk
Threadersteller
Dabei seit: 27.09.2006
Ort: -
Alter: 36
Geschlecht:
|
Verfasst Mi 08.10.2008 11:55
Titel
|
|
|
mir gehen da gerade ein paar gedanken durch den kopf. hab ich ein wenig in de setIntervall function eingelesen.
mommentan kick ich die animation ja per mouseover an den buttons weg:
Code: |
but1.onRollOver= function() {
_root.trig.xposnew = -(_root.imagewidth);
};
// Products Button action
but2.onRollOver= function() {
_root.trig.xposnew = -((_root.imagewidth)*2);
};
// Services Button action
but3.onRollOver= function() {
_root.trig.xposnew = -((_root.imagewidth)*3);
};
// Clients Button action
but4.onRollOver= function() {
_root.trig.xposnew = -((_root.imagewidth)*4);
};
// Contact Us Button action
but5.onRollOver = function() {
_root.trig.xposnew = -((_root.imagewidth)*5);
};
|
wenn ich mir dan drüber ne funktion baue mit
Code: |
myFunction = function() {
_root.trig.xposnew = -(_root.imagewidth);
}
|
muss ich die ja immer beim nächsten mal *2, *3, *4 nehmen .. wie würde man das coden (sorry bin ein echter noob hier).. mit eine for schleife? und wenn dann bei *4 angekommen wieda *1 ? kann bir das mal jemand "skizzieren"?
und wie is das dann mitn intervall?
ich würd jetzt folgendes probieren:
Code: |
myInterval = setInterval(this, "myFunction", 10000);
|
läuft das dann endlos weiter? wenn ja, wärs ja optimal. dann rbauch ich nurmehr die for schleife realisiern .. hmm
kann mir hierbei noch jemand einen stupser geben?
|
|
|
|
|
phihochzwei
Moderator
Dabei seit: 08.06.2006
Ort: Mülheim an der Ruhr
Alter: 46
Geschlecht:
|
Verfasst Mi 08.10.2008 12:01
Titel
|
|
|
Code: |
var pointer:Number = 0;
var max:Number = 5;
myFunction = function() {
pointer = (pointer < max) ? pointer + 1 : 1);
_root.trig.xposnew = -(_root.imagewidth);
}
|
Versuch das mal
|
|
|
|
|
crazyjunk
Threadersteller
Dabei seit: 27.09.2006
Ort: -
Alter: 36
Geschlecht:
|
Verfasst Mi 08.10.2008 14:29
Titel
|
|
|
hey, danke!
könntest du mir diese zeile erklären?
Code: | pointer = (pointer < max) ? pointer + 1 : 1); |
und lieg ich falsch oder sollte ich hier noch mit dem pointer multiplizieren?
Code: | _root.trig.xposnew = -(_root.imagewidth*pointer); |
|
|
|
|
|
|
|
|
Ähnliche Themen |
slideshow mit navigation
Dreamweaver Navigation über Javascript-Slideshow einfügen
[jQuery Cycle] Slideshow in Slideshow wechseln zusammen
Automatisieren in Illustrator - eps zu ai?
imageReady automatisieren
Timestamp im PDF - automatisieren?
|
|