Is it possible to compress SWF files using gzip?

I am using gzip for all the files of my server but my swf doesn't seem to be getting compressed also "swfobject_modified.js" used by the SWF file doesn't get compressed as well, whereas other .js files are getting compressed. Any suggestions ?

For quite a while swfs are (by default) (g)ziped when published. You can change that under the publish-settings using the flash tab. Regarding the swfobject, I think that the code is very size optimized, whereas your regular run of the mill self-made .js is mostly optimized for readability.
M

Similar Messages

  • Unload swf file using SWFLoader

    Hi,
    I have a main application where I am using a SWFLoader to load a second application.
    In the second application I want to put a button (Close) and when I click it I want to unload this application.
    Is it possible to achieve this?
    I know that I can unload a swf file using the unloadAndStop method of SWFLoader, but how can I access it from the loaded application?
    I think that another approach would be adding eventlisteners to loaded swf but I am not sure how to do that.
    Does anyone can help me?
    Thanks in advance,
    Alberto

    Hi,
    @Alberto
    I think that another approach would be adding eventlisteners to loaded swf but I am not sure how to do that.
    I think you could use custom or built-in event type to dispatch information to hosting application and SWFLoader *has* built-in dedicated routine to unload loaded context - which includes removing event listeners added to swf-types on content load (Yes, there are means in Flex SDK to access top-most application but usually that is not advised to access methods/properties of parent as it closely ties content together).
    So your parent application could start to listen for custom event when load completes and removes loaded app that way:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx">
         <fx:Script>
              <![CDATA[
                   protected function chidLoadedHandler(event:Event):void
                        swfLoader.content.addEventListener(Event.CLOSE, unloadChildHandler);
                   protected function unloadChildHandler(event:Event):void
                        swfLoader.content.removeEventListener(Event.CLOSE, unloadChildHandler);
                        swfLoader.unloadAndStop(true);
              ]]>
         </fx:Script>
         <s:SWFLoader
              width="100%" height="100%"
              source="ChildApplication.swf"
              complete="chidLoadedHandler(event)"
              id="swfLoader"/>
    </s:Application>
    while your child application simply:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                      xmlns:s="library://ns.adobe.com/flex/spark"
                      xmlns:mx="library://ns.adobe.com/flex/mx">
         <fx:Script>
              <![CDATA[
                   protected function unloadMeHandler(event:MouseEvent):void
                        // we will dispatch "CLOSE" event - this could be custom event type
                        // but I think it is just enoguht heres
                        var closeEvent:Event = new Event(Event.CLOSE);
                        // root is top-most - so it is "content" top-most display object as well
                        this.root.dispatchEvent(closeEvent);
              ]]>
         </fx:Script>
         <!-- ui -->
         <s:Button x="10" y="10" label="Unload me" click="unloadMeHandler(event)" id="unloadButton"/>
    </s:Application>
    Not sure if that is most bullet proof or recommended solution but could be place to start,
    regards,
    Peter

  • Is it possible to read the file using File Adapter which is in client machi

    Is it possible to read the file using file Adapter which is in client machine(on the same network).Then what is thee need of FTP Adapter?

    You can achieve that by exposing your client machine as a drive, then you can go using file adapter.
    FTP adapter will help you to communicate with different machine which is in different network.
    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    Thanks,
    Vijay

  • Compiling FLA and AS files to SWF file using command line

    I need to encorporate the .as sources and .fla file, into my
    build environment, to compile the SWF file.
    Right I have to Open Flash 8 to perform this and copy the SWF
    created through the compilation process.
    Compiling FLA and AS files to SWF file using command line is
    my main purpose. If there such a utility there, does it exist for
    Linux and Windows.

    Try
    Flash
    Command or
    Flash
    Shell Extension
    We use an enhanced version of Flash Command internally, of
    which we fixed the bug of Mike Chamber's Flash Command which cannot
    be run in .NEt 2.0 and added some other functionality. Once we are
    comfortable with it, we will release it to the public.

  • URGENT: Is it possible to upload multiple files using STRUTS

    Hi,
    Is it possible to upload multiple files using STRUTS.
    I am able to upload a single file. But how do i upload multiple files ??
    upload.jsp
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html>
    <head>
    <title>New Page 1</title>
    </head>
    <body>
    <html:form action="/secure/uploadFile.do" enctype="multipart/form-data" method="POST" type="com.smartstream.webconnect.user.actions.UploadActionForm">
    <p>File to upload
    <html:file property="fileUpload" size="20"/></p>
    <p><html:submit/></p>
    </html:form>
    </body>
    </html:html>
    UploadAction.java
    public class UploadAction extends BaseAction {
        Logger log = Logger.getLogger(AttachMessageAction.class);
        public ActionForward executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ActionException {
            System.out.println("executeAction of UploadAction");
            UploadActionForm uploadActionForm = (UploadActionForm) form;
            int fileSize = uploadActionForm.getFileUpload().getFileSize();
            System.out.println("uploadActionForm.getFileUpload().getFileSize() = " + uploadActionForm.getFileUpload().getFileSize());
            byte buffer[] = new byte[1024];
            try {
                BufferedInputStream bufferedInputStream = new BufferedInputStream(uploadActionForm.getFileUpload().getInputStream());
                FileOutputStream fos = new FileOutputStream("s:\\uploaded\\" + uploadActionForm.getFileUpload().getFileName());
                int read;
                while ( (read = bufferedInputStream.read(buffer,0,buffer.length)) != -1) {
                    fos.write(buffer, 0, read);
                fos.flush();
                fos.close();
                bufferedInputStream.close();
                return mapping.findForward("success");
            } catch (IOException e) {
                e.printStackTrace();
                return mapping.findForward("error");
            }catch(OutOfMemoryError o){
                o.printStackTrace();
                System.out.println("o.getMessage() " + o.getMessage());
                return mapping.findForward("error");
    UploadActionForm.java
    public class UploadActionForm extends ActionForm{
        private FormFile fileUpload;
        private byte[] fileContent;
        public FormFile getFileUpload() {
            org.apache.struts.taglib.html.FormTag _jspx_th_html_form_0;
            return fileUpload;
        public byte[] getFileContent() {
            return fileContent;
        public void setFileUpload(FormFile fileUpload) {
            this.fileUpload = fileUpload;
        public void setFileContent(byte[] fileContent) {
            this.fileContent = fileContent;
    }--Bhupendra Mahajan

    Yes, you could try using the multipart handler...
    But I have a better idea...
    Determine the maximum number of file uploads that the
    user can do at one time. I mean, you can't
    realistically have the user upload a million files at
    one time. So say the max is 20. So you create your
    action form class with 20 FormFile fields called file1
    to file20.
    Then when you dynamically create your page, you
    dynamically create the specified number of file fields
    and 1 hidden field called "totalFiles" which contains
    the number of file fields you created. This should be
    an int field in the form bean.
    Then when you do your action processing, you just loop
    thru the totalFiles... Or well, actually, you may not
    need that at all. You could just check all the
    FormFile fields and whatever ones aren't null contain
    files.But what about UploadActionForm.java[b]
    How do i have exact mapping of the HTML form in this file ??
    --[b]Bhupendra Mahajan

  • Is it possible to have swf files rotate?

    Hi all. I hope you can help me.
    I found a brilliant file showing how to bring in bitmaps to flash from an xtml. and have them rotate in sections on and off the screen.
    I'm sure there are other ways to do this but this is the one i have managed to find and adapt to my needs.
    ( I'm more designer than coder but i try, and this file is a code fest! I have never used an external file before to make my animations work.)
    http://www.flashmo.com/preview/flashmo_224_grid_slider
    I was looking at what my site requires and decided i would like this format but for swf. files to be loaded instead of Bitmaps. Is this even possible with an swf? The reason i would like to use swf's is because i would like the user to see a small (interaction optional) animation in place of each bitmap, and if they don't click anything the next one will appear by breaking into squares and the next one rolls in etc. just like the bitmaps but with swfs. Would i have to create bitmaps to be broken up into squares and rotated into view and then have it automatically load the swf in it's place and then before rolling out switch back to the bitmap? Or is there a way just to load the swf's and have them break up and rotate?
    I have managed to remove the text info and dissapearing bar, as this would not be required for the animations,and I have extend the viewing time however although it's working it might not all be completely correct :S
    Any help would be much appeciated and if there is a tutorial for exactly this just point me in the right direction.
    I hope i can do it just with swf's as that would be awesome.
    Please be aware i was taught the basics on Macromedia Flash MX as a designer and have recently bought Adobe CS4 so i'm still trying to catch up on all the new tricks and info. So please be gentle, I'm a little rusty.
    Thanks
    Cobie

    Thanks for the reply.
    Yes i think it does use the bitmapdata class. I'll try searching for swf masks tutorials and see what i get.
    Thanks for the reply
    Cobie
    Does anyone else know of a tutorial or download file i could look at?

  • Creating customised swf files using CF?

    Hi all.
    This is a bit of an integration question.
    Marketing create wonderful swf brochures using InDesign to
    let them have those cool page turning features. They embed urls
    into the document to invite the reader to "click to make a
    booking".
    Fine so far.
    What they have asked me is if there is any way we can
    dynamically build these brochures so that:
    a) clients can build their own and/or
    b) the urls can have some dynamic content
    For the latter, they want sales consultants to be able to
    generate a brochure and send it out and all URLs in that brochure
    will include the consultant ID (for clickback tracking and other
    stuff)
    I could do this easily enough using a PDF and CFDOCUMENT but
    they want the final format to be SWF and to have all those
    page-turner extras.
    Is this even possible at the current state of Adobe
    integration?
    Regards
    Neal

    I think you are trying to explain how to load two swf's one with action
    script and loading an other swf file which should be non action script.If
    you read my requirement carefully.I have all the same type of swf's and
    these swf are automatically created as a form of output for xcelsius dash
    board software.Iam capable of creating individialu ipa files from these swf
    files.So when I try to combine the same kind of swf files the first error
    its giving is the file name which I have used in the xml.in the main file
    name for the swf file its not considering the two swf file name in the
    initial window.so the adt package in the command line is not understanding
    the file name from the xml and the command prompt and giving error this swf
    file does not exist.So please consider how to combine two swf files with AS3
    into one ipa file.These swf files are not editable,Let me know if you find
    any idea to achieve this

  • Is it possible to load SWF files from an SQL database?

    Hi all, I am very new to flash (I am primarily a C'# developer!) and I have been asked to investigate the possibility of doing the following;
    Create an application that allows swf files to be uploaded and stored inside of a SQL database as binary data (Why a database is a long story!)
    Allow this binary data to be extracted via a http request to be dynamically loaded inside of a web page.
    Now the first part was easy. I have all of my swf's uploaded and stored inside of the database. I have code that can make a request for the binary and write it to the response, so far so good. Now this is where I am stuck.
    I thought I could dynamically load the swf binary data by creating a very basic swf that simply contains a movie clip holder and for now a simple loadMovie statement. My idea being that I can could provide a url for the loadMovie statement that returns the swf binary data. This is where I have ground to a halt.
    I can see the call being made from the swf, I can see the data being returned but I cannot get it to render. I remember seeing an article some time agao where someone stated that they had used this method with success but I cannot find now. Has anyone ever done anything like? Is it even possible? Am I missing something simple?
    I have tried to return both the raw binary data and also used response.write but to no avail. Can anyone help?

    You are possibly trying to load AS3 swf into an AS2 Container at least the use of loadMovie() points in that direction. Be sure to use AS3 and target at least Flash 9 in your Loader/Main.swf. Also the AS3 concept of how to load swfs  differs a lot from the old concept.
    Look into the docu:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/Loader.ht ml
    But the biggest Problem seems to me -what you mentioned- that Loader needs a (defined) URLRepuest and since your swf files have no "real" URL and you surely don`t want to let the user directly write to your server, a workaround would be to write the BinaryStream with AIR-functionality to a local installlation directory and load it then from there.

  • How can we compress SWF files and optimize tool?

    I need to reduce SWF file size up to 70%, quality will not be sink.
    Is this possible in adobe software? please help...

    Iam working on banner production, is their any better software/tools for SWF optimization/compression?
    I got one  SWF and FLA from other creative team,  SWF size is below 50 KB look's better quality, I have changed some small amends, when i was exporting it from FLA... the SWF file weight goes to 90KB, i compressed image quality then, expoted again... the file size goes to 70KB. how can i do  50KB in better quality.
    Thank you for your help!

  • How do I compress PDF files using Acrobat SDK?

    have a web service created in a .net environment that examines existing pdf files in a staging directory prior to sending them over the wire using FTP.
    Part of that process requires that I rename individual files in order to associate them with a particular batch.
    I also have a requirement to reduce the size of individual files as much as possible in order to reduce the traffic going over the line.
    So far I have managed about a 30% compression rate by using an open source library (iTextSharp).
    I  am hoping that I can get a better compression rate using the Acrobat SDK, but I need someone to show me how, hopefully with an example that I can follow.
    The following code snippet is a model I wrote that accomplishes the rename and file compression...
                const string filePrefix = "19512-";
                string[] fileArray = Directory.GetFiles(@"c:\temp");
                foreach (var pdffile in fileArray) {
                    string[] filePath = pdffile.Split('\\');
                    var newFile = filePath[0] + '\\' + filePath[1] + '\\' + filePrefix + filePath[2];               
                    var reader = new PdfReader(pdffile);
                    var stamper = new PdfStamper(reader, new FileStream(newFile, FileMode.Create), PdfWriter.VERSION_1_5);
                    int pageNum = 1;
                    for (int i = 1; i <= pageNum; i++) {
                        reader.SetPageContent(i, reader.GetPageContent(i), PdfStream.BEST_COMPRESSION);
                    stamper.Writer.CompressionLevel = PdfStream.BEST_COMPRESSION;
                    stamper.FormFlattening = true;
                    stamper.SetFullCompression();
                    stamper.Close();
    Any assistance is appreciated.

    You can't use Adobe Acrobat on a server.

  • Compress Text File Using PL/Sql

    Hi All,
    My Environment is -------> Oracle 11g Database Release 1 On Windows 2003 Server SP2
    Requirement is ------------> Compress a text file using Oracle pl/sql
    I am tryring to compress a text file using below pl/sql code,
    DECLARE
    src_file BFILE;
    v_content BLOB;
    v_blob_len INTEGER;
    v_file UTL_FILE.file_type;
    v_buffer RAW(32767);
    v_amount BINARY_INTEGER := 32767;
    v_pos INTEGER := 1;
    v_blob BLOB;
    BEGIN
    src_file := BFILENAME('MY_FILES','expLive.log');
    DBMS_LOB.fileopen(src_file, dbms_lob.file_readonly);
    v_content := utl_compress.lz_compress(src_file);
    v_blob_len := DBMS_LOB.getlength(v_content);
    v_file := UTL_FILE.fopen('MY_FILES','test.log.zip','wb');
    WHILE v_pos < v_blob_len
    LOOP
    DBMS_LOB.READ(v_content, v_amount, v_pos, v_buffer);
    UTL_FILE.put_raw(v_file, v_buffer, TRUE);
    v_pos := v_pos + v_amount;
    END LOOP;
    UTL_FILE.fclose(v_file);
    EXCEPTION
    WHEN OTHERS THEN
    IF UTL_FILE.is_open(v_file) THEN
    UTL_FILE.fclose(v_file);
    END IF;
    RAISE;
    END;
    i am able to get the zip file without any problem.But the Problem here is size of the zip file, Acutal Text File Size is 520 KB and zip file size is 241KB. is there any possible way to compress little bit further to 100KB?
    Please Advice ....in case if you are have an example please share it.
    Thanks for your helps
    Shan

    is there any possible way to compress little bit furtherYou can compress better (but slower) with
    v_content := utl_compress.lz_compress(src_file, 9);
    ..

  • Streaming interactive swf files using Adobe Media server

    Hi!,
    I have some swf files which are interactive. Is it possible to stream them using adobe media server via http or rtmp? Will the resulting stream be interactive? I have to play this streams on android devices. If not possible, is there any other way?
    I'm using 5.0.3 version of Media server. Our Android devices are Jellybean and ICS.
    Regards,
    Randeep

    This kind of question really has a much better chance to get a good answer if asked in the product-specific forum http://forums.adobe.com/community/adobe_media_server

  • Program to compress swf file?

    hey there,
    so i have a rather large swf file that is having trouble
    loading...it takes about 10-15 seconds to actually start to load so
    i've come to the conclusion that i need the help of a swf
    compression program but i'm wondering if anyone can give me advice
    on a reliable program to use? have any of you had a similar problem
    and used a good program to compress?
    let me know thanks so much!!

    I don't know of any programs that compress, but I can give
    you a few tips.
    1) Under your publish settings, make sure that "compress
    movie" is checked.
    2) If you are not doing so, use 90% jpg compression on your
    bitmaps, as opposed to 100% or default. It doesnt seem like a big
    change, but it makes a world of difference.
    3) Under publish settings > flash tab > options
    section, click "generate size report". Then when you publish, you
    will get a size breakdown of everything in your file and you can
    easily pinpoint where the majority of your file size is coming
    from. Then you can make adjustments accordingly.
    Hope this helps,
    GAMBRKER

  • Save as swf file using httpconnection and file io

    I have one application which is fatch the swf file from web and i want to save as in same to swf file format.
    when i have fatch the swf file and save as .swf format i have unable to view as flash animation in browser and micromedia.
    Anyone suggest me ?
    URL url = new URL("http://nileshpatel.com/abc.swf");
    HttpURLConnection con = (HttpURLConnection) url.openConnection();
    con.setRequestProperty( "User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" );
    BufferedReader rd;
    rd = new BufferedReader(new InputStreamReader(con.getInputStream()));
    String line="";
    String content="";
    File f = new File("users/nileshpatel/neo.swf");
    FileWriter fw = new FileWriter(f);
    while ((line = rd.readLine()) != null) {
    content += line;
    rd.close();
    fw.write(content);
    fw.close();
    ############################################################

    BTW sometimes flash uses communication with server to obtain some information before/during running. In such case you'll need to provide kind of your own HTTP server, pass swf to browser using HTTP protocol (not directly from HDD) then pass all additional data.
    Hope this is not your case :)

  • Creating IPA file with Multiple SWF files using ADT

    Iam successfully able to create ipa files using the ADT package but my next requirement is to create an IPA file with multiple swf files.I think it might be easy if your SWF files are regular the tough part is my swf file has lot of action script in it so the only option is to through the command prompt and using the ADT package of Adobe AIR.So now i have 10 SWF files like this and iam creating ipa file for each swf seperatly but now I want to put all of the swf files into one ipa file.Please let me know if i was not clear in my description

    I think you are trying to explain how to load two swf's one with action
    script and loading an other swf file which should be non action script.If
    you read my requirement carefully.I have all the same type of swf's and
    these swf are automatically created as a form of output for xcelsius dash
    board software.Iam capable of creating individialu ipa files from these swf
    files.So when I try to combine the same kind of swf files the first error
    its giving is the file name which I have used in the xml.in the main file
    name for the swf file its not considering the two swf file name in the
    initial window.so the adt package in the command line is not understanding
    the file name from the xml and the command prompt and giving error this swf
    file does not exist.So please consider how to combine two swf files with AS3
    into one ipa file.These swf files are not editable,Let me know if you find
    any idea to achieve this

Maybe you are looking for

  • How can I customize Waveform Chart?

    I want a routine to display selected waveforms on a chart. The input is a waveform array.  The chart should have the following: 1. Y axis labels using the waveform names 2. Legend plot labels using the waveform names 3. X axis in seconds from the sta

  • Coldfusion 11 - Web Sockets via SSL

    Help! I can't seem to figure out how to handle WSS (Websockets over SSL). I have a cert that has already been sent/received by verifier. I have a cert and an intermediate cert. I've been looking at documentation and from what I've gathered i need to

  • I have a yahoo mail account address - Mail will not work with that?

    I tried to mail an email using my Yahoo mail account address. Mail sent it back to me saying that Yahoo rejected it. Do I just keep using mailing from Yahoo instead of Mail to keep things working? When I click on an e-mail address Mail does come up a

  • Help with MovieClipLoader

    I know there's a million posts about this topic (believe me, I've been through most of them) but there is nothing that seems to fit my problem. No matter what I do, I cannot get my external swfs to load into the main swf of my project. I know the key

  • Oracle DEVELOPER with DBA responsibility (50/50)

    Hi all, I am very interested in sharing your opinion about such kind of job, which probably some of you already have. This is a middle size company looking for combination DBA/Developer with minimum 10 years Oracle experience, utilizing the newer too