18 Replies Latest reply on Feb 5, 2007 7:20 AM by kglad

    Rollout Button Problems

    Freeky_Bonjela Level 1
      I have a button that when hovered over scrolls out to reveal the page. I then want it so that when someone rolls out from the button, it then scrolls back in to how it started. This seems to work ok, with just one small problem, the page doesn't necessarily always stay scrolled out, even if you don't move the cursor away from the hit area of the button. I have a flash file which contains a simplified version of the button as I would to achieve it working, and then on a separate layer my faulty button.
      I will email the aforementioned file to anyone who can please help?

      thanks
      iAN
        • 1. Re: Rollout Button Problems
          Freeky_Bonjela Level 1
          *UPDATE*
          I have figured out why the rollout aspect of my button was actioning despite the cursor still being within its hit area. It is because I have some input text within that respective movie clip. So when the cursor hovers over the input text it confuses the button into thinking the cursor has left the hit area. Anyone have any ideas how I can get around that?
          • 2. Re: Rollout Button Problems
            kglad Adobe Community Professional & MVP
            make your button a movieclip buttons and make your input textfield a child of that movieclip.
            • 3. Re: Rollout Button Problems
              Freeky_Bonjela Level 1
              yeah that works thanks.
              But now I can't get the button to action correctly so that once the cursor rolls out from the hit area it returns to the previous scene or movie it was contained in as just a button previously.
              Within this new movieclip that contains my button and input text I have tried giving the button the action
              on (rollOut) {
              gotoAndPlay("Scene 1", 16);
              }

              or

              on (rollOut) {
              prevScene();
              }
              but these don't do what I had hoped.
              How do i get my button to still continue the original movieclip from the new movieclip sits in the original?
              I think that makes sense :)
              • 4. Re: Rollout Button Problems
                kglad Adobe Community Professional & MVP
                don't use scene information in actionscript and don't use the goto functions. label your frames and use the goto methods. for example:

                • 5. Re: Rollout Button Problems
                  Freeky_Bonjela Level 1
                  That makes sense, so I labelled my frame "rollout" and used the code you suggested but it didn't work, so I'm obviously labelling or coding something wrong. I then tried different variations of that, but still no joy.
                  This is how it is structured:
                  I have the main timeline which is still named "main". In that is a movie clip on frame 45 named "txtbox-cont", and in there on frame 15 is a movieclip named "form-mc". In that movieclip, the form and button (called "form-bu") sit on frame 1 on the same layer.
                  When I rollout of 'form-bu' I want it to then continue to frame 16 (now named "rollout") of the movieclip 'form-mc'.
                  I have tried...

                  on (rollOut) {
                  _root;
                  gotoAndPlay("txtbox-cont_rollout");
                  }

                  Can you see what I'm doing wrong?
                  • 6. Re: Rollout Button Problems
                    arunbe Level 1
                    Here your code is wrong i think !
                    Look, You are having a from in the main time line named "rollout".
                    And you are having a movieclip in the first fram of the main time line.
                    When rollove a button in the clip should move you to the "rollout" frame in the main time.
                    So, you should use the code like this,

                    on (rollOut) {
                    _root.gotoAndPlay("rollout");
                    }

                    Cool....
                    • 7. Re: Rollout Button Problems
                      kglad Adobe Community Professional & MVP
                      first, you want your main (or _root timeline to goto frame 45): _root.gotoAndStop(45)

                      in that frame you have a movieclip with instance name txtbox-cont which is not possible because you can't use a dash in an instance name. it looks to flash like you're trying to subtract two variables.

                      but let's say you correct that and give it an instance name of txtbox_cont and you want to direct txtbox_cont to its frame 15: _root.txtbox_cont.gotoAndStop(15)

                      and on frame 15 of _root.txtbox_cont you have another movieclip with instance name form-mc which, again, is not possible. so let's call it form_mc and you want to direct _root.txtbox_cont.form_mc to its frame labelled rollout: _root.txtbox_cont.form_mc.gotoAndStop("rollout").

                      or:

                      • 8. Re: Rollout Button Problems
                        Freeky_Bonjela Level 1
                        Apologies for delay in response....first xmas, then moving house, ergo no internet, got in the way.

                        Thanks kglad and arunbe for your suggestions, but unfortunately neither of them give me the required result i'm afraid
                        Arunbe - When I rollout it does nothing. I will email you the file if you'd like to have a look?
                        Kglad - Now it just sends the movie back to the original timeline. I think I know what might be the problem, I think you are misunderstanding where my rollout frame is. The "rollout" frame isn't in form_mc.
                        form_mc is on frame 15 within txtbox_cont and then the next frame, frame 16, I've called rollout. So when i rollout of my button in form_mc it needs to direct to to txtbox_cont frame "rollout" (which is frame 16). I will try and play around with various root commands, but any further advice would be very welcome.
                        I would gladky email you the file too, please let me have your address if you'd like to try and help further

                        many thanks
                        iAN
                        • 9. Re: Rollout Button Problems
                          kglad Adobe Community Professional & MVP
                          if you want to direct _root.txtbox_cont to "rollout" use:

                          • 10. Re: Rollout Button Problems
                            Freeky_Bonjela Level 1
                            that doesn't seem to do the job either unfortunately. I did try...
                            _parent.gotoAndPlay("rollout");
                            ..though and that successfully allowed the page to rollout and minimise again. But now the problem i had right at the beginning has returned whereby when you hover over the input text boxes it rolls out aswell. It seems I can have only one or the other working, even if I put the button and form in a movie clip.

                            maybe i'm not understanding your original suggestion to "make your button a movieclip buttons and make your input textfield a child of that movieclip."
                            when you told me to do this, all I did was put my button and form input text on a layer inside a movie clip, is that what you meant?
                            • 11. Re: Rollout Button Problems
                              kglad Adobe Community Professional & MVP
                              if the code in my last message doesn't work it's because you don't have a movieclip with instance name _root.txtbox_cont that has a frame labeled "rollout".

                              and no, i didn't mean that you should put your button inside a movieclip. that would make your button a child of the movieclip.

                              i said, make your button a movieclip button. that means you should create a movieclip that contains up, over and down frames and place the graphics you want for those frames on-stage and place your textfield on-stage.

                              then define your mouse handlers that will direct your movieclip to the appropriate up, over and down frames, as well as, the other things you want to handlers to do.
                              • 12. Rollout Button Problems
                                Freeky_Bonjela Level 1
                                After plenty of hours not gettting anywhere I finally thought outside the box, quite literally, to come up with a solution. I figured why not make the hit area the surrounds to my text page and when they rollOver that then the page shrinks away. rather than a rollOut from the text page which was conflicting with my form. It works a treat. Thanks for all your help though, it kept me plugging away to find what i needed.
                                I do now have a different problem. I want to put in a button that onRelease will enable the user to download a file. I've seen a couple of suggestions online for this, but one of which i can get to work. Any suggestions?
                                • 13. Re: Rollout Button Problems
                                  kglad Adobe Community Professional & MVP
                                  use the filereference class.
                                  • 14. Re: Rollout Button Problems
                                    Freeky_Bonjela Level 1
                                    Sorry, you're gonna have to explain what file reference class is?
                                    • 15. Re: Rollout Button Problems
                                      kglad Adobe Community Professional & MVP
                                      use the flash help documents. for this one, they're very good. if you have questions after checking the help docs, let me know.

                                      i like to look under the class: help/actionscript 2.0 language reference/actionscript classes/filereference
                                      • 16. Re: Rollout Button Problems
                                        Freeky_Bonjela Level 1
                                        I couldn't find anything in the help docs. if you could help us out that would be great otherwise i'll keep hunting.

                                        For every problem i solve another one pops its head around the corner. I now have a problem with the Backspace button. I'll start a new thread to go into detail, but basically I want to disable Backspace to stop it going back a page in the history when i'm trying to correct a mistake in an input field of my form. I have found the necessary script to disable it completely, but that doesn't allow people to use it for deleting their text.
                                        any ideas?
                                        • 17. Re: Rollout Button Problems
                                          Freeky_Bonjela Level 1
                                          I couldn't find anything in the help docs. if you could help us out that would be great otherwise i'll keep hunting.

                                          For every problem i solve another one pops its head around the corner. I now have a problem with the Backspace button. I'll start a new thread to go into detail, but basically I want to disable Backspace to stop it going back a page in the history when i'm trying to correct a mistake in an input field of my form. I have found the necessary script to disable it completely, but that doesn't allow people to use it for deleting their text.
                                          any ideas?
                                          • 18. Re: Rollout Button Problems
                                            kglad Adobe Community Professional & MVP
                                            from the help files:

                                            The FileReferenceList class provides a means to let users select one or more files for uploading. A FileReferenceList object represents a group of one or more local files on the user's disk as an array of FileReference objects. For detailed information and important considerations about FileReference objects and the FileReference class, which you use with FileReferenceList, see the FileReference class.

                                            To work with the FileReferenceList class:

                                            Instantiate the class: var myFileRef = new FileReferenceList();
                                            Call FileReferenceList.browse(), to display a dialog box in which the user can select one or more files to upload: myFileRef.browse();
                                            After browse() is successfully called, the fileList property of the FileReferenceList object is populated with an array of FileReference objects.
                                            Call FileReference.upload() on each element in the fileList array.
                                            The FileReferenceList class includes a browse() method and a fileList property for working with multiple files.

                                            Availability: ActionScript 1.0; Flash Player 8

                                            Example
                                            The following example allows a user to select multiple files and then uploads each of them to a server.