Peter Elst

Flash Platform Consultant
  • Home
  • About me
  • Articles
  • Downloads
  • Contact me

Publishing an FLA through JSFL

16 09 2003

After reading Mike Chambers’ post on executing JSFL files from the command line I decided to do some experiments.

Building on that concept I came up with a little script that opens up an FLA, adds some ActionScript and exports it. You can download the files here (be sure to change the path in the JSFL file to point to the correct locations of your FLA and SWF).

publishFLA.jsfl

fl.openDocument(”file:///C:/publishFLA.fla”);
var myDoc_doc = fl.getDocumentDOM();
var myTimeline_tl = myDoc_doc.getTimeline();
var myFrame_frame = myTimeline_tl.layers[0].frames[myTimeline_tl.currentFrame];
myFrame_frame.actionScript = “jsfl_txt.text =”This text was added through JSFL!”;”;
myDoc_doc.exportSWF(”file:///C:/publishFLA.swf”,true);
myDoc_doc.close(false);

Nothing very fancy in itself, but ofcourse the potential is practically limitless. Imagine creating new SWF files on the fly through a dynamically generated JSFL script. I’m very excited about those developments which may - who knows - even pave the way for a form of Flash Markup Language.

Hope to have more examples up in a little while!

« Flashtival 2003 - Amsterdam Remote webservices in MX 2004 »



Actions

Informations

  • Date : 16 September 2003
  • Categories : Flash

2 responses to “Publishing an FLA through JSFL”

17 09 2003
Owen van Dijk (11:45:13) :

actually…i wrote about that awhile ago. i have a little tool that creates a ‘publish’ jsfl that goes through a directory and finds all the FLAs. Then to publish all the files, you just have to double click on the jsfl file, and Flash will happily export everything, thus similating a ‘compile’ session.

i ran it on a 164 kb jsfl file, containing hundreds of FLA’s and it ran smooth and flawless.

:)

26 01 2006
Chris (01:09:10) :

Hi there.
I’m wondering if you know a way that I can launch an SWF after I’ve used exportSWF to publish it. I am trying to mimmick the behavior of “Test Movie” but I can’t find a way to open the exported SWF in the flash environment.





Conferences

Flash on the Beach Speaker

Training Partners

multimediacollege

SkillsMatter

Badges

Alltop, confirmation that I kick ass

  • Categories

    • AIR RSS category feed
    • Ajax RSS category feed
    • CSS RSS category feed
    • Eclipse RSS category feed
    • Events RSS category feed
    • Flash RSS category feed
    • Flash Lite RSS category feed
    • Flex RSS category feed
    • Gadgets RSS category feed
    • General RSS category feed
    • JSFL RSS category feed
    • Mac RSS category feed
    • Open Source RSS category feed
    • PHP RSS category feed
    • Podcasts RSS category feed
    • Publications RSS category feed
    • Rants RSS category feed
    • Reviews RSS category feed
    • Thought of the Day RSS category feed
    • Training RSS category feed
    • Twitter RSS category feed
    • Video RSS category feed
  • Resources

    • Veronique Brossier
    • Matt Voerman
    • Josh Tynjala
    • Marco Casario
    • Richard Leggett
    • Chafic Kazoun
    • LordAlex Leon
    • Peldi Guilizzoni
    • Stefan Richter
    • Serge Jespers
    • Matthew David
    • Brajeshwar Oinam
    • Branden Hall
    • Lee Brimelow
    • Keith Peters
    • Ralf Bokelberg
    • Peter Hall
    • Jon Williams
    • Edwin van Rijkom
    • Mario Klingemann

     
     

    Adobe Community Expert

    See my profile on LinkedIn



    Harz Ferienwohnung Suchmaschinenoptimierung Geschenkideen Harz Ferienwohnung Pagerank Webkatalog Webhosting