3 Replies Latest reply on Apr 20, 2008 2:58 PM by stephen_

    Help Required !

    adnanyaseen1
      Hi, I am new in using Flash Components in Director. I have seen that there is not a lot of documentation or Help available on How to use Flash components in Director MX effectively. The problem that i have been facing is with Tree component. I have populated the tree which is on sprite 1 with the following code,

      if voidP(pSprite) then

      pSprite = sprite(me.spriteNum)

      tNewNode_Main = sprite(1).addTreeNode("Main Menu")
      pSprite.setIsBranch(tNewNode_Main,TRUE)

      -- Sub-Level Node
      tNewLeaf_Main_sub = tNewNode_Main.addTreeNode("Sub-Menu")
      pSprite.setIsBranch(tNewLeaf_Main_sub,TRUE)

      -- Add a Sub-Level Leaf
      tNewLeaf_Main_sub_link1 = tNewLeaf_Main_sub.addTreeNode("Link 1")
      tNewLeaf_Main_sub_link1 = tNewLeaf_Main_sub.addTreeNode("Link 2")
      tNewLeaf_Main_sub_link1 = tNewLeaf_Main_sub.addTreeNode("Link 3")

      end if
      end

      The Problem is that i want that when i expand the Tree and click on the Link "Link 1" then it should go the marker named "My_Link". But i dont exactly how to do this. I would appreciate if anyone can guide me through.

      Regards.
        • 1. Re: Help Required !
          Level 7
          > Hi, I am new in using Flash Components in Director. I have seen that there
          > is
          > not a lot of documentation or Help available on How to use Flash
          > components in
          > Director MX effectively.

          I can't help directly with this problem, but my advice in general is to
          avoid using Flash Components unless you're an experienced Flash user. I can
          recreate most of them from scratch quicker than I can figure out how to make
          them behave properly. E.g.: I used to use the Flash Component Buttons,
          which were the only one I could figure out how to make respond correctly to
          inputs. Then I discovered that their mere presence on the stage intercepted
          all keyboard input and prevented Director from even seeing that keys were
          being pressed. Replaced all the Flash buttons with either Director-standard
          buttons (comparatively dull and flat, but functional) or my own custom
          graphics (which I usually do anyhow), and it works perfectly.

          The documentation exists, by the way, but it's not in Director - it's in
          Flash. If you have any relatively recent version of Flash, you might be
          able to figure something out by looking at the documentation for that, but I
          still think it's just easier to avoid using them altogether. They seem to
          have been included in Director specifically to be used by people who also
          know Flash, and if you don't, they're not about to help you figure it out
          unless you also purchase that program.


          • 2. Re: Help Required !
            CenturyMan1979 Level 2
            set up a behavior script attached the the tree component and attach the code I have added to this message, now when you select ( not when you click arrow to open a branch ) a folder or file you will get the label of the item selected in the message window. Now you should be able to take that info and create a case statement that you can use to navigate your application.

            Also just a note, you can add a data item when you add a tree node like so, addTreeNode("Label", "Data") .Then you can access the data like you do the label in the code I provided except you just use the word data instead of label.


            • 3. Re: Help Required !
              stephen_ Level 1
              Something like this;