15 Replies Latest reply on Apr 20, 2006 6:59 AM by Newsgroup_User

    html code in flash

    davidrasta
      hi,
      i have the macromedia flash professional 8, and i'm building a web site in flash. Although i have some questions:

      1-

      I want to put a counter, a mp3 player and a mailing list code that is in HTML code how can i do it?

      example of the code of the counter:

      <!-- Start Bravenet.com Service Code -->
      <script language="JavaScript" type="text/javascript" src=" http://pub8.bravenet.com/counter/code.php?id=395396&usernum=635540990&cpv=2">
      </script>
      <!-- END DO NOT MODIFY -->

      the other codes are similar to this.
      2-

      I want to put a scroll bar in my flash website how can i do it?

      let me know i'm realy newbie.
      thanks a lot
        • 1. Re: html code in flash
          Level 7
          davidrasta,

          > i have the macromedia flash professional 8, and i'm
          > building a web site in flash.

          Okay.

          > I want to put a counter, a mp3 player and a mailing list
          > code that is in HTML code how can i do it?

          Ah. Well, it's important to realize the difference between a browser
          and the Flash Player plug-in. Browsers download files and display them
          based on HTML. Most browsers have a JavaScript engine, which is required,
          of course, for interpreting JavaScript. In fact, having a JavaScript engine
          is a bit like having the Flash Player plug-in: without it, you can't
          display media of the relevant sort.

          The Flash Player does not provide a JavaScript engine. Flash's language
          is ActionScript. So code like this ...

          > example of the code of the counter:
          >
          > <!-- Start Bravenet.com Service Code -->
          > <script language="JavaScript" type="text/javascript"
          > src=" http://pub8.bravenet.com/counter/code.php?id=395396&usernum=635540990&cpv=2
          > ">
          > </script>

          ... simply won't run in a Flash movie because there's nothing to run it.

          You'll either have to use one of the ActionScript solutions for posting
          variables (such as loadVariables() or the LoadVars class) -- and even that
          may not work, because I'm guessing the bravenet.com PHP form returns data
          relevant to JavaScript -- or leave room in your HTML code for both a SWF
          file (your Flash movie) and such JavaScript snippets.

          > I want to put a scroll bar in my flash website how
          > can i do it?

          Look in your Components panel and use the ScrollPane Component.


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: html code in flash
            davidrasta Level 1
            hi, again:

            thanks for your answer in flash forum.
            I have one more question for you:
            if not in HTML code. how can i put in flash code:
            a counter;
            a mailing list invite;
            and a mp3 player;

            thanks let me know.

            david Santos
            • 3. Re: html code in flash
              Level 7
              David,

              > thanks for your answer in flash forum.

              Happy to help.

              > I have one more question for you:
              > if not in HTML code. how can i put in flash code:
              > a counter;
              > a mailing list invite;
              > and a mp3 player;

              What you're talking about are three distinct applications. The term "a
              counter" could mean dozens of things. I have no idea if you're referring to
              something that counts down to a special date in the future (x days till
              Christmas!) or something that keeps track of how many visitors have been to
              your site, or a stop watch ... could mean quite a handful of things. In any
              case, whatever it is, a counter is an application -- something you have to
              either roll up your sleeves and write or hire someone to write for you.

              Same goes for a mailing list invite and an MP3 player. Flash is capable
              of handling all these things, just like a well-stocked toolbox is capable of
              handling a birdhouse, a chess board, a napkin holder, a picture frame ...
              you see where I heading? Programming means a lot more than copying/pasting
              someone else's code. Even your existing JavaScript counter hits a PHP page
              out on the web, which means that someone (or a team of people) spent hours,
              weeks, or months (who knows?) working hard to write an application that
              people can use.

              Flash will give you the same opportunity. You might find an existing
              Flash-based counter out there, or you might find that even your existing PHP
              counter will work -- as I replied earlier, Flash features a number of ways
              to interact with PHP (and other) middleware, so you'll have to start at the
              beginning and learn ActionScript.

              There is no one-liner answer to your questions, I'm afraid.


              David
              stiller (at) quip (dot) net
              Dev essays: http://www.quip.net/blog/
              "Luck is the residue of good design."


              • 4. Re: html code in flash
                davidrasta Level 1
                just one more question:

                and how can i puta a action script in my macromedia flash professional 8?

                let me know
                • 5. Re: html code in flash
                  Level 7
                  David,

                  > just one more question:
                  >
                  > and how can i puta a action script in my macromedia flash professional 8?

                  Window > Actions. When the Actions panel opens, start typing.


                  David
                  stiller (at) quip (dot) net
                  Dev essays: http://www.quip.net/blog/
                  "Luck is the residue of good design."


                  • 6. Re: html code in flash
                    Wolf_van_Ween Level 1
                    Hit the magic F9 key.

                    No, not now.

                    When you're inside the Macromedia Flash Professional 8 authoring environment and have a Flash document open. This will open the actionscript panel. There you put your code.
                    May I suggest that you work your way through some of the basic tutorials?
                    • 7. Re: html code in flash
                      davidrasta Level 1
                      sorry for boring you again.
                      but i've try to di what you said but i can manage anything.

                      i've a file ".as", downloaded by the internet, with the action script that i want to put in my main frame. how can i do it?
                      if i open the file independetly, flash say no erros in script.
                      please explain me all the point, otherwise i will be blocked in other new thing.

                      thanks a lot

                      david
                      • 8. Re: html code in flash
                        Level 7
                        David,

                        > sorry for boring you again.
                        > but i've try to di what you said but i can manage anything.

                        Not a thing? Not anything at all?

                        > i've a file ".as", downloaded by the internet, with the
                        > action script that i want to put in my main frame.

                        Okay. None of us have any idea what .as file you've downloaded, so none
                        of us can tell you what that file should do.

                        > how can i do it?

                        How can you put the .as file contents into your FLA? Well, you can copy
                        the contents of that file, open the Actions panel -- this should be familiar
                        now -- and and paste the contents of that file.

                        > if i open the file independetly, flash say no erros in
                        > script.

                        That's good to hear.

                        > please explain me all the point, otherwise i will be
                        > blocked in other new thing.

                        Wolf and I have both explained to you how to enter ActionScript into
                        your FLA. It's up to you to ask specific questions. When you ask
                        wide-open questions -- "please explain me all the point" (what does that
                        even mean?!) -- it becomes hard to help you.


                        David
                        stiller (at) quip (dot) net
                        Dev essays: http://www.quip.net/blog/
                        "Luck is the residue of good design."


                        • 9. Re: html code in flash
                          davidrasta Level 1
                          i had download the code from here:

                          http://ovh.dl.sourceforge.net/sourceforge/musicplayer/xspf_player_slim-0.2.3.zip

                          if you want to take a look.

                          all the tutorials that i have found in the internet explain how to do it individually and not in a page that already had been made. so i have a page called for example casa.fla, and i what to put that player inside that, in the main page

                          thanks
                          • 10. Re: html code in flash
                            Level 7
                            David,

                            > all the tutorials that i have found in the internet explain
                            > how to do it individually and not in a page that already
                            > had been made.

                            Do "it" individually -- do what?

                            > so i have a page called for example casa.fla, and i what
                            > to put that player inside that, in the main page

                            FLA files aren't pages, bro. They're Flash source files. You can't put
                            a player inside of an FLA, if by "player" you mean the Flash Player.

                            I'm trying to help you, David, but I'm afraid your questions simply
                            aren't clear to me. I recommend you square yourself away on the basics,
                            first. Put aside the downloaded .as file for the time being. Start with a
                            fresh, new FLA and use the trace() function to send yourself a "Hello,
                            World!" message. Figure out your surroundings first, before digging deeper.


                            David
                            stiller (at) quip (dot) net
                            Dev essays: http://www.quip.net/blog/
                            "Luck is the residue of good design."


                            • 11. Re: html code in flash
                              Wolf_van_Ween Level 1
                              You haven't chosen an easy task, David. Are you sure you want to dig into this?
                              I've had a look at the player. It comes distributed as an AS file and an SWF file, without any documentation on how to use it.
                              Sure enough the SWF works, but the AS is not enough alone.
                              You need to have certain structures in your own Flash movie to make the AS work.
                              You need at least a play button (called start_btn) inside it's own movieClip (start_btn_mc) and I would also propose a status display: a dynamic text field called display_txt in a movieClip called track_display_mc to get it to work. There are a few other movieClips, but they are only necessary for advanced features.
                              Now this is only to get the thing playing, I haven't yet talked about adaptation to your needs. And it works with XML playlists which might also be difficult for a beginner.
                              If you want to dig in, by all means. But you need to understand quite a lot about actionscript to make it happen.
                              Good luck
                              Wolf
                              PS to DavidStiller and other guru lurkers: can you believe that someone on sourceforge.net releases an AS file that is not self-contained, and doesn't contain a class definition? I mean how much work would the additional createEmptyMovieClip etc. have been, not even talking about a documentation.
                              • 12. Re: html code in flash
                                davidrasta Level 1
                                ok, that player it's a litle more than i can afford, .
                                i have some ideia for my site but i'm really newbie in flash.
                                maybe i'll will started with more simple ideias. I have 2 questions for you:
                                1- i want to put a message board in mywebsite, how can i put a link for it?
                                2- i want to make a hit counter, counting all the people that enter in the site, i have seen this example:
                                http://66.249.93.104/search?q=cache:txUg2eZRn_QJ:www.webwasp.co.uk/tutorials/b39-hit-count er/index.php+hit+counter+in+a+flash+page&hl=pt-PT&gl=pt&ct=clnk&cd=7
                                although i dont want to save my page with the name that they said, phpcounter.fla....
                                • 13. Re: html code in flash
                                  Wolf_van_Ween Level 1
                                  2.. what's the question. That's a fairly straightforward step by step explanation.
                                  You do have a PHP enabled server, do you?
                                  1. nothing easier than putting a link to another webpage into a Flash movie: you can either use behaviors (Web - goto web page) or use a getURL("youraddress"); call inside a button onRelease handler.

                                  May I I suggest you work through some of the basic tutorials first? Help - Samples is a good place to start, then the tutorials here on the Macromedia webpage.

                                  Cheers
                                  Wolf
                                  • 14. Re: html code in flash
                                    davidrasta Level 1
                                    the second question is:
                                    I want to know how to put a simple hit counter in my page...
                                    • 15. Re: html code in flash
                                      Level 7
                                      David,

                                      > the second question is:
                                      > I want to know how to put a simple hit counter in my page...

                                      This thread is getting pretty long. Wolf and I have been trying to help
                                      you for quite a while, yet we're not really getting anywhere, are we? I
                                      don't mean to discourage you at all -- far from it! -- but we need to find a
                                      better way to move forward. As Wolf and I said, you should really start
                                      with the basics.

                                      There's nothing simple about a hit counter. There's nothing simple
                                      about an MP3 player, or any of it. Flash development isn't simple. (If it
                                      was, people wouldn't make healthy salaries developing in Flash.) I fear you
                                      will only become disappointed if you keep trying to find existing solutions
                                      out there and pack them into a SWF without understanding how they work. I'm
                                      not saying you have to become a guru, but you'll do yourself a favor to at
                                      least read -- and comprehend -- this article here ...

                                      http://livedocs.macromedia.com/flash/8/main/Part3_Learning_AS.html


                                      David
                                      stiller (at) quip (dot) net
                                      Dev essays: http://www.quip.net/blog/
                                      "Luck is the residue of good design."