5 Replies Latest reply on Oct 29, 2010 5:47 AM by flapjack199

    Internal link for button in FC


      Hello everyone,


      At the beggining I must say that I'm begginer in flash.

      Few hours ago I made menu for a website in flashcatalyst and the problem is that I can't connect the buttons with any internal links for my webpage. I saw the option in "make transitions" called "Go to url" bit I guess it can be used only for some external links. And that's the point - is there any way to use buttons as internal links?


      If you gonna say, that I will have to make some implements in Flash Builder, please tell me how exactly it should look like?




        • 1. Re: Internal link for button in FC
          flapjack199 Level 1

          any knows? I can't find answer for my question, can't find similar topics ;s

          • 2. Re: Internal link for button in FC
            SrinivasAnnam Adobe Employee



               Sadly, this is a known limitation in Flash Catalyst as of now. Since we don't allow copying of external files to the project, when you enter a internal link (relative URL), it will fail when you run project from Flash Catalyst and will work fine when you deploy the Flash Catalyst app and copy external files to the same folder.


              You can have a look at this bug and post your thoughts for future consideration - http://bugs.adobe.com/jira/browse/TH-10576


              Coming to the solution, you need to do a small modification in FlashBuilder to enter the correct internal link:


               Step 1. Add a "Go To URL" interaction on the required component in Flash Catalyst to some temporary URL & Save the project

               Step 2. Import your FXP Project file in Flash Builder

               Step 3. Open the MXML file & simply do a text search for the temporary URL that you entered earlier and modify it accordingly.

               Step 4. Save & Publish the project - Project->Export Release Build menu


               Let us know if you are able/unable to get this working.



            Srinivas Annam


            Here is the sample


               protected function button_clickHandler():void
                navigateToURL( new URLRequest( encodeURI("http://www.temporaryurl.com")), "_self");

            <fx:DesignLayer d:userLabel="Layer 1">
              <s:Button x="292" y="53" click="button_clickHandler()" skinClass="components.Button"/>

            • 3. Re: Internal link for button in FC
              flapjack199 Level 1



              But now I can see another problem. The hoover effect has change position a bit (it moved to the left).

              The second problem I see is that after click on menu, position from hoover doesn't change. I mean after I chose "contact" in menu bar, news stay still selected.

              Check out what I mean: http://ancik.ipns.pl/index.html



              What about that? Any ideas?

              • 4. Re: Internal link for button in FC
                SrinivasAnnam Adobe Employee



                    Glad to know that you got it working.


                   You can control the appearance of Hover effect by going to "Over" state of that component.


                   Regarding your second problem, its because you have content and buttons in the same HTML page and you are refreshing the whole page (which includes SWF) when user clicks on a button. so, refreshing the whole page reloads the SWF too which will load in its initial state.


                   Solution for this is to split your site in to two frames one always displaying header (Logo+Swf) and other always displaying contents ( News, Bio, etc.. ). Please see the sample code attached(index.html). In this, header.html will contain only the logo image & buttons SWF. And you load whatever page you want in the bottom frame.


                  Once you split your HTML page in to two frames, you can control the navigation from Flash using the frame name. You will have to goto all the lines where you modified the URL earlier and add an extra parameter of frame name.


                  Sample : navigateToURL(new URLRequest("news.html"),"contentFrame");




                Srinivas Annam

                • 5. Re: Internal link for button in FC
                  flapjack199 Level 1

                  Ok I think I got the point. My website already is included in PHP (that's mean that header (logo+swf) are in index.php and the content is contained in other's PHP link like "contact" for example.


                  As I understood, in this case (when header (logo+swf) are already included) it should be enough to add only the one implement in to links in flashbuilder right?