//-----------------------------------------// création de la classe
//--------------------------------------------------------------------------------------------------------
Magalerie = function ()
{
}
// création de la chaine d'héritage
//--------------------------------------------------------------------------------------------------------
Magalerie.prototype= new MovieClip();
//--------------------------------------------------------------------------------------------------------
// attachement du clip à la classe
Object.registerClass("Magalerie",Magalerie);
Magalerie.prototype.onLoad = function ()
{
this.Create_XML();
}
//Récupération XML
Magalerie.prototype.Create_XML = function ()
{
var imglist = new XML();
//On ignore les blancs dans le xml
imglist.ignoreWhite = true;
trace(this._name);
//On charge
imglist.load("http://127.0.0.1/galerie_nolive/sample/getImgList.php");
//imglist.load("php/getImgList.php");
//Quand la liste est chargée
imglist.onLoad = function(success)
{
this._parent.createGalerie(imglist);
trace("success");
};
}
//Création de la galerie
Magalerie.prototype.createGalerie = function (imglist)
{
trace("coucou");
//liste des images
var noeuds = imglist.firstChild.childNodes;
trace(imglist);
//On parcours la liste
for (var i = 0; i<noeuds.length; i++)
{
//nom de l'image
var nom = noeuds[i].attributes.name;
//On crée un clip vide et le positionne
var img = this.createEmptyMovieClip("img"+i, i);
img._x = (i%5)*110+10;
img._y = Math.floor(i/5)*110+10;
// trace("img._x : "+img._x);
// trace("img._y : "+img._y);
// trace("---------------");
//On charge la miniature
var view = img.createEmptyMovieClip("view", 0);
view.loadMovie("mini/"+nom);
//On enregistre les infos
img.nom = "images/"+nom;
img.width = noeuds[i].attributes.width;
img.height = noeuds[i].attributes.height;
//On affiche l'image dans un popup lors du clic
img.onRelease = function()
{
this._parent.popup(this.nom, this.width, this.height);
};
}
}
//Lance une popup
Magalerie.prototype.popup = function (url, width, height)
{
var lalargeur = Math.min(Number(width)+20,
System.capabilities.screenResolutionX);
var lahauteur = Math.min(Number(height)+20,
System.capabilities.screenResolutionY);
var t = (System.capabilities.screenResolutionY-lahauteur)/2;
var l = (System.capabilities.screenResolutionX-lalargeur)/2;
var propriete =
"width="+lalargeur+",height="+lahauteur+",top="+t+",left="+l;
if (lalargeur == System.capabilities.screenResolutionX || lahauteur
== System.capabilities.screenResolutionY)
{
propriete += ",scrollbars=1";
}
getURL("javascript:void(window.open('"+url+"','image"+width+"','"+propriete+"'));");
}
//-----------------------------------------// création de la classe
//-------------------------------------------------------------------------------------------------------- Magalerie = function () { }
// création de la chaine d'héritage
//-------------------------------------------------------------------------------------------------------- Magalerie.prototype= new MovieClip();
//-------------------------------------------------------------------------------------------------------- // attachement du clip à la classe Object.registerClass("Magalerie",Magalerie);
Magalerie.prototype.onLoad = function () { this.Create_XML(); }
//Récupération XML Magalerie.prototype.Create_XML = function () { var imglist = new XML(); //On ignore les blancs dans le xml imglist.ignoreWhite = true; trace(this._name); //On charge
//Quand la liste est chargée imglist.onLoad = function(success) { this._parent.createGalerie(imglist); trace("success"); }; }
//Création de la galerie Magalerie.prototype.createGalerie = function (imglist) { trace("coucou"); //liste des images var noeuds = imglist.firstChild.childNodes; trace(imglist); //On parcours la liste for (var i = 0; i<noeuds.length; i++) { //nom de l'image var nom = noeuds[i].attributes.name; //On crée un clip vide et le positionne var img = this.createEmptyMovieClip("img"+i, i); img._x = (i%5)*110+10; img._y = Math.floor(i/5)*110+10; // trace("img._x : "+img._x); // trace("img._y : "+img._y); // trace("---------------"); //On charge la miniature var view = img.createEmptyMovieClip("view", 0); view.loadMovie("mini/"+nom); //On enregistre les infos img.nom = "images/"+nom; img.width = noeuds[i].attributes.width; img.height = noeuds[i].attributes.height; //On affiche l'image dans un popup lors du clic img.onRelease = function() { this._parent.popup(this.nom, this.width, this.height); }; } } //Lance une popup Magalerie.prototype.popup = function (url, width, height) { var lalargeur = Math.min(Number(width)+20, System.capabilities.screenResolutionX); var lahauteur = Math.min(Number(height)+20, System.capabilities.screenResolutionY); var t = (System.capabilities.screenResolutionY-lahauteur)/2; var l = (System.capabilities.screenResolutionX-lalargeur)/2; var propriete = "width="+lalargeur+",height="+lahauteur+",top="+t+",left="+l; if (lalargeur == System.capabilities.screenResolutionX || lahauteur == System.capabilities.screenResolutionY) { propriete += ",scrollbars=1"; }
//-----------------------------------------// création de la classe
//--------------------------------------------------------------------------------------------------------
Magalerie = function ()
{
}
// création de la chaine d'héritage
//--------------------------------------------------------------------------------------------------------
Magalerie.prototype= new MovieClip();
//--------------------------------------------------------------------------------------------------------
// attachement du clip à la classe
Object.registerClass("Magalerie",Magalerie);
Magalerie.prototype.onLoad = function ()
{
this.Create_XML();
}
//Récupération XML
Magalerie.prototype.Create_XML = function ()
{
var imglist = new XML();
//On ignore les blancs dans le xml
imglist.ignoreWhite = true;
trace(this._name);
//On charge
//Quand la liste est chargée
imglist.onLoad = function(success)
{
this._parent.createGalerie(imglist);
trace("success");
};
}
//Création de la galerie
Magalerie.prototype.createGalerie = function (imglist)
{
trace("coucou");
//liste des images
var noeuds = imglist.firstChild.childNodes;
trace(imglist);
//On parcours la liste
for (var i = 0; i<noeuds.length; i++)
{
//nom de l'image
var nom = noeuds[i].attributes.name;
//On crée un clip vide et le positionne
var img = this.createEmptyMovieClip("img"+i, i);
img._x = (i%5)*110+10;
img._y = Math.floor(i/5)*110+10;
// trace("img._x : "+img._x);
// trace("img._y : "+img._y);
// trace("---------------");
//On charge la miniature
var view = img.createEmptyMovieClip("view", 0);
view.loadMovie("mini/"+nom);
//On enregistre les infos
img.nom = "images/"+nom;
img.width = noeuds[i].attributes.width;
img.height = noeuds[i].attributes.height;
//On affiche l'image dans un popup lors du clic
img.onRelease = function()
{
this._parent.popup(this.nom, this.width, this.height);
};
}
}
//Lance une popup
Magalerie.prototype.popup = function (url, width, height)
{
var lalargeur = Math.min(Number(width)+20,
System.capabilities.screenResolutionX);
var lahauteur = Math.min(Number(height)+20,
System.capabilities.screenResolutionY);
var t = (System.capabilities.screenResolutionY-lahauteur)/2;
var l = (System.capabilities.screenResolutionX-lalargeur)/2;
var propriete =
"width="+lalargeur+",height="+lahauteur+",top="+t+",left="+l;
if (lalargeur == System.capabilities.screenResolutionX ||
lahauteur == System.capabilities.screenResolutionY)
{
propriete += ",scrollbars=1";
}
//-----------------------------------------// création de la classe
//-------------------------------------------------------------------------------------------------------- Magalerie = function () { }
// création de la chaine d'héritage
//-------------------------------------------------------------------------------------------------------- Magalerie.prototype= new MovieClip();
//-------------------------------------------------------------------------------------------------------- // attachement du clip à la classe Object.registerClass("Magalerie",Magalerie);
Magalerie.prototype.onLoad = function () { this.Create_XML(); }
//Récupération XML Magalerie.prototype.Create_XML = function () { var imglist = new XML(); //On ignore les blancs dans le xml imglist.ignoreWhite = true; trace(this._name); //On charge
//Quand la liste est chargée imglist.onLoad = function(success) { this._parent.createGalerie(imglist); trace("success"); }; }
//Création de la galerie Magalerie.prototype.createGalerie = function (imglist) { trace("coucou"); //liste des images var noeuds = imglist.firstChild.childNodes; trace(imglist); //On parcours la liste for (var i = 0; i<noeuds.length; i++) { //nom de l'image var nom = noeuds[i].attributes.name; //On crée un clip vide et le positionne var img = this.createEmptyMovieClip("img"+i, i); img._x = (i%5)*110+10; img._y = Math.floor(i/5)*110+10; // trace("img._x : "+img._x); // trace("img._y : "+img._y); // trace("---------------"); //On charge la miniature var view = img.createEmptyMovieClip("view", 0); view.loadMovie("mini/"+nom); //On enregistre les infos img.nom = "images/"+nom; img.width = noeuds[i].attributes.width; img.height = noeuds[i].attributes.height; //On affiche l'image dans un popup lors du clic img.onRelease = function() { this._parent.popup(this.nom, this.width, this.height); }; } } //Lance une popup Magalerie.prototype.popup = function (url, width, height) { var lalargeur = Math.min(Number(width)+20, System.capabilities.screenResolutionX); var lahauteur = Math.min(Number(height)+20, System.capabilities.screenResolutionY); var t = (System.capabilities.screenResolutionY-lahauteur)/2; var l = (System.capabilities.screenResolutionX-lalargeur)/2; var propriete = "width="+lalargeur+",height="+lahauteur+",top="+t+",left="+l; if (lalargeur == System.capabilities.screenResolutionX || lahauteur == System.capabilities.screenResolutionY) { propriete += ",scrollbars=1"; }