9 Replies Latest reply on Feb 25, 2009 3:27 AM by Nanomedia

    Failing Xtras

    LorenLogic
      Hello, Director World! I'm a newbie but a longtime programmer. Everything I've attempted works in the Director IDE but the fileio and MUI Xtras fail when I preview in the browser! First, which of these six syntax choices (all copied or extrapolated from samples) is/are the best?:
      -- set fileIOInstance = new(xtra "fileio")
      -- set fileIOInstance = new xtra("fileio")
      -- set fileIOInstance = xtra("FileIO").new()
      -- fileIOInstance = new(xtra "fileio")
      -- fileIOInstance = new xtra("fileio")
      -- fileIOInstance = xtra("FileIO").new()
      Upon use, every one of them not only kicks me out of the handler immediately but also out of the script (where another handler in the same script calls the handler where I try to use fileio or MUI), leaving my movie working but without Xtra functionality. Yet they work just fine in the IDE. After many failures I manually added Modify>Movie>Xtras...>fileio.x32 and Mui Dialog.x32, but to no avail. Once I added them, when selecting them in the list, Include in Projector is checked but Download if Needed is grayed, unlike all but one of the other Xtras. They must have been included anyway by default for the IDE to work. In any case they showed up in the list when I put(_player.xtraList) before I added them manually.

      So what shall I do? I have to save and load the user's productivity or my project is worthless. Can anybody help? By the way, this is a 3D project, but I would guess using Xtras is pretty basic. Thank you, everyone!

      Loren

      Loren Logic, LLC.
        • 1. Re: Failing Xtras
          Level 7
          Those xtras are not shockwave safe (as you can tell by the fact that it
          won't let you select "Download if Needed"). You can not use them in
          shockwave at all (for security reasons).

          If you just want to save some data locally in Shockwave, you can use
          getPref() and setPref()
          • 2. Re: Failing Xtras
            UdoGre Level 1
            Hi Loren,

            You are aware that there is something like security? Xtras that might pose a risk to the users computer are not marked shockwave-safe and cannot be used with shockwave movies. And that is very good so.
            Maybe you can describe in more detail what you want to do on the users computer, and we can find another solution.

            HTH,

            udo
            • 3. Re: Failing Xtras
              LorenLogic Level 1
              Wow, quick answers! Thanks! It surprises me that there are Xtras that are unuseable in Shockwave-- that's the whole point of Director, I would have thought. Or are these Xtras only for stand-alone projectors? Writing to one's own hard drive is hardly threatening, in any case. My users use my movie to create little 3D animations of their own. They need to name and save and load and resave these animations, which also must auto-load and play for the users at startup. I can't get the MUI Xtra Alert to work for filename input, I can't get MUI dialog boxes to save or load, and I can't write the animation data files using fileio! Am I only able to create a stand-alone .exe projector? Thanks, guys!

              Loren

              Loren Logic, LLC.
              • 4. Re: Failing Xtras
                Level 7
                It is not necessarily just "writing files to your own hard drive"...
                think through the implications of allowing any shockwave content to
                write to anywhere on your hard drive... So, for example, going to a
                website with a small hidden movie could erase your whole c:\ drive. Or
                overwrite your preferences for things. Just because you may not be
                evil, Macromedia (and now Adobe) will not allow such evil to even be
                possible. So, to prevent that, you can only write to a sort of
                sandbox... using getPref and setPref are the preferred methods.

                From what it sounds like you are doing, a stand-alone projector would
                probably be better suited than a shockwave web-based application
                • 5. Re: Failing Xtras
                  LorenLogic Level 1
                  Thanks, Mike. MUI provides an 'Alert' that takes user input via Yes, No, Cancel buttons and the like. That is unavailable in Shockwave if MUI is unavailable, which cripples the product unnecessarily as those are not threatening to one's computer. MUI also provides fileSave() and fileLoad() dialog boxes that allow a user to browse his own hard drive, which could easily be restrictive to, say, non-system folders, yet could provide far more functionality than setPref's restriction to the Plug-In Support folder has. Instead, Shockwave practices security overkill by completely disallowing all the functionality of MUI. Talk about not thinking through the implications... A trojan one inadvertently saves to one's own Plug-In Support folder while saving desired content could run just as certainly as if one inadvertently saved it elsewhere! FileIO and MUI should work together so that fileio can only write to a folder pointed at BY THE USER via MUI. If I, a user, point to my own hard drive, I should be able to save data to my hard drive if I wish. How is that any less safe than setPref() writing things to my hard drive without even my knowledge? It's a huge negative Director could easily have avoided.
                  Anyway, thanks for your help. You saved me a lot of work trying to fix something that isn't even implemented And while projectors are my first target output, I won't surrender the whole world of web-based applications for one stupid Director decision. I'll just create a (probably kind of clumsy, without dialog boxes) work-around. But it leaves a bad feeling...

                  Loren

                  Loren Logic, LLC.
                  • 6. Re: Failing Xtras
                    Level 7
                    "Macromedia (and now Adobe) will not allow such evil to even be possible."

                    The Authorware plugin allowed full access to the disk. There was a
                    pop-up that asked if you trusted the site, and if you accepted it could
                    do anything including disable any future security warning message. It
                    was a huge security risk. Since the plugin was not widely distributed, I
                    guess it was never a big problem.


                    Mike Blaustein wrote:
                    > It is not necessarily just "writing files to your own hard drive"...
                    > think through the implications of allowing any shockwave content to
                    > write to anywhere on your hard drive... So, for example, going to a
                    > website with a small hidden movie could erase your whole c:\ drive. Or
                    > overwrite your preferences for things. Just because you may not be
                    > evil, Macromedia (and now Adobe) will not allow such evil to even be
                    > possible. So, to prevent that, you can only write to a sort of
                    > sandbox... using getPref and setPref are the preferred methods.
                    >
                    > From what it sounds like you are doing, a stand-alone projector would
                    > probably be better suited than a shockwave web-based application
                    • 7. Re: Failing Xtras
                      Level 7
                      OMG!

                      How can you say all this AND claim to be a longtime programmer?

                      Maybe I am missing something, but the security for web apps and
                      plugins is actually a good thing.
                      Maybe you want to achieve something other than you mention here?

                      Be prepared that even in projectors you will be limited in what you
                      can do to the users' system, especially now with Vista, and more and
                      more XP users working in limited accounts.

                      In OS-en other than Windows, this security was implemented from the
                      beginning, and people are used to it. For MS programmers, its still an
                      alien concept. Sadly.

                      If you need more info in security issues, feel free to ask. Might save
                      you lots of headaches.

                      Richard


                      • 8. Re: Failing Xtras
                        Brian Stew Level 2
                        Uh - Shockwave is the web 'version' of Director apps, so to speak. It's a pretty obvious concept, and of course it is more limited than projectors. Since you have opted for Shockwave distribution, you must assume that users are online when working with the app you made. You can let the users store their stuff online on a remote server instead of locally on their disk. This involves some server scripting, but the Director side of it is pretty simple; look up getNetText and all that. This method will be only more common, so learning how to do this would be a good investment in the future.
                        • 9. Re: Failing Xtras
                          Nanomedia Level 1
                          quote:

                          Originally posted by: LorenLogic
                          My users use my movie to create little 3D animations of their own. They need to name and save and load and resave these animations, which also must auto-load and play for the users at startup.


                          Really?
                          What kind of animations?
                          Or maybe with "little 3D animations" you mean "move object from (x1,y1,z1) to (x2,y2,z2)".