SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    METROmilwaukee
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How To Concatenate swf Files?

    I need a server-side solution. I have a library of alphabetical swf assets. For example c.swf, a.swf and t.swf. At run-time I need to concatenate to cat.swf.

    Flex is out of the question as it is too expensive and I'm interested in other options. Any idea how to get this done? I do the C# thing but want to know about other options please...

  2. #2
    Also available in Large Si's Avatar
    Join Date
    Sep 2002
    Location
    Walsall, UK
    Posts
    1,911
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What is it you're wanting to do with your Flash files? Are you just assembling words using individual Flash characters? If so, you could just pass in a variable containing the word which can be created dynamically within your Flash movie.
    Si
    Are you a Photoshop Jedi Master? Prove it!

    Is funky house your bag? You'll love this!

    Voice
    , eyes, ears, body and hands.


  3. #3
    SitePoint Evangelist Redivider's Avatar
    Join Date
    Nov 2003
    Location
    PA
    Posts
    465
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or you could use something like PHP or ASP to dynamically add the individual SWFs to the page, based on a string variable.

    But in my mind,

    c.swf + a.swf + t.swf != cat.swf

    At least not without, like you said, Flex or some other technology (if there is any) that can create swfs on the fly. But there is most definitely away to do it without actually "concatenating" the files.

    If you explain your desired result, I'm sure someone can help you figure it out.

  4. #4
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if it were me, id make a main swf that used AS to load a list of other swfs and play them sequencially, or aligned them next to each other, or whatever else you might wanna do with them.
    That way, you could make one aggregate preloader that would bring all of them together.
    James Rice :: Ex-Mentor
    www.jamesrice.net

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    METROmilwaukee
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I may not have to concatenate on the server after all. Each swf is an audio file and the application needs to spell out the word 'cat' a character at a time noting again I will not know which characters are going to be needed until the page is compiled and returned to the client. That's why I have created a library of characters. Think Sesame Street spelling out each character of the word when an event is raised.

    If the run-time conditions loaded the required characters into an array would branching logic work for me? I'll need to begin playback using a click event. I have no experience with playing Flash swf audio files other than dragging one of my library assets into a browser and hearing it play back immediately.

  6. #6
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well you could pass the word into the swf as the page loads, then load in the proper letters and play it.

    where is the "word" coming from? a form or something else?

    i can try to help you out if you give a more specific explaination of what needs to happen...
    James Rice :: Ex-Mentor
    www.jamesrice.net

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    METROmilwaukee
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JRMillion
    <snip />
    i can try to help you out if you give a more specific explaination of what needs to happen...
    I think I confused everybody with my initial assumptions. My last post described what is required and I'll try to refine.

    I created a library of audio assets named a.swf, b.swf, c.swf and so on. If for example I drag b.swf from Windows Explorer into IE I will hear the letter 'b' pronounced as 'bee' in the speakers connected to the machine. I hope this part is clear as the audio playback is the basis of what follows.

    Now at run-time, a server-side process will select a finite series of swf audio assets from the file system. When aggregated together the assets will compose a word such as 'cut' which I am going to use as an example to continue this explanation.

    Since each swf file in the library of assets is a separate audio file I need to determine how to aggregate the files at run-time in the order they are required to be played back in the client. I can handle this. I will need to use a cleint-side click event to invoke playback and do not want the audio to play when the page loads. I can handle this.

    Thus, if c.swf, u.swf and t.swf were the results of the server-side process when the click event was raised each file would playback audibly spelling 'cee' 'you' 'tee.'

    I am now supposing I will need to preload each of the swf files as if they were images being preloaded into an array. Can I preload swf audio files this way without each audio file being played back as soon as the page loads?
    [Confirm | Deny].

    How's that 'splanation? I suppose I should just start coding and see what happens. Doh.

    The more I think about it I think I could use use preloading to populate an array on the client. When the event is raised branching logic would be used to retrieve each swf from the array playing each swf audio file one after the other as 'cee' then 'you' and finally 'tee' but not if the swf files will playback automatically after the page loads.

  8. #8
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can you post a zip of the audio?

    how much actionscript do you know?

    ps- you can preload the audio without it playing automatically
    James Rice :: Ex-Mentor
    www.jamesrice.net

  9. #9
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    METROmilwaukee
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How did I know you were going to ask that next James? Which smilie is used for pyschic phenomena?

    The attached files c.txt, u.txt and t.txt should be renamed to c.swf, u.swf and t.swf respectively.

    Rename the files as indicated and drag each from Windows Explorer into the body of a browser. As each swf file is played back you will hear ICAO phonetics which you can quickly learn about and review here [1].

    All other requirements as described persist noting I did not previously discuss ICAO phonetics for the sake of simplistic discussion and because I am working on the next killer application of course ;-)

    I've only toyed with ActionScript when it was first released. Most of my time has been spent learning C# and the .NET Framework.


    [1] http://home.planet.nl/~bergh601/subm...O-Alphabet.htm
    Attached Files Attached Files
    • File Type: txt c.txt (12.1 KB, 10 views)
    • File Type: txt u.txt (13.3 KB, 7 views)
    • File Type: txt t.txt (11.6 KB, 6 views)

  10. #10
    SitePoint Wizard bronze trophy JRMillion's Avatar
    Join Date
    Apr 2004
    Location
    Arlington VA
    Posts
    2,094
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.ricetechnologies.com/sitepoint/voice/
    Ok, I made this file for you.
    Inside the zip are the 3 letter swfs and a swf/fla(mx2004) i made, and a HTML page.

    If you open the page and click the play link on the flash, it will say "cut".
    If you look at the HTML source, this line specfically
    Code:
    <param name="flashvars" value="word=cut" />
    you can specify what word it will spell. So just put your whole alphabet in this same folder and it will say anything you tell it.
    I also made it so if you were to remove this line of code, it would say "cut" by default.
    right now, it just says 1 letter every 1.5 second, but you could modify that if need be.
    Attached Files Attached Files
    James Rice :: Ex-Mentor
    www.jamesrice.net

  11. #11
    SitePoint Enthusiast
    Join Date
    May 2003
    Location
    METROmilwaukee
    Posts
    35
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [QUOTE=JRMillion]
    http://www.ricetechnologies.com/sitepoint/voice/
    Ok, I made this file for you.
    <snip />
    [QUOTE]

    Thank you James.
    For some reason instant e-mail notification did not keep me informed and as you know this week has been hectic for most of us doing the Christmas Shopper Cha-Cha.

    Lucky me I was just now able to get back to try to find this thread to find a present waiting :-)

    The demo works great. I'll keep you informed...
    Have a Merry Christmas


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •