SUPERBE DIAPORAMA EN FLASH + XML

cs_AmeDay Messages postés 38 Date d'inscription lundi 17 mars 2003 Statut Membre Dernière intervention 16 février 2004 - 16 févr. 2004 à 18:40
tarmak007 Messages postés 1 Date d'inscription samedi 17 décembre 2005 Statut Membre Dernière intervention 25 février 2007 - 25 févr. 2007 à 00:02
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/20410-superbe-diaporama-en-flash-xml

tarmak007 Messages postés 1 Date d'inscription samedi 17 décembre 2005 Statut Membre Dernière intervention 25 février 2007
25 févr. 2007 à 00:02
En ce qui concerne la question de ce post, est ce que tu as installé ton flash sur l'hébergeur free ? N'y aurait-il pas un problème de droit sur les fichiers ?
saucisse88 Messages postés 1 Date d'inscription mercredi 4 mai 2005 Statut Membre Dernière intervention 19 juin 2006
19 juin 2006 à 17:42
Bonjour, j'ai egalement un probleme en ligne avec ce diapo, ca fonctionne tres bien en local.
Le xml se charge puisque les miniatures s'affichent, mais je suis obligé de recharger la page (des fois plusieures fois) pour que les liens hypertextes et les commentaires des images s'affichent.
Je seche.......
Merci de votre aide.
Alex
Felody Messages postés 6 Date d'inscription vendredi 28 novembre 2003 Statut Membre Dernière intervention 3 décembre 2008
24 oct. 2005 à 23:47
En effet ce code fonctionne tres bien, mais quel domamger de l'avoir livré en "standalone", en lancement a partir dune page html !
J'aurais besoin d'intégrer ce swf dans un swf, a partir dun loadmovie par exemple, et malgré tous mes efforts, le dipoarama se déploie sur toute la largeur de mon premier swf, au lieu de rester ds lespace que je lui donne ...
En regardant le code je vois bien cela :
Stage.scaleMode = "noScale";
Stage.align = "TL";

