4 Replies Latest reply on Nov 7, 2008 10:45 AM by clbeech

    Problem with interface

      Hi all,
      I hope one of you can help me. I am working on this interface design for a GE product. The interface is a series of wheels one would select a power level and would run 1 through 10. Right now it is running infinitely and I cannot set a limit on it. The other is running through different angles to select from 5 different points. The points all have instance names, but when I run it the wheel is not moving at all and I keep getting "mouse event could not be loaded" errors. I am attaching both sets of code, hopefully someone can help me. Also, if anyone knows where I would attach the code... to the layer or inside the movie clip??? Thanks!
        • 1. Re: Problem with interface
          kglad Adobe Community Professional & MVP
          are you publishing for as3?
          • 2. Re: Problem with interface
            clbeech Level 3
            ok there are a few items here. the problem with the first sections of code for the wheel is that you cannot assign multiple event handlers to the same object (in this case the stage) so it is likely that they are interfering with one another. it would be best, when handling multiple objects (wheels) to attach the listeners to the object itself, then each is individually controlled.

            the reason that the second wheel is running continuously is that the onEnterFrame event is 'always' being fired, to control it you need to place it inside a method that you then invoke in the same manner that you have the moveArrow method - ie. by adding/removing the Event listener. I'm a bit unclear on just 'what' you would like the 'second' wheel to do? do you want it to just 'scroll' up to 10 automatically or does one 'set' the power level - similar to the first section of code you have there.

            as far as 'where' to place you code: it is common to create a layer in the timeline usually called 'actions' and place the code there. however the code must be placed 'where' the wheel is instantiated or 'exsits' on the timeline. however when using AS3, it may also be best to place your codes within a class file that is then either a) attached to the document as the doc class or b) defines the class of the instance under it's own naming convention. with this method (b) the code will be available to each instance of a given MC instance. but there are other things to consider when using a class structure as well.

            your codes can be also be simplified a bit, the 'second' section of the wheel rotation 'stop' method looks like you are trying 'snap' the wheel to specific increments - and this can be done a bit easier really. I've created a quick example of how you can achieve this more efficiently HERE

            OT --------------------------
            sorry kg - been working on this a bit :)
            • 3. Re: Problem with interface
              kglad Adobe Community Professional & MVP
              i don't think he's even publishing for as3.
              • 4. Re: Problem with interface
                clbeech Level 3
                right on kg - heck if I know LOL!