Bonjour, j'ai un problème en ActionScript2 que je doit résoudre rapidement si possible..
Explication:Il y a tout d'abord 2 boutons (web et logo), quand on clique dessus des images importer d'un fichier XML s'affiche, quand on clique sur une image (en l'occurence le bouton
btn_transparent ) cela doit afficher la même image en taille normal dans une autre fenêtres, pour l'instant sa marche comme prévu. Le problème est que quand j'appuis sur le bouton
logo puis sur une des images (différente des images du bouton web évidement), cela m'affiche la même image que dans le bouton web. Normalement la variable (liens) devrait prendre l'attribut
link dans le XML ( en bleu) au lieu de l'autre link (en rose). Le problème se situe donc sur le texte en rouge ( le reste n'a pas d'importance).
Donc voilà si vous pouvez m'aider a résoudre ce problèmes, je vous en serrait énormement reconnaissant.
Merci
Voilà le code:
btn_transparent.onRelease = function() {
getURL(liens,"_blank");
}
/**************************************************************************************************/
web_btn.onRelease=function(){
id=0;
var title_xml:XML = new XML();
title_xml.ignoreWhite = true;
title_xml.load("images.xml");
title_xml.onLoad=function(success:Boolean)
{
if(success){
nbPic = title_xml.firstChild.childNodes.length;
loadImage(title_xml.firstChild.childNodes[id].attributes.link);
}
}
function loadImage (url:String):Void
{
var my_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
titre_txt.text = title_xml.firstChild.childNodes[id].attributes.title;
text_txt.text = title_xml.firstChild.childNodes[id].attributes.text;
liens = title_xml.firstChild.childNodes[id].attributes.link;
[........]
/***************************************************************************************************/
log_btn.onRelease=function(){
id=0;
var title_xml:XML = new XML();
title_xml.ignoreWhite = true;
title_xml.load("images.xml");
title_xml.onLoad=function(success:Boolean)
{
if(success){
nbPic = title_xml.childNodes[1].childNodes.length;
loadImage(title_xml.childNodes[1].childNodes[id].attributes.link);
}
}
function loadImage (url:String):Void
{
var my_mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();
titre_txt.text = title_xml.childNodes[1].childNodes[id].attributes.title;
text_txt.text = title_xml.childNodes[1].childNodes[id].attributes.text;
liens = title_xml.firstChild.childNodes[id].attributes.link;
[.....]
Code XML:
<web_img>
<img
link="web/1.jpg" title="Bluebox" text="." />
<img link="web/2.jpg" title="Studio Falour" text="." />
<img link="web/3.jpg" title="guildwars loterie" text="." />
<img link="web/4.jpg" title="Fondation Phenix" text="." />
<img link="web/5.jpg" title="Portfolio v1" text="." />
<img link="web/6.jpg" title="Villa Bellavista" text="."/>
</web_img>
<logo_img>
<img
link="logo/1.jpg" title="Elephant security" text="."/>
<img link="logo/2.jpg" title="Test de logos" text="."/>
<img link="logo/3.jpg" title="Beatbox Radio" text="."/>
<img link="logo/4.jpg" title="."/>
</logo_img>