9 Replies Latest reply on Aug 17, 2013 5:16 AM by kglad

    Html counter into flash movie

    Acidhunter Level 1

      Hello All !

       

      I bought a flash template for my new webpage who are created with actionscript 2

       

      To put it out simply i want to add my html counter (who come from www.chart.dk ) that i used for years now, into my new flash site.

       

      I would like to add the counter code to an html file that flash load in a frame each time somebody enter my site.

      After alot of tests and search on the web i didnt find any usefull information yet how to do this.

      I try to put the code in text files as well that flash load but it dont work correct.

       

      I am new into flash so i need to be guided well about the method to do this.

       

       

      Here is what i want to load in my flash movie:

       

      http://cluster.chart.dk/chart.asp?id=71496

       

      the code for the counter:

       

       

      <!-- chart.dk unified trackercode - v1 -->

      <script src="http://www.chart.dk/js/unified.asp"></script>

      <script language="javascript">

      track_visitor(71496, "");

      </script>

      <noscript>

      <a href="http://www.chart.dk/ref.asp?id=71496" target="_blank">

        <img src="http://cluster.chart.dk/chart.asp?id=71496" border="0" alt="Chart.dk">

      </a>

      </noscript>

      <!-- chart.dk unified trackercode - v1 -->

       

       

      who i need to insert in my flash movie.

       

      Hope someone can help me out with this because i try by myself for a month now without any good results.

      Thanks.

        • 1. Re: Html counter into flash movie
          kglad Adobe Community Professional & MVP

          copy that js code into the html file used to embed your swf.

          • 2. Re: Html counter into flash movie
            Acidhunter Level 1

            Hello.

             

            I tried this already but the counter dont stay inside the frames of the movie/swf ! it shows up under it, if i embed it in my index.html file for my swf.

             

            This i why i want to implant this counter code in the movie to show up in a corner for example of the swf.

            • 3. Re: Html counter into flash movie
              kglad Adobe Community Professional & MVP

              then remove the anchor and image tags and load that image:

               

              var mc:MovieClip = this.createEmptyMovieClip("mc",1);

              mc.loadMovie("http://cluster.chart.dk/chart.asp?id=71496")

               

              p.s.  please mark helpful/correct responses.

              1 person found this helpful
              • 4. Re: Html counter into flash movie
                Acidhunter Level 1

                Hi kglad

                 

                Thanks for your response.

                 

                The code you wrote, works perfect to load the picture.

                I am not sure yet if the counter will work with only this.

                I will test it a day or two on a test subsite to see if the visits raise with only this picture load.

                Do you have any idea about if i also can hyperlink on this picture with mouse over and click ?

                (a code to do that as in the example i put above)

                Also, i would apreciate alot if you can tell me how to adjust the position of the counter in my movie with the code you already wrote.

                I run a template who can be viewed in normal screen mode + full screen option.

                 

                I will mark your reply as helpful because it def maked me move on compared to earlier.

                 

                Thanks for your time and help.

                • 5. Re: Html counter into flash movie
                  kglad Adobe Community Professional & MVP

                  sure.  add an onRelease method to the target movieclip AFTER loading is complete.

                   

                  you can position your image by assigning _x,_y properties to the target movieclip.  you can do that before loading is complete.

                   

                  your counter should work as long as you leave the rest of the javascript in your embedding html.

                  1 person found this helpful
                  • 6. Re: Html counter into flash movie
                    Acidhunter Level 1

                    Hi kglad,

                     

                    i have try to position the movieclip after load but it only fit to my screen (screen resolution)

                    can i use somekind of other code so the position of the counter/movieclip follow the resolution ?

                     

                    here is what i did

                     

                    var mc:MovieClip = this.createEmptyMovieClip("mc",1);

                    mc.loadMovie("http://cluster.chart.dk/chart.asp?id=71496")

                    setProperty(mc,_x,3600);

                    setProperty(mc,_y,25);

                     

                    and here are the link for the test web

                    http://www.aciex.dk/testfinal

                     

                     

                    Hope you can help with this.

                    I couldnt find much info about it on the web after several og hours , probably because i dont search for the right things.

                     

                    cheers

                    • 7. Re: Html counter into flash movie
                      kglad Adobe Community Professional & MVP

                      use:

                       

                       

                       

                      var mc:MovieClip = this.createEmptyMovieClip("mc",1);

                      mc.loadMovie("http://cluster.chart.dk/chart.asp?id=71496")

                      mc._x=3600; //<- that's going to be off-stage. use something less than your stage width minus the widget's width

                      mc,_y=25;

                      • 8. Re: Html counter into flash movie
                        Acidhunter Level 1

                        Hi , thanks for your answer.

                         

                        Unfortunately the code move the logo text (to the left) and the small bottons (to the right) away from the long bar now.

                        The long bar lost its transition effect as well (move down when hit a menu)

                         

                        What i did now is to use the

                         

                        setProperty(mc,_y,25);

                         

                        instead of the

                         

                        mc,_y=25;

                         

                        so now it works again but it didnt change anything about the screen resolution to make the counter graphic (mc) follow the screen resolution with the mc._x=3600;

                         

                        Maybe the complete code shall be placed somewhere else now ?

                        Do you have any idea's and do you want to take a look at the source file ?

                        Let me know so i can give it to you.

                         

                        Thanks again for your help and patience with me.

                        • 9. Re: Html counter into flash movie
                          kglad Adobe Community Professional & MVP

                          the code in message 7 works for me to position that counter.

                           

                          i don't know what else you're trying to do with the screen resolution, your "small bottons" and long bar.

                           

                          i don't download and correct files unless i'm hired.  free help i give in the adobe forums.