19 Replies Latest reply on Jul 21, 2009 5:29 AM by DevPas

    link to external movieclip from html text box

    DevPas Level 1

      Hello,

       

      Simple question;

       

      How do I link from my dynamic txt box (html) to an external movieclip (popup)

       

      The only thing I found was a <A HREF="http://www.yoursite.com" TARGET="frame_Name">

       

       

      What I need is a link/action from my html (AS2);

       

      on (release) {

      loadMovieNum("01_mymovie.swf", 9);

      }

      Any suggestions.
      Thanks
      Pascal
        • 1. Re: link to external movieclip from html text box
          kglad Adobe Community Professional & MVP

          use the flash asfunction() to create your link and the getURL() function open yoursite.com

          • 2. Re: link to external movieclip from html text box
            DevPas Level 1

            Hi kglad,

             

            that's not what I need. I need to load an external  movie when a text link in a textbox is clicked.

            • 3. Re: link to external movieclip from html text box
              kglad Adobe Community Professional & MVP

              you want to load an external swf inside your main swf (use asfunction() and loadMovie() or loadMovieNum() or loadClip() ) or you want to open a url like you showed in your first message  (use asfunction() and getURL() )?

              • 4. Re: link to external movieclip from html text box
                DevPas Level 1

                Hi Kglad,

                 

                I'm sorry for the confusion.

                 

                I working on a full flash presentation.

                 

                Got a main movie with navigation.

                 

                When a menu item is selected the item load in the main movie (in an empty movieclip) works fine.

                 

                Now there's one (menu)item (seperate movie) with a lot of text, so I used a dynamic textbox (set to render as html).

                 

                And in this text there are some words which should be clickable, and open extra info (image or text) in a small pop-up.

                 

                So I thought load an external swf (popup) in an empty movieclip, but I don't know how to add such actions/links to my textbox-text.

                 

                Hope this explains my problem a bit better.

                 


                Thanks,

                 

                Pascal

                • 5. Re: link to external movieclip from html text box
                  kglad Adobe Community Professional & MVP

                  use the asfunction() with loadMovie(), loadMovieNum() or loadClip().

                   

                  because you already know how to load a swf you only need to learn about the asfunction().  check the flash help files.  there is an example of how to use it.

                   

                  make a reasonable attempt to code this yourself.  if you have trouble, post the code you tried and i'll correct it.

                  • 6. Re: link to external movieclip from html text box
                    DevPas Level 1

                    I'm a bit confused about the as function.

                     

                    So far I have:

                     

                    A dynamic txt box (instant name 'My_txt')

                    In an action layer I use 'my_txt.htmlText = "<P>bla bla<A>textlink</A></P><BR><P>bla.</P>";

                     

                    But I can't find a solution to add .on (release) {loadMovieNum("01_mc_popup.swf", 10);} (<- which will show an external movieclip popup image).

                     

                    It doesn't seem logical to me, to add such ascript to the html text.

                     

                    Should I use variables or create external html pages...

                     

                    Pascal

                    • 7. Re: link to external movieclip from html text box
                      J4zz3d Level 1

                      This is similar to the problem I have been having.  I would like to design a photo gallery within my Flash website.  Originally, I tried to add links and transitions for the photos in my gallery to the .swf file for my site.  This made the file too cumbersome and problems began cropping up that were beyond me.  I would like to design another .swf file for the photo gallery only, but I would like to link to it from the .swf file for my site.  My question is essentially: how do I link to an external file from an .swf file?

                      • 8. Re: link to external movieclip from html text box
                        kglad Adobe Community Professional & MVP

                        i'm not sure about your sense of logic but the following should get you close:

                         

                         

                        function loadF(fileName:String) {
                        yourtarget.loadMovie(fileName);
                        }
                        }
                        yourTF.htmlText = "<a href:'asfunction:loadF,yourswf.swf'>link</a>"; 
                        • 9. Re: link to external movieclip from html text box
                          J4zz3d Level 1

                          Um...thanks?  I'll see if it works.

                          • 10. Re: link to external movieclip from html text box
                            kglad Adobe Community Professional & MVP

                            there's an extra right curly bracket that should be removed and that colon ( : ) should be an equal sign ( = ).

                            • 11. Re: link to external movieclip from html text box
                              J4zz3d Level 1

                              Maybe I was unclear.  I have designed a site using Flash.  When I click on one of my links, I want it to open another flash file.  Can you show me how to do that with Actionscript?

                              • 12. Re: link to external movieclip from html text box
                                J4zz3d Level 1

                                Never mind.  I figured it out!  Thanks for your time anyway.

                                • 13. Re: link to external movieclip from html text box
                                  DevPas Level 1

                                  Hi kglad,

                                  I'm on the flash project again....
                                  But still I can't get it right. Could you explain what the mentioned lines do. I wrote aside what I think it does ...

                                  function loadF(fileName:String) {    <-- defines the movie to load
                                  yourtarget.loadMovie(fileName);    <-- defines where the loaded movie should be played
                                  };
                                  my_txt.htmlText = "My first line of text.<BR>
                                  And here is my " <a href:'asfunction:loadF,popup_01.swf'>links to a popup swf</a> and the rest of the txt";     <-- here's where you define the as to a link but again mention the movie's target.



                                  I thought it should be like plain html '<p>My first line of text and <a href="/popup.swf" target="_blank">mylink</a> rest of the txt </p>'

                                  I think this is what makes it confusing for me.

                                  Hope this isn't for you.

                                  • 14. Re: link to external movieclip from html text box
                                    DevPas Level 1

                                    Hi kglad,

                                    I'm on the flash project again....
                                    But still I can't get it right. Could you explain what the mentioned lines do. I wrote aside what I think it does ...

                                    function loadF(fileName:String) {    <-- defines the movie to load
                                    yourtarget.loadMovie(fileName);    <-- defines where the loaded movie should be played
                                    };
                                    my_txt.htmlText = "My first line of text.<BR>
                                    And here is my " <a href:'asfunction:loadF,popup_01.swf'>links to a popup swf</a> and the rest of the txt";     <-- here's where you define the as to a link but again mention the movie's target.



                                    I thought it should be like plain html '<p>My first line of text and <a href="/popup.swf" target="_blank">mylink</a> rest of the txt </p>'

                                    I think this is what makes it confusing for me.

                                    Hope this isn't for you.

                                    • 15. Re: link to external movieclip from html text box
                                      DevPas Level 1

                                      Anyone,

                                       

                                      This is what's in my script  layer;

                                       

                                      function loadF(fileName:String) {
                                      yourtarget.loadMovie(fileName);
                                      }
                                      my_txt.htmlText = "first line of text<BR>With "
                                      +"<a href='asfunction:loadF,01_link_popup.swf'>link01</a>";
                                      "even more text and another ";
                                      +"<a href='asfunction:loadF,02_link_popup.swf'>link02</a>";

                                       

                                      It puts the 'my_txt' in the html textbox,

                                      there is a link in the txt  'link001'

                                       

                                      But I don't see the rest of the txt

                                      and my link isn't opening the popup '01_link_popup.swf'

                                       

                                       

                                      Can anyone help me out with this scripting thing.

                                       

                                      Thanks

                                      • 16. Re: link to external movieclip from html text box
                                        Ned Murphy Adobe Community Professional & MVP

                                        Make sure you have the textfield designated to be multiline.

                                        • 17. Re: link to external movieclip from html text box
                                          DevPas Level 1

                                          Hi Ned,

                                           

                                          It already is. I think it is my code but as a designer I'm not sure 

                                          what's wrong.

                                          Even if I check my code, Flash tell's me there's no error.

                                           

                                          This is the 'example' code I use;

                                           

                                          function loadF(fileName:String) {

                                          yourtarget.loadMovie(fileName);

                                          }

                                          my_txt.htmlText = "first line of text
                                          With " +"link01" "even more text and another " +"link02
                                          ";

                                           

                                           

                                          Op 28-mei-2009, om 18:19 heeft Ned Murphy het volgende geschreven:

                                           

                                          Make sure you have the textfield designated to be multiline.

                                          >

                                          • 18. Re: link to external movieclip from html text box
                                            DevPas Level 1

                                            Still have trouble with this script;

                                             

                                            function loadF(fileName:String) {
                                            yourtarget.loadMovie(fileName);
                                            }
                                            my_txt.htmlText = "first line of text<BR>With "
                                            +"<a href='asfunction:loadF,01_link_popup.swf'>link01</a>"
                                            "even more text and another "
                                            +"<a href='asfunction:loadF,02_link_popup.swf'>link02</a>";

                                             

                                            It shows my text in the dynamic textbox but stops after 'wtih link01'

                                            And my link doesn't work (it acts like a link when I hover)

                                             

                                            Anyone who can help me out

                                             

                                            Thanks

                                             

                                            Pascal

                                            • 19. Re: link to external movieclip from html text box
                                              DevPas Level 1

                                              I wonder if anyone could tell me what i'm doing wrong here?

                                              I'm not really into scripting but I would like to understand how it works in this 'simple' example mentioned above.

                                               

                                              Thanks very much,

                                               

                                              Pascal