Welcome, Guest
  • Author Topic: Menu Tree Help  (Read 1095 times)

    Jerry Lowe

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    Menu Tree Help
    « on: 07/28/10, 13:07 »
    I cannot seem to end the process on layer 5.
    Every button I click is the same link.
    Please show me the correct code to help me if possible.





    /*
    //////////////////////////////////////////////////
    // menu instance on Stage
    // menu instance call flashdb.navigation.menuXML.as
    //////////////////////////////////////////////////
       var XMLFile:String = "xml/menu.xml"
    //////////////////////////////////////////////////
    */
    var listener = new Object();
    listener.onClickSection = function(evt:Object) {
        trace("HD15-FFlink:"+evt.value)
       trace("HD15-FF:"+evt.title)
       
       dhd15ff.duplicateMovieClip("dhd15ff"+y, y);
       trace("dhd15ff"+y+" created!");
       y++;
    }

    this.menu.addEventListener("onClickSection",listener);
    stopDrag();
       if (this._droptarget == "/target") {
       }else {
          //if the connector is not on target delete it and
          //update the variables and dynamic text field.
          removeMovieClip(this);
          trace("Before = "+dhd15ffUsed);
          dhd15ffUsed = dhd15ffUsed-1;
          trace("After = "+dhd15ffUsed);
          //update text field
          _root.displayBD.text = dhd15ffUsed;
       }


    dhd15ff._visible = false;
    dhd15ff.stopDrag();
    _parent.displaydhd15ffUsed = _parent.dhd15ffUsed;
    displayBD.text = _parent.dhd15ffUsed;
    var y = 1;







    var listener = new Object();
    listener.onClickSection = function(evt:Object) {
        trace("HDMI-FFlink:"+evt.value)
       trace("HDMI-FF:"+evt.title)
       
        dhdmi.duplicateMovieClip("dhdmi"+y, y);
       trace("dhdmi"+y+" created!");
       y++;
    }

    this.menu.addEventListener("onClickSection",listener);
    stopDrag();
       if (this._droptarget == "/target") {
       }else {
          //if the connector is not on target delete it and
          //update the variables and dynamic text field.
          removeMovieClip(this);
          trace("Before = "+dhdmiUsed);
          dhdmiUsed = dhdmiUsed-1;
          trace("After = "+dhdmiUsed);
          //update text field
          _root.displayBD.text = dhdmiUsed;
       }


    dhdmi._visible = false;
    dhdmi.stopDrag();
    _parent.displaydhdmifUsed = _parent.dhdmiUsed;
    displayBD.text = _parent.dhdmiUsed;
    var y = 1;


    « Last Edit: 07/28/10, 20:20 by papachan »

    papachan

    • Systems Administrator
    • *****
    • Posts: 507
      • View Profile
      • Air Flex Developer
    Re: Menu Tree Help
    « Reply #1 on: 07/28/10, 20:37 »
    Can you explain me better your code and which project are you using the tree menu, please? It could help me to understand.

    You can easily linking your events  through the event listener dispatched by "onClickSection".
    But you need to have some links data or titles data at your menu.xml config file.


    This is the place that the tree menu is linked to your project.

    Code: [Select]
    onClipEvent (load)
    {
        if (!_parent.XMLFile)
        {
            XMLFile = "xml/menu.xml";
        }
    }

    // [Action in Frame 1]
    var listener = new Object();
    listener.onClickSection = function (evt)
    {
        trace ("link:" + evt.value); // from menu.xml all link attributes
        trace ("title:" + evt.title); // from menu.xml all title atributes
    };
    this.menu.addEventListener("onClickSection", listener);

    ---
    dan

    Jerry Lowe

    • Server what's that
    • *
    • Posts: 2
      • View Profile
      • Email
    Re: Menu Tree Help
    « Reply #2 on: 07/29/10, 11:13 »
    Basically, I have listed the XML document to have links and titles. Just trying to get each movie clip to load for each category with drag and drop on taget properties. Each connector has a Category and Title.
    However with the code, several images keep showing up, its like they are all one 1 frame. I need them to be seperated, click by click.
    XML Sample :


    Code: [Select]
    <item title="HD/DB-HDMI-DVI" font_color="0xFFFFFF">
    <item title="HD Series" link="section HD">
    <item title="HD15FF" link="section HD15FFlink"></item>
    <item title="HD15-FS" link="section HD15-FSlink"></item>
                                    <item title="HD15-MM" link="section HD15-MMlink"></item>
                                    <item title="HD15-MS" link="section HD15-MSlink"></item>
                                    <item title="HD15-FTB" link="section HD15-FTBlink"></item>
                                    <item title="HD15-MTB" link="section HD15-MTBlink"></item>
                                    <item title="HD15F-5BNC" link="section HD15F-5BNClink"></item>
                                    <item title="HD15M-5BNC" link="section HD15M-5BNClink"></item>



    /*
    //////////////////////////////////////////////////
    // menu instance on Stage
    // menu instance call flashdb.navigation.menuXML.as
    //////////////////////////////////////////////////
       var XMLFile:String = "xml/menu.xml"
    //////////////////////////////////////////////////
    */
    var listener = new Object();
    listener.onClickSection = function(evt:Object) {
        trace("HD15-FFlink:"+evt.value)
       trace("HD15-FF:"+evt.title)
       dhd15ff.duplicateMovieClip("dhd15ff"+y, y);
       trace("dhd15ff"+y+" created!");y++;}
       
    this.menu.addEventListener("onClickSection",listener);
    stopDrag();
       if (this._droptarget == "/target") {}else {
          //if the connector is not on target delete it and  
          removeMovieClip(this);
          trace("Before = "+dhd15ffUsed);
          dhd15ffUsed = dhd15ffUsed-1;
          trace("After = "+dhd15ffUsed);
       }
    dhd15ff._visible = false;
    dhd15ff.stopDrag();
    var y = 1;
    « Last Edit: 07/29/10, 11:22 by papachan »

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Menu Tree Help
    « Reply #3 on: 07/29/10, 11:58 »
    if you dont set the x and y positions of the movieClip, they all apear in the left upper corner, in the order they are loaded.
    You have to calculate the next position and write the x and y parameters into the mc instance.
    happy flashing
    8)
    Ronald