1 Reply Latest reply on May 15, 2008 8:34 AM by kglad

    help with this code

    Philot
      Hi all,

      I will start by saying that I never really learned action script and the code I post came mostly from a tutorial that I did and I am now trying to get it to do what I want. That said "it" is a carousel menu and it currently puts a title on the "item" object on rollover I would however like it to just be there on load. I have tried all I know (which isn't much) but I cannot seem to get it to load from the get go so here is the code let me know if you need more.

      cheers
      Phil

      xml.onLoad = function()
      {
      var nodes = this.firstChild.childNodes;
      numOfItems = nodes.length;
      for(var i=0;i<numOfItems;i++)
      {
      var t = home.attachMovie("item","item"+i,i+1);
      t.angle = i * ((Math.PI*2)/numOfItems);
      t.onEnterFrame = mover;
      t.toolText = nodes .attributes.tooltip;
      t.icon.inner.loadMovie(nodes
      .attributes.image);
      t.r.inner.loadMovie(nodes .attributes.image);
      t.icon.onRollOver = over;
      t.icon.onRollOut = out;
      t.icon.onRelease = released;
      }
      }

      function over()
      {
      home.tooltip.tipText.text = this._parent.toolText;
      home.tooltip._x = this._parent._x;
      home.tooltip._y = this._parent._y + 30;
      home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
      home.tooltip._alpha = 100;
      }

      function out()
      {
      delete home.tooltip.onEnterFrame;
      home.tooltip._alpha = 0;
      }
        • 1. Re: help with this code
          kglad Adobe Community Professional & MVP
          use the attach code option to display code in this forum.

          and it looks like there's only one textfield in that carousel so you can't label all the items unless you create more textfields.

          the easiest way to do that and accomplish what you want would be to add a textfield to the movieclip with linkage id = "item". give it an instance name and use the path/name to assign its text property (which is on the right-hand-side of t.toolText).