0 Replies Latest reply on Sep 23, 2008 5:41 PM by danka21819

    Adding CDATA to an existing xml and flash asset

    danka21819
      Hi, I am a front end web designer/developer and analyst...struggling with putting an accordian flash xml menu together. I have it done except I need to add a simple trademark symbol circle with r. I am struggling with how to do this since I am not savvy in actioncript. I assume the best way is to add it is with a CDATA child node, but do not know how or whatever is the best way to get this done since am on a tight deadline. I need someone to explain step by step what I have to do to get this simple addition resolved. Attached are the links to home page and code for the xml file. The left navigation is the asset that I need to add the trademark symbol under about, about ADHERE. Thanks so much in advance!!!!!!
      [URL=http://www.nodcreative.com/natrecor_sliced/natrecor_index.html]index page with flash xml menu asset[/URL]

      xml code:

      <?xml version="1.0" encoding="UTF-8"?>
      <accodion>


      <item name="HOME">


      </item>


      <item name="ABOUT">


      <item name= "ABOUT ADHERE<![CDATA[write]]>"></item>

      <item name="Medical Information" url=" http://www.jnj.com?ref=Random">




      </item>
      <item name="About SCIOS" url=" http://www.jnj.com?ref=Random">
      </item>


      </item>

      <item name="INTERACTIVE DOSING INFORMATION">


      <item name="Indications and Usage" url=" http://www.jnj.com?ref=Random"></item>


      <item name="Contraindications" url=" http://www.jnj.com?ref=Random"></item>
      <item name="Warnings" url=" http://www.jnj.com?ref=Random"></item>
      <item name="Dosage and Administration" url=" http://www.jnj.com?ref=Random"></item>




      </item>
      <item name="RESOURCES AND TOOLS">

      <item name="NATRECOR PI" url=" http://www.jnj.com?ref=Random"></item>
      <item name="About Heart Failure" url=" http://www.jnj.com?ref=Random"></item>
      <item name="Stages of Heart Failure" url=" http://www.jnj.com?ref=Random"></item>
      <item name="NATRECOR Dosing Information" url=" http://www.jnj.com?ref=Random"></item>
      <item name="Patient Management Resources" url=" http://www.jnj.com?ref=Random"></item>


      </item>
      <item name="US PRESCRIBING INFORMATION">
      </item>
      <item name="IMPORTANT SAFETY INFORMATION ref=http://www.jnj.com">

      </item>

      <item name="REGISTRATION ref=http://www.jnj.com">

      </item>

      </accodion>

      FLASH actionscript is as follows:





      // The accordion
      var accordion = this

      // The item list
      var itemList = []



      //-----------------------------------------------------------
      // SETTINGS
      //-----------------------------------------------------------


      //-------------PROPERTIES----------------

      // Separation between the buttons
      var separation = 1.5

      // Tabulation between the buttons and the margin
      var tabulation = 10

      // if true, it cant be more than one items opened at the same time (only for the first buttons, POWERFUL, MENU ,ACCORDION, ets).
      var autoClose = true

      // if true, it cant be more than one subItems opened at the same time.
      var subItemAutoClose = true

      // if true, open and close all the subItems at the same time.
      var openAll = false

      // The height of the button
      var itemHeight = 21

      // The width of the button
      var itemWidth = 230

      // If true, show the light over the button
      var light = true

      // The ease of the menu opening
      var openEase = 2.5

      // The ease of the menu closing
      var closeEase = 2.5

      // The rollOut color fade speed
      var rollOutFade = 8



      //-------------COLORS----------------


      // The color of the button
      var buttonColor = 0xa

      // The roll over color
      var rollOverColor = 0xCCCCCC

      // The arrow color
      var arrowColor = 0xCCCCCC

      // The arrow color on roll over
      var rollOverArrowColor = 0x000000

      // The text color
      var TextColor = 0xFFFFFF

      // The text color on roll over
      var rollOverText = 0x000000



      //-----------------------------------------------------------
      // LOADING XML
      //-----------------------------------------------------------

      // The xml data
      var xmlSource:XML = new XML

      // Loading the xml
      xmlSource.onLoad = function(success:Boolean):Void {

      // When the load finishs...
      if (success) {

      // The first node of the xml
      xmlRoot = xmlSource.firstChild

      // The item nodes
      xmlItems = xmlRoot.childNodes

      // The total of items
      total = xmlItems.length

      // Creating the buttons
      for (i=0; i<total; i++){

      // Attaching the buttons
      accordion.attachMovie("item", "item" + i, i)

      // The button reference
      itemList = accordion["item"+i]

      // The first node of the item node
      itemList
      .xmlRoot = xmlItems

      // The separation between subitems
      itemList
      .separation = separation

      // Tabulation between the subitems and the margin
      itemList .tabulation = tabulation

      // subItems auto close
      itemList
      .subItemAutoClose = subItemAutoClose

      // The subitems height
      itemList .itemHeight = itemHeight

      // The subitems width
      itemList
      .itemWidth = itemWidth

      // shows/hides the subitems light
      itemList .light = light

      // The subitems color
      itemList
      .buttonColor = buttonColor

      // The roll over color
      itemList .rollOverColor = rollOverColor

      // The arrow color
      itemList
      .arrowColor = arrowColor

      // the arrow color on roll over
      itemList .rollOverArrowColor = rollOverArrowColor

      // The text color
      itemList
      .TextColor = TextColor

      // The roll over text color
      itemList .rollOverText = rollOverText

      // the opening easing
      itemList
      .openEase = openEase

      // The closing easing
      itemList .closeEase = closeEase

      // The roll over fade speed
      itemList
      .rollOutFade = rollOutFade

      // open all
      itemList .openAll = openAll

      }

      }

      }

      // ignore white
      xmlSource.ignoreWhite = true;
      // Loads the .xml file
      xmlSource.load("accordion.xml");



      // Aligning the items each one below the other
      this.onEnterFrame=function(){

      // Does the align to ALL the items
      for (i=1; i<total; i++){

      // Aligning the items
      itemList
      ._y = itemList[i-1]._y + itemList[i-1].mask._height + itemList[i-1].button._height + separation

      }
      // The cursor position
      cursor._x = _xmouse
      cursor._y = _ymouse

      }

      // Opens the items
      onMouseDown = function (){

      // Does this to all the buttons
      for (i=0; i<total; i++){

      // If is clicked
      if (itemList .button.hitTest(cursor)){

      // Shows the current item
      showCurrent(itemList
      )

      }

      }

      }

      // Shows the button clicked
      showCurrent=function(current){

      // Does this to all the buttons
      for (i=0; i<total; i++){

      // Does this to all the buttons exept the clicked
      if (itemList !=current){

      // Close the other items if autoclose = true
      if (autoClose){

      // Close the other items
      itemList
      .openBox=false

      // fades the roll over effect of the other items
      itemList .over = false

      }

      //Does this to the clcked item only
      } else {

      // If it has sub items
      if (total>0){

      //Hides them if its open
      if (itemList
      .openBox){

      itemList .openBox=false

      //Shows them if its closed
      } else {

      itemList
      .openBox=true

      }
      // If it has no subitems goes to the link
      } else {

      getURL(xmlRoot.attributes.url, _self)

      }
      }
      }
      }