5 Replies Latest reply on Jun 19, 2006 7:17 PM by kglad

    External control of movie

    cbergeronlcc Level 1


      We need to have a physical input device control the display for a museum exhibit. I know Flash can't take input from the game port.

      We've come up with building a custom interface device that can feed a stream of characters, and I'm thinking that if it can "type" those into an input text field, that should be able to control the movie. (Need to go to different frames depending on the input data.)

      But I'm having a terrible time getting it to work. I can type into the field, and the movie goes to that frame (gotoAndStop) but then it won't accept any further input.

      I'm really stymied, and would appreciate any assistance.
        • 1. Re: External control of movie
          kglad Adobe Community Professional & MVP
          what code are you using?
          • 2. Re: External control of movie
            cbergeronlcc Level 1
            The core is:

            posframe = Number(_root.inputTextBox1a.framepos.text)
            gotoAndStop(posframe);

            I've tried a bunch of different things - defining the input field as a button and putting it in an onClipEvent handler, defining the series of frames as a movieClip and putting it in an onEnterFrame handler, putting it as a script all by itself in a layer, assigned to the frame... nothing works the way I want it to.

            I'm willing to entertain suggestions for a better way to do it. We want to be able to have a visitor move physical controls and have that control the playback of the file. The developers don't want to use the mouse (which would be near-trivial) because it only has two dimensions, and we could easily have a need for three, four, or more input dimensions.
            • 3. Re: External control of movie
              kglad Adobe Community Professional & MVP
              if you use trace(posframe) do you see what you expect? if not check the textfield's path/instance name and make sure it's not html-enabled (ie, no auto-kerning checked in the properties panel). if so, you should be using the goto method, not the goto function:

              somepath.timeline.gotoAndStop(posframe);
              • 4. Re: External control of movie
                cbergeronlcc Level 1
                trace(posframe) gives expected results most of the time, depending on where I have the script.

                I wasn't aware there was an operational difference between a function and a method. I'll look at that. Can you point me to some documentation that explains it? All I've got is the docs that ship with MX.

                Now to the next part: how to keep the focus in the text field? Other team members are working on an app to take joystick input and turn it into integers, which they will send to the screen as keystrokes. I need to have the Flash move start with the focus in that text field, so the keystrokes land in the field.
                • 5. Re: External control of movie
                  kglad Adobe Community Professional & MVP
                  the goto function is known to have bugs. i'm not sure macromedia has acknowledged this.

                  the bug is sporadic but i believe can be reproduced by using scenes and moving a latter scene to the first scene position.

                  use Selection.setFocus(yourTextField) to set the focus on yourTextField.