Not signed in (Sign In)

Vanilla 1.0.3 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthornfkuser
    • CommentTimeMar 25th 2008
     
    hello

    how i can set file path as base64 ? not work:
    SWFObject('data:application/x-shockwave-flash;base64,blabla', ,,,)

    (http://en.wikipedia.org/wiki/Data:_URI_scheme)
    • CommentAuthorAran
    • CommentTimeMar 25th 2008
     
    So a few questions:

    1) Why would you want to base64 encode your flash file?

    - Base64-encoded data: URIs are roughly 33% larger in size than their binary equivalent
    - Browsers may limit URI lengths, creating an effective maximum data size. For example, URIs in previous versions of Opera had limits of 4kB, and 32kB for IE8 Beta 1
    - Microsoft's Internet Explorer, as of versions 6 and 7, lacks support

    2) Not working in what?


    You might have to break the base64 stream into lines of 76 characters, as described here:
    http://richardleggett.co.uk/blog/index.php/2007/08/30/base64_as3_mime
    • CommentAuthornfkuser
    • CommentTimeMar 28th 2008 edited
     
    //sorry for bad english)


    Yes, i know about 33 % and about a limit in 4kb

    http://www.rodsdot.com/ee/cross_browser_clipboard_copy_with_pop_over_message.asp

    i want to put clipboard.swf in js body to reduce quantity of request to server

    this not work


    function copy(id) {
    if (window.clipboardData) {
    window.clipboardData.setData("Text", document.getElementById(id).value);
    } else {
    var flashcopier = 'flashcopier';
    if(!document.getElementById(flashcopier)) {
    var divholder = document.createElement('div');
    divholder.id = flashcopier;
    document.body.appendChild(divholder);
    }
    document.getElementById(flashcopier).innerHTML = '';

    var divinfo = SWFObject('data:application/x-shockwave-flash;base64,'+
    'Q1dTB3kAAAB4nKtgYI1nYOBfwMDAw8jgzPT//3975lAGBoYOdQYWhuSczIKk/MSiFIac1Lz0kgyG'+"\r\n"+
    '4MriktRchuLUEme41DQmBg4GGRDJ6Cc0l4lBAibCzsDOCDSJgwksyRwkzuAA5AIAd7oY/w==',
    'copy_contents', '0', '0', '4');

    divinfo.addVariable('clipboard', encodeURIComponent(document.getElementById(id).value));
    divinfo.write(flashcopier);
    }
    }
    • CommentAuthorAran
    • CommentTimeMar 28th 2008
     
    "i want to put clipboard.swf in js body to reduce quantity of request to server".

    But if it is in the body of your HTML page, then you are still putting load on the server. Are you worried about the number of requests vs size of request? This is like saying I want to make my whole web page 1 image to reduce the number of images being called on the server. It just doesn't really make sense to me...

    On standard browsers, once a user has called the .swf once, then it is in their cache and there is no more calls to your server.

    Anyhow, I have never used data URI before, so I can't really help you on that. I'd suggest getting it working with the standard Adobe object/embed method and then porting it to swfobject afterwards. Basically reduce your problem to it's simplest form. It doesn't help that you are writing the swf at 0x0 pixels, so you never even know whether it was ever created or not...