2 Replies Latest reply on Jul 30, 2006 2:02 PM by charmcityMD

    Embedding SWF in a text field

    charmcityMD
      Hi, New user to Flash here with a problem embedding .SWF files. I have already existing SWF files that I have called historically from HTML using <object> to embed the object and <param name= value=> also to pass it information. The SWF movie I need to embed basically builds a graph and takes its data from the location you supply it in <param name= value=> field. This code is not mine and I can't alter it.

      What I want to do is construct a flash version of my site and embed these graphs within a flash textfield. I have been able to successfully embed a test SWF file using <img> tags on a text field ---> but here is my question. How do I support the <param name= value=> functionality I got when I called these graphs from HTML using <object>?

      I hope that's clear? Any help at all is greatly appreciated.
      Tom
        • 1. Re: Embedding SWF in a text field
          Level 7
          Tom,

          > What I want to do is construct a flash version of my site
          > and embed these graphs within a flash textfield.

          That's a really interesting approach. At first, I didn't understand
          what you were aiming for, but it sounds to me like you're tying to use HTML
          inside a Flash text field -- which is doable, to some extent -- and embed an
          external SWF in that HTML ... all within Flash.

          > I have been able to successfully embed a test SWF file
          > using <img> tags on a text field --->

          That does work, but it's about the closest you'll get, I'm afraid. It's
          only happenstance that Flash's very narrow (and somewhat unique) version of
          HTML accepts SWFs in an <img> tag.

          > but here is my question. How do I support the <param name=
          > value=> functionality I got when I called these graphs from
          > HTML using <object>?

          Flash only supports a very limited subset of the HTML language. You can
          see the full list of supported tags by searching the phrase "supported tags"
          in the documentation (specifically, the Learning ActionScript 2.0 in Flash
          book). For better or worse, <object>, <param>, and <embed> are simply not
          in that list.

          > Any help at all is greatly appreciated.

          Your only choice is to use one of the more traditional methods of
          loading external SWFs, such as loadMovie(), MovieClip.loadMovie(), or the
          MovieClipLoader class. Once your external SWF is loaded, you may "feed" it
          variables that should be detectable by the ActionScript inside the loaded
          SWF.


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


          • 2. Embedding SWF in a text field
            charmcityMD Level 1
            David,

            I want to thank you for your well reasoned response to my question. You do understand what I am trying to do correctly. I was hoping there was a standard alternate approach to this problem and it sounds like I need to go off and do some reading on the MovieClipLoader class.

            Thanks very much
            Tom