0 Replies Latest reply on Mar 4, 2007 11:06 AM by rafuSExtreem

    Actionscript e XML

    rafuSExtreem
      Hi all!

      Ihave an actionscript code in flash that imports a xml file.
      The problem is I cant`t make flash show signs like "^" , "´" or "~" etc.
      Peguei um código na net de um Flash menu que importa um arquivo xml.
      O problema é q não consigo fazer com q o arquivo swf mostre os acentos!
      Já tentei usar as duas opções q se vê pela internet
      I already have tried the 2 options that we can find on internet

      System.useCodepage="true"; with one xml file without unicode or UTF-8

      or a System.useCodepage="false"; with a xml file saved as notepad with unicode and UTF-8

      But the swf file simply don`t want to show the signs..

      thats the actionscript code:



      //hide the flash right click menu items:


      Stage.showMenu = false;
      Stage.scaleMode = "noScale";
      Stage.align = "T";

      //hide the flash menu until the XML loads

      _parent._visible = false;

      // xml processing

      menu_cfg_xml = new XML();
      menu_cfg_xml.load("menu.xml");
      menu_cfg_xml.ignoreWhite = 1;

      //

      menu_cfg_xml.onLoad = function(ok) {

      // create main menu after successful loading of XML

      if (ok) {
      create_menu();
      } else {
      trace("XML not loaded");
      }
      };


      //
      counter = 1;
      function create_menu() {
      while (counter<menu_cfg_xml.firstChild.childNodes.length ) {
      attachMovie("button_type", "btn"+counter, counter);
      set("btn"+counter+"._y", counter*26-26);
      btn1._y = 0;

      // set the buttons text

      set("btn"+counter+".the_text", menu_cfg_xml.firstChild.childNodes[counter].attributes.texto);
      set("btn"+counter+".the_url", menu_cfg_xml.firstChild.childNodes[counter].attributes.url);
      set("btn"+counter+".the_target", menu_cfg_xml.firstChild.childNodes[counter].attributes.target);
      this["btn"+counter].onRollOver = this["btn"+counter].onDragOver=function () {
      this.effect.gotoAndPlay(2);
      this.textul1.textColor = "0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color2;
      };
      this["btn"+counter].onRollOut = this["btn"+counter].onDragOut=function () {
      this.textul1.textColor = "0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color1;
      this.effect.gotoAndPlay(9);
      };
      this["btn"+counter].onRelease = function() {
      if (this.the_url != undefined and this.the_url != "") {
      getURL(this.the_url, this.the_target);
      }
      };


      //set buttons color


      this["button_color"+counter] = new Color("btn"+counter+".btn_color");
      this["button_color"+counter].setRGB("0x"+menu_cfg_xml.firstChild.childNodes[0].attributes. button_color);

      //set button effect color

      this["effect_color"+counter] = new Color("btn"+counter+".effect");
      this["effect_color"+counter].setRGB("0x"+menu_cfg_xml.firstChild.childNodes[0].attributes. effect_color);

      //set button text color

      this["btn"+counter].textul1.textColor = "0x"+menu_cfg_xml.firstChild.childNodes[0].attributes.text_color1;
      counter++;
      }
      _parent._visible = true;
      info_clip._visible = false;
      }