Skip to main content
Participant
May 1, 2008
Answered

Best way to generate swf files

  • May 1, 2008
  • 2 replies
  • 3297 views
I am looking for an automated/command line means of generating .swf files for the media files I have in my application. At any given time there could be hundreds of videos in the directory and the application lets users upload media to the server.

I know how to create .fla, .as files etc for one file using CS3, but I am hope there is an easier way to generate these swf files.

I am looking at Flex SDK (specifically mxmlc) to write a cron job, but I wanted to see if people use other methods.

Thanks in advance
    This topic has been closed for replies.
    Correct answer PakodaRam
    Jody:
    Thanks for the response. That answered my question.

    2 replies

    May 6, 2008
    Hi PakodaRam,

    You don't need to generate a SWF file for every MP4 and FLV file -- for example, you could have one SWF file (running in Flash Player in a web browser) that acts as a video player for all your video files.

    The SWF file lives on the web server and is sent over HTTP to Flash Player running in a web browser (or to AIR, or to Flash Lite running on a mobile device). The SWF file creates a connection to an FMS application over RTMP (see the NetConnection ActionScript class). Once the connection is made, the SWF file can ask the FMS application for any video on the server (see the NetStream class). FMS streams the video files to the SWF file.

    In other words, the SWF file lives on the web server and the video files live on FMS. (Flash Media Interactive Server does have a C++ plug-in architecture that lets it retrieve files over HTTP, but most people should store their video files on FMS using either local or network storage).

    You're right about your options for creating SWF files -- but since you don't need to create 1000s of SWFs, you'll probably be OK going with Flash CS3 or Flex Builder if you want to use an authoring tool.

    HTH,
    Jody
    PakodaRamAuthorCorrect answer
    Participant
    May 11, 2008
    Jody:
    Thanks for the response. That answered my question.
    Participant
    October 19, 2010

    But we need to install flash player in order to run the swf.

    RFID

    Inspiring
    May 2, 2008
    On Thu, 1 May 2008 16:11:25 +0000 (UTC), "PakodaRam"
    <webforumsuser@macromedia.com> wrote:

    >I have in my application. At any given time there could be
    >hundreds of videos in the directory and the application lets
    >users upload media to the server.

    If you need to convert a video into FLV format, there is a free
    opensource encoder, called MEncoder ( http://www.mplayerhq.hu), but if
    you need to convert a FLV file into SWF format it can't help, as I
    beleave. In general it's not clear what is the reason to do such
    conversion, because SWF format limits video duration down to 16000
    frames, whereas FLV doesn't.

    PakodaRamAuthor
    Participant
    May 2, 2008
    Thanks for the response. I guess I need to ask a more basic question. If I have 1000 .mp4 or .flv files in a directory, what is the easiest way of streaming them to a browser? I am under the impression that I can only send a .swf file to the web server and not flv or mp4 file.

    And to generate .swf files, I need Flash CS3, Flex Builder or mxmlc (Flex SDK). I prefer the last option since it can be used to programmatically generate swf files without user input. I am assuming sites like youtube use this mechanism instead of manually generating swf files.

    Am I missing something? Thanks for any clarifications.