8 Replies Latest reply on May 23, 2006 11:48 AM by juroo

    how to rename a model

    dsdsdsdsd Level 1
      hello;

      is there way to rename a model?

      thanks
      dsdsdsdsd
        • 1. Re: how to rename a model
          a¿ex Level 1
          You can't rename a model.
          You must create a new one with the desired name and delete the old one.
          Check out my scenelist tool, which does exactly this.
          < http://www.farbflash.de/cgi-bin/blosxom.cgi/Dokumente/Director/Tools/scenelist.html>

          I've put up the script to "rename" a node:
          < http://www.farbflash.de/cgi-bin/blosxom.cgi/Dokumente/Director/Snippets/cloneNode.html>

          use it like:
          scr = new(script "Nodefunctions2")
          renamedNode = scr.mRenameNode(member("scene"), member("scene").model("oldName"), "newName")

          This partly covers your other question with the childnode names as well, as you can change the mCloneNode handler to handle child names in another way, than putting a "_clone" after the original name. it is more a problem of how do you want to setup the handler to "know" what name you would like for which child node...

          HTH
          • 2. Re: how to rename a model
            dsdsdsdsd Level 1
            a¿ex , thanks for your response
            • 3. Re: how to rename a model
              juroo Level 1
              quote:

              Originally posted by: a¿ex
              You can't rename a model.



              That's not true. It's simple and it works:

              your_model.name = string( new_name )

              no problem
              • 4. Re: how to rename a model
                a¿ex Level 1
                quote:

                Originally posted by: juroo
                quote:

                Originally posted by: a¿ex
                You can't rename a model.



                That's not true. It's simple and it works:

                your_model.name = string( new_name )

                no problem



                I don't know, what kind of models in what kind of application you're talking about.
                I thought the OP meant a 3-D model in a shockwave3d scene in director.
                I don't believe you are, as it is completely strange, that you won't get an "Access unsupported" error then, whne trying to change the name of a model in a director 3-D scene.
                At least I do not know any version, which allowed that.
                What's your version of director?

                • 5. Re: how to rename a model
                  juroo Level 1
                  hmm... interesting, I'm talking about the same thig and I have really never had problems with that. I'm using Director MX 2004.
                  • 6. Re: how to rename a model
                    a¿ex Level 1
                    quote:

                    Originally posted by: juroo
                    hmm... interesting, I'm talking about the same thig and I have really never had problems with that. I'm using Director MX 2004.


                    are you saying, that you can open your message window and type + execute the following lines without an error message with the model being renamed to "foo2" ?????


                    scene = new(#shockwave3d)
                    mo = scene.newModel("foo")
                    mo.name = "foo2"


                    I would be more than only surprised, if you wouldn't get an "Access not supported" error message.

                    • 7. Re: how to rename a model
                      Level 7
                      Interesting. I cannot rename a model in a 3D member in MX2004. I get access
                      not supported as a?ex suggested.

                      Also, if you look up the name(3D) property in Help you will find this: "You
                      can only get the name; the name can't be changed."


                      --
                      Dave -
                      Adobe Community Expert
                      www.blurredistinction.com
                      www.macromedia.com/support/forums/team_macromedia/


                      • 8. Re: how to rename a model
                        juroo Level 1
                        2 a¿ex: you are right. I'm sorry, today I looked at my code and found out that it was something else... it throws the same error message. Once again - sorry, what I said was a mistake.