Problemes por creer un lien dans un menu flas
Okom
-
warlix Messages postés 1204 Statut Contributeur -
warlix Messages postés 1204 Statut Contributeur -
Problemes por creer un lien dans un menu flash creer par fichier XML
Bonjour voila je n'arrive pas a creer un lien vers une url externe voici mes codes
Dans Flash :
Stage.scaleMode = "noScale";
//global variables
xml_path = "";
images_path = "";
level = 1;
ScreenWidth = 620;
ScreenHeight = 450;
sections = new Array ();
//load XML
var xml = new XML ();
xml.ignoreWhite = true;
xml.load(xml_path+"data.xml");
xml.onLoad = function () {
sections = xml.firstChild.childNodes;
ypos = 0;
xpos = 0;
_root.createEmptyMovieClip ("MyMenu", level++);
MyMenu._x = 15;
MyMenu._y = 82;
for (var i = 0; i < sections.length; i++) {
n = "bu" + i;
_root.MyMenu.attachMovie ("Button", n, level++);
with (_root.MyMenu[n]) {
_y = ypos;
_x = xpos;
xpos += 100;
}
_root.MyMenu[n].loadDescr (sections[i].attributes.descr);
_root.MyMenu[n].loadCaption (sections[i].attributes.caption);
}
// initMyMenuImages ();
};
function unhitAll () {
for (var i = 0; i < sections.length; i++) {
n = "bu" + i;
_root.MyMenu[n]._state = 0;
}
}
function initMyMenuImages () {
_root.createEmptyMovieClip ("MyMenuImages", level++);
MyMenuImages._y = _root.ScreenHeight - 100;
for (var i = 0; i < sections.length; i++) {
n = "img" + i;
MyMenuImages.createEmptyMovieClip (n, i);
with (MyMenuImages[n]) {
_x = i * _root.ScreenWidth;
loadMovie (images_path + sections[i].attributes.image);
}
}
}
_root.onEnterFrame = function () {
// setMyMenuImages ();
/*
xpos = 0;
for (var i = 0; i < sections.length; i++) {
n = "bu" + i;
with (_root.MyMenu[n]) {
_x = xpos;
xpos += txtCaption._width + 15;
}
}
*/
};
function setMyMenuImages () {
pos = _root.MyMenuImages._x;
if (pos % width != 0) {
pos -= pos % _root.ScreenWidth;
}
for (var i = 0; i < sections.length; i++) {
bu = "bu" + i;
if (_root.MyMenu[bu]._state == 2) {
pos = -(i * _root.ScreenWidth);
}
}
for (var i = 0; i < sections.length; i++) {
bu = "bu" + i;
if (_root.MyMenu[bu]._state == 1) {
pos = -(i * _root.ScreenWidth);
}
}
_root.MyMenuImages._x += (pos - _root.MyMenuImages._x) / 4;
}
DANS DREAM (FICHIER XML)
<data>
<section descr="Bienvenue sur la Galerie Valerie Cueto" image="plant.jpg" attribute="" caption="Accueil" swf="tmp"/>
<section image="paintmug.jpg" descr="Oeuvres de divers Artistes" attribute="" caption="Galerie" swf="Design_01"/>
<section descr="Nouvelle Exposition de Vuk Vidor" image="frethand.jpg" attribute="" caption="Vuck Vidor" swf="music"/>
<section descr="Achats d'oeuvres en ligne" attribute="" image="01B.jpg" caption="Achat" swf="resume"/>
<section descr="Un probleme, une demande, nous sommes la!" image="bag.jpg" attribute="" caption="Contact" swf="guests"/>
</data>
Quelqu'un pourrai t'il m'aidez merci d'avance
Bonjour voila je n'arrive pas a creer un lien vers une url externe voici mes codes
Dans Flash :
Stage.scaleMode = "noScale";
//global variables
xml_path = "";
images_path = "";
level = 1;
ScreenWidth = 620;
ScreenHeight = 450;
sections = new Array ();
//load XML
var xml = new XML ();
xml.ignoreWhite = true;
xml.load(xml_path+"data.xml");
xml.onLoad = function () {
sections = xml.firstChild.childNodes;
ypos = 0;
xpos = 0;
_root.createEmptyMovieClip ("MyMenu", level++);
MyMenu._x = 15;
MyMenu._y = 82;
for (var i = 0; i < sections.length; i++) {
n = "bu" + i;
_root.MyMenu.attachMovie ("Button", n, level++);
with (_root.MyMenu[n]) {
_y = ypos;
_x = xpos;
xpos += 100;
}
_root.MyMenu[n].loadDescr (sections[i].attributes.descr);
_root.MyMenu[n].loadCaption (sections[i].attributes.caption);
}
// initMyMenuImages ();
};
function unhitAll () {
for (var i = 0; i < sections.length; i++) {
n = "bu" + i;
_root.MyMenu[n]._state = 0;
}
}
function initMyMenuImages () {
_root.createEmptyMovieClip ("MyMenuImages", level++);
MyMenuImages._y = _root.ScreenHeight - 100;
for (var i = 0; i < sections.length; i++) {
n = "img" + i;
MyMenuImages.createEmptyMovieClip (n, i);
with (MyMenuImages[n]) {
_x = i * _root.ScreenWidth;
loadMovie (images_path + sections[i].attributes.image);
}
}
}
_root.onEnterFrame = function () {
// setMyMenuImages ();
/*
xpos = 0;
for (var i = 0; i < sections.length; i++) {
n = "bu" + i;
with (_root.MyMenu[n]) {
_x = xpos;
xpos += txtCaption._width + 15;
}
}
*/
};
function setMyMenuImages () {
pos = _root.MyMenuImages._x;
if (pos % width != 0) {
pos -= pos % _root.ScreenWidth;
}
for (var i = 0; i < sections.length; i++) {
bu = "bu" + i;
if (_root.MyMenu[bu]._state == 2) {
pos = -(i * _root.ScreenWidth);
}
}
for (var i = 0; i < sections.length; i++) {
bu = "bu" + i;
if (_root.MyMenu[bu]._state == 1) {
pos = -(i * _root.ScreenWidth);
}
}
_root.MyMenuImages._x += (pos - _root.MyMenuImages._x) / 4;
}
DANS DREAM (FICHIER XML)
<data>
<section descr="Bienvenue sur la Galerie Valerie Cueto" image="plant.jpg" attribute="" caption="Accueil" swf="tmp"/>
<section image="paintmug.jpg" descr="Oeuvres de divers Artistes" attribute="" caption="Galerie" swf="Design_01"/>
<section descr="Nouvelle Exposition de Vuk Vidor" image="frethand.jpg" attribute="" caption="Vuck Vidor" swf="music"/>
<section descr="Achats d'oeuvres en ligne" attribute="" image="01B.jpg" caption="Achat" swf="resume"/>
<section descr="Un probleme, une demande, nous sommes la!" image="bag.jpg" attribute="" caption="Contact" swf="guests"/>
</data>
Quelqu'un pourrai t'il m'aidez merci d'avance
A voir également:
- Problemes por creer un lien dans un menu flas
- Créer un lien pour partager des photos - Guide
- Comment créer un groupe whatsapp - Guide
- Créer un compte google - Guide
- Créer un compte gmail - Guide
- Creer un fichier .bat - Guide