12 Replies Latest reply on Apr 8, 2009 9:53 AM by fastpicker89

    Basic Flash Page, Script Help Please!

    Level 1

      So, I realize I'm an idiot, but I'm trying to teach myself flash because I need to make a basic flash page.  I am going by this tutorial:

       

      http://www.flash-game-design.com/flash-tutorials/basic-Website-flash-tutorial.html

       

      I have modified it (going step by step mind you) and now that it's over, instead of the page loading normally, it just goes from page to page without clicking on a link at all.  Just goes from home, to about, to artists, etc.

       

      I get no errors so... I'm a little lost.

       

      I've uploaded the swf for reference.

        • 1. Re: Basic Flash Page, Script Help Please!
          Ned Murphy Adobe Community Professional & MVP

          Do you have stop(); commands for each frame (section) of the sections?

          • 2. Re: Basic Flash Page, Script Help Please!
            Level 1

            Phew!  Well, I'm an idiot again.  I just completely forgot to do that on a few movieclips but went through and fixed it...  So thanks for reminding me!

             

            However, now I have a different problem... none of my buttons are working.  I've uploaded the new .swf and here is the script being used:

             

            sections.gotoAndStop("home");
            home_btn.onRelease = function() {
                sections.gotoAndStop("home");
                sections.home.gotoAndPlay(2)
            };
            about_btn.onRelease = function() {
                sections.gotoAndStop("about");
                sections.about.gotoAndPlay(2)
            };
            artists_btn.onRelease = function() {
                sections.gotoAndStop("artists");
                sections.artists.gotoAndPlay(2)
            };
            tours_btn.onRelease = function() {
                sections.gotoAndStop("tours");
                sections.tours.gotoAndPlay(2)
            };
            contacts_btn.onRelease = function() {
                sections.gotoAndStop("contacts");
                sections.contacts.gotoAndPlay(2)
            };

             

             

            I notice that I'm not able to create an instance name for the buttons under propterties... (I'm on a mac).  Could that be an issue?

            • 3. Re: Basic Flash Page, Script Help Please!
              Ned Murphy Adobe Community Professional & MVP

              Looking at your swf won't help much.  It's more likely a matter of timing, though a test to see if your buttons are working is to put a trace inside them and see if it produces an ouput....

               

              about_btn.onRelease = function() {

                 trace("about btn works okay");
                  sections.gotoAndStop("about");
                  sections.about.gotoAndPlay(2)
              };

               

              etc...

               

              If you don't see a trace in the output when you test the movie and click the button(s), then yes, your buttons aren't working, and there's a small list of possible problems... check the instance names, check the AS version, check the location of the code versus the buttons...

               

              When you call gotoAndStop(anything).... it requires time to get to that frame, but meanwhile, the next line of code... gotoAndPlay(2) is already being processed...  the code doesn't wait for you to arrive in the section.  So you may just want to forego that second line of code and remove any stop();s from frame 1 of the sections.  You'll know better as to why you have to tell it to go to frame 2 and can maybe resolve that aspect for yourself.

              • 4. Re: Basic Flash Page, Script Help Please!
                Level 1

                No luck.  I tried the test and all was ago.  Instance names were good to go.  Getting rid of that second line of code didn't do anything.  The actionscript should be fine.

                 

                I just want to make sure I mean... the script would go on the page where buttons are right?  Like it's a background movieclip and the actual buttons are on that movieclip, and the script has its own layer there and that's where the actionscript is.

                 

                Any thoughts?

                 

                Also, If you check that .swf, you'll see that if you double click on the word "home" it disappears... why would it do that?

                 

                Is there anyway I could send you the file to check out??

                • 5. Re: Basic Flash Page, Script Help Please!
                  Ned Murphy Adobe Community Professional & MVP

                  I always say to doublecheck the instance names... you'd be surprised how often some says they're okay when they're not.  Sometimes they are using library names, not instances names, and something they simply did not assign instance names.

                   

                  Your description of how the buttons are related to a movieclip isn't clear, but if the traces I mentioned come out, then the buttons are working.

                   

                  I wish there was a way I could see the full set of messages for this posting (like the old system)... at this point I have to guess what I remember seeing...  Do you have frame labels in your section mc that match the calls in your buttons functions?

                   

                  For the home page issue... If it disappears it is likely going to another frame.  If a command says gotoAndPlay... and you're already there, it will advance in the timeline even if there is a stop in that frame (the stop is used up)

                   

                  Here's a routine that worked for another posting as far as getting the file to upload in the forum...

                   

                  1) zip the fla file

                  2) rename the zip file to have a txt extenstion

                  • 6. Re: Basic Flash Page, Script Help Please!
                    Level 1

                    Hey I tried the change .zip to .txt.  Think you could take a look at it for me?

                    • 7. Re: Basic Flash Page, Script Help Please!
                      Ned Murphy Adobe Community Professional & MVP

                      It looks like you're using CS4 to create the file.  I have CS3, so I can't open the file.

                      • 8. Re: Basic Flash Page, Script Help Please!
                        Level 1

                        Hey sorry, this one should work.

                        • 9. Re: Basic Flash Page, Script Help Please!
                          Ned Murphy Adobe Community Professional & MVP

                          This would have required triple-asking and double-telling... you don't have anything assigned instance names.  Instance names are assigned in the Properties panel--the library names you assign are not instance names, they are simply names for keeping track of things in the library.  So click on all the things that need them (including the sections mc) and start naming things to agree with your code.

                          • 10. Re: Basic Flash Page, Script Help Please!
                            Level 1

                            Okay, that definitely would help.  The only issue is that I am using a mac version of Flash and cannot for the life of me figure out how to change the instance names for anything.  It isn't in the properties panel where it should be, but I guess that's a whole 'nother problem!

                            • 11. Re: Basic Flash Page, Script Help Please!
                              Ned Murphy Adobe Community Professional & MVP

                              I avoided CS4 for numerous reasons, and if the properties panel doesn't include a place for the instance name, that just adds to the list.  You need to select an object (component, textfield, movieclip or button symbols) for the instance name entry box to appear in the panel.  So try that first.  Here is what it looks like in CS3...

                               

                              ppanel.gif

                              • 12. Re: Basic Flash Page, Script Help Please!
                                Level 1

                                My friend, I thank you so much.  I FINALLY got it all figured out.  If you'll excuse my french, this damn mac version is so hard to get around.  It's not at all like the windows version God bless it.  So thanks, you really helped me out.