et meme en l'enlevant et en republiant le swf, j'obtiens le meme déploiement sur toute la largeur de mon swf apelant :(

Si vous aviez une idée merci de la présenter ici je suis sure de ne pas etre la seule ds ce cas de figure ^^
bigdaddyk Messages postés 1 Date d'inscription mercredi 15 décembre 2004 Statut Membre Dernière intervention 24 août 2005
24 août 2005 à 11:27
Il fonctionne tres bien ce diaporama et trés utile en plus.
Pas besoin du .fla, tout est dans l'.xml et dans le .css .
Faut juste remplacer les images et les liens dans l'.xml.
le changement de couleur de font se fait dans l'xml,le highligth aussi, quand
au background on le change dans le .css et plein d'autres choses a découvrir .

Source nikel et évidement pas pour le débutant..
obibad Messages postés 1 Date d'inscription samedi 28 mai 2005 Statut Membre Dernière intervention 28 mai 2005
28 mai 2005 à 11:47
C'es dommage j'aime bien ce site mais quand je lis les post de certaines personnes comme "Ademay" qui ne donne rien d'objectif ,ça me revolte! Et bien j'aimerai lui dire de ne pas poster.Si ça te plais pas vas ailleurs ici il y a des gens qui savent répondre poliment même s'il manque des infos!
Sans Sommation ni convenance !!! Continuez
pepedede Messages postés 2 Date d'inscription vendredi 27 juin 2003 Statut Membre Dernière intervention 19 février 2004
19 févr. 2004 à 18:01
action script sur 7 frames :
// Action script...

// [Action in Frame 1]
Stage.scaleMode = "noScale";
Stage.align = "TL";

// [Action in Frame 3]
function parseMe(success)
{
if (success)
{
rn = _xml.firstChild.childNodes[0];
bgcolor = rn.attributes.bgcolor;
if (bgcolor == "")
{
bgcolor = "ffffff";
} // end if
col = new Color(bg);
col.setRGB("0x" + bgcolor);
_root.bg._xscale = Stage.width;
_root.bg._yscale = Stage.height;
_root.loopme = rn.attributes.endlessloop;
if (_root.loopme == "" && _root.loopme != "yes" && _root.loopme != "no")
{
trace("endlessloop: oops");
_root.loopme = "no";
} // end if
_root.imgw = rn.attributes.imagewidth;
if (_root.imgw == "")
{
trace("imgw: oops");
_root.imgw = 134;
} // end if
_root.imgw = Number(_root.imgw);
_root.spacing = rn.attributes.spacing;
if (_root.spacing == "")
{
trace("spacing: oops");
_root.spacing = 5;
} // end if
_root.spacing = Number(_root.spacing);
_root.highlite = rn.attributes.usehighlite;
if (_root.highlite == "")
{
trace("highlite: oops");
_root.highlite = false;
} // end if
_root.highlitecolor = rn.attributes.highlitecolor;
if (_root.highlitecolor == "")
{
trace("highlitecolor: oops");
_root.highlitecolor = "00ff00";
} // end if
trace(_root.highlite + ":" + _root.highlitecolor);
_root.handcursor rn.attributes.usehandcursor "yes" ? true : false;
trace("handcursor=" + _root.handcursor);
_root.texty = rn.attributes.textverticalposition;
if (_root.texty == "")
{
trace("texty: oops");
_root.texty = 10;
} // end if
_root.textsize = rn.attributes.textsize;
if (_root.textsize == "")
{
trace("textsize: oops");
_root.textsize = 11;
} // end if
_root.textsize = Number(_root.textsize);
_root.textcolor = rn.attributes.textcolor;
if (_root.textcolor == "")
{
trace("textcolor: oops");
_root.textcolor = "000000";
} // end if
_root.textfont = rn.attributes.textfont;
if (_root.textfont == "")
{
trace("textfont: oops");
_root.textfont = "_sans";
} // end if
farr = TextField.getFontList();
for (f = 0; f < farr.length; f++)
{
if (farr[f] == _root.textfont)
{
trace("Gotcha: " + _root.textfont);
_root.gotfont = true;
}
else
{
} // end of for
} // end if
farr = NULL;
if (_root.gotfont)
{
trace("nope, no " + _root.textfont);
_root.textfont = "_sans";
} // end if
_root.textwidth = rn.attributes.textwidth;
if (_root.textwidth == "")
{
trace("textwidth: oops");
_root.textwidth = 200;
} // end if
_root.textwidth = Number(_root.textwidth);
_root.textheight = rn.attributes.textheight;
if (_root.textheight == "")
{
trace("textheight: oops");
_root.textheight = 30;
} // end if
_root.textcenter = rn.attributes.textcenter;
if (_root.textcenter == "")
{
trace("textcenter: oops");
_root.textcenter = "true";
} // end if
for (i = 0; i < rn.childNodes.length; i++)
{
_root.sources.push(rn.childNodes[i].attributes.image);
_root.descriptions.push(rn.childNodes[i].attributes.description);
_root.hrefs.push(rn.childNodes[i].attributes.href);
_root.targets.push(rn.childNodes[i].attributes.target);
} // end of for
init();
} // End of the function
} // end if
function init()
{
for (i = 0; i < _root.sources.length; i++)
{
_root.createEmptyMovieClip("img" + i, 10 + i);
loadMovie(_root.sources[i], _root["img" + i]);
_root["img" + i]._x = Number(_root.spacing) * i + i * Number(_root.imgw);
} // end of for
if (_root.textcenter == "true")
{
textx = (Stage.width - _root.textwidth) / 2;
}
else
{
textx = 2;
} // end if
if (_root.highlite == "true")
{
_root.attachMovie("highlite", "highlitebox", ++i + 10);
_root.highlitebox._x = 0;
col = new Color(_root.highlitebox);
col.setRGB("0x" + _root.highlitecolor);
} // end if
_root.createTextField("showdescription", ++i + 10, textx, _root.texty, _root.textwidth, _root.textheight);
_root.showdescription.multiline = true;
_root.showdescription.wordWrap = true;
_root.showdescription.html = true;
_root.showdescription.embedFonts = false;
_root.showdescription.htmlText = " Loading... ";
} // End of the function
_xml = new XML();
_xml.ignoreWhite = true;
_xml.onLoad = parseMe;
_root.sources = new Array();
_root.descriptions = new Array();
_root.hrefs = new Array();
_root.targets = new Array();
var rndmzr = Math.round(Math.random() * 10000);
if (_root.xmlfile != "")
{
_xml.load(_root.xmlfile + "?rndmzr=" + rndmzr);
}
else
{
_xml.load("filmnav.xml?rndmzr=" + rndmzr);
} // end if

// [Action in Frame 5]
totalBytes = 0;
loadedBytes = 0;
for (i = 0; i < _root.sources.length; i++)
{
totalBytes = totalBytes + this["img" + i].getBytesTotal();
loadedBytes = loadedBytes + this["img" + i].getBytesLoaded();
} // end of for
if (totalBytes < loadedBytes)
{
gotoAndPlay(4);
}
else
{
_root.showdescription.htmlText = " ...ready ";
} // end if

// [Action in Frame 7]
function redraw()
{
lastMov = _root["img" + (_root.sources.length - 1)];
if (_root._xmouse < 2 * Stage.width / 3)
{
dx = Math.floor((_root._xmouse - 2 * Stage.width / 3) / -10);
}
else if (_root._xmouse < Stage.width / 3)
{
dx = Math.floor((Stage.width / 3 - _root._xmouse) / 10);
}
else
{
dx = 0;
} // end if
index = index + dx;
if (index < 0)
{
index = 0;
} // end if
fw = _root.sources.length * _root.imgw + (_root.sources.length - 1) * _root.spacing;
if (index < Stage.width - fw)
{
index = Stage.width - fw;
} // end if
for (im = 0; im < _root.sources.length; im++)
{
_root["img" + im]._x = index + im * _root.imgw + im * _root.spacing;
if (_root["img" + im].hitTest(_root._xmouse, _root._ymouse, false))
{
_root.showdescription.htmlText = "" + _root["img" + im].descriptiontxt + "

";
if (_root.highlite == "true")
{
_root.highlitebox._x = _root["img" + im]._x;
_root.highlitebox._xscale = _root["img" + im]._width;
_root.highlitebox._yscale = _root["img" + im]._height;
} // end if
} // end if
} // end of for
updateAfterEvent();
} // End of the function
function redrawloop()
{
if (_root._xmouse < 2 * Stage.width / 3)
{
dx = Math.floor((_root._xmouse - 2 * Stage.width / 3) / -10);
}
else if (_root._xmouse < Stage.width / 3)
{
dx = Math.floor((Stage.width / 3 - _root._xmouse) / 10);
}
else
{
dx = 0;
} // end if
if (dx < 0)
{
var ic = 0;
trace("dx:" + dx);
while (ic < _root.sources.length)
{
_root["img" + ic]._x = _root["img" + ic]._x + dx;
if (_root["img" + ic]._x < -_root.imgw)
{
if (ic == 0)
{
_root.img0._x = _root["img" + (_root.sources.length - 1)]._x + _root.spacing + _root.imgw + dx;
}
else
{
_root["img" + ic]._x = _root["img" + (ic - 1)]._x + _root.spacing + _root.imgw;
} // end if
} // end if
ic++;
} // end while
trace(dx + " imgw=" + _root.imgw + " spacing=" + _root.spacing);
} // end if
if (dx < 0)
{
var ic = 0;
while (ic < _root.sources.length)
{
_root["img" + ic]._x = _root["img" + ic]._x + dx;
if (_root["img" + ic]._x < Stage.width)
{
if (ic == _root.sources.length - 1)
{
_root["img" + ic]._x = _root.img0._x - _root.imgw - _root.spacing;
}
else
{
_root["img" + ic]._x = _root["img" + (ic + 1)]._x - _root.spacing - _root.imgw + dx;
} // end if
} // end if
ic++;
} // end while
} // end if
var im = 0;
if (im < _root.sources.length)
{
if (_root["img" + im].hitTest(_root._xmouse, _root._ymouse, false))
{
_root.showdescription.htmlText = "" + _root["img" + im].descriptiontxt + "

";
if (_root.highlite == "true")
{
_root.highlitebox._x = _root["img" + im]._x;
_root.highlitebox._xscale = _root["img" + im]._width;
_root.highlitebox._yscale = _root["img" + im]._height;
} // end if
} // end if
im++;
} // End of the function
} // end if
trace(_root.showdescription.htmlText);
for (i = 0; i < _root.sources.length; i++)
{
_root["img" + i].descriptiontxt = _root.descriptions[i];
_root["img" + i].href = _root.hrefs[i];
_root["img" + i].hreftarget = _root.targets[i];
_root["img" + i].onRollOver = function ()
{
this.useHandCursor = _root.handcursor;
} // End of the function
_root["img" + i].onMouseUp = function ()
{
if (this.hitTest(_root._xmouse, _root._ymouse, false))
{
getURL(this.href, this.hreftarget);
} // End of the function
} // end if
} // end of for
var index = 0;
if (_root.loopme == "yes")
{
setInterval(redrawloop, 10);
}
else
{
setInterval(redraw, 10);
} // end if
stop();

sans avoir besoin de ?????
bongawonga Messages postés 83 Date d'inscription lundi 12 janvier 2004 Statut Membre Dernière intervention 12 septembre 2004
19 févr. 2004 à 14:43
je ne trouve pas ce diaporama spécialement original ni même très pratique. En plus il manque un petit code pour ouvrir les images en pop-up.

Sinon Ameday si tu veux voir les sources d'un swf il existe
FlashFavorite pour enregistrer les .swf sur ton dur et ActionScriptViewer qui te permet de regarder les sources et extraire les codes.
Je ne pense pas que ce soit la peine de récupérer les images lol

bien maintenant mon cher brusazacca, il te reste plus qu'a faire ta version amélioré de ce diaporama hein?
Prouprou_Sensei Messages postés 517 Date d'inscription mardi 23 décembre 2003 Statut Membre Dernière intervention 24 octobre 2006 1
18 févr. 2004 à 18:38
héhéhé...
biboone Messages postés 6 Date d'inscription lundi 6 janvier 2003 Statut Membre Dernière intervention 9 novembre 2007
18 févr. 2004 à 08:46
shockwave pas flash !!!
cs_AmeDay Messages postés 38 Date d'inscription lundi 17 mars 2003 Statut Membre Dernière intervention 16 février 2004
16 févr. 2004 à 18:46
De plus! C quoi ce bordel, y'a des .css des .html des .swf ou encore des JPEG mais merde, ya pas un seul .FLA tu veux qu'on t'aide en quoi!!! Faudrait m'expliquer là!
cs_AmeDay Messages postés 38 Date d'inscription lundi 17 mars 2003 Statut Membre Dernière intervention 16 février 2004
16 févr. 2004 à 18:40
Y'a pas idée d'avoir des pseudos pareils :)
Rejoignez-nous