Converting Actionscript to Javascript

When I think of the Cappucino framework. It converts Objective-J to pure Javascript in the browser no plugin required because the compiler itself is in Javascript.
I am thinking, why dosen't Adobe do the same with Actionscript?
Is this something feasable?

I've spoken to a few people who think that an "Export to HTML(5)" option in Flash Pro would be awesome.  I have no idea how something like that would work, or if it is even possible.
The Flex Framework relies heavily on Flash Player APIs.  I suspect there are not standard 'JavaScript' parallels for many if those APIs.

Similar Messages

  • Using Actionscript or Javascript to unload movie using Captivate 5.5

    I have an application an agency built that houses my training videos (created with Captivate 5.5). Now users can click to start a video and then immediately close it and the application shows that they viewed/completed the entire movie. I need to find a way for Captivate to send a call (or something) to the application telling it that the movie has finished.
    I do not know much Actionscript or Javascript but I am a fast learner. I read in past posts where this was accomplished in Captivate 2.0 and 3.0 by
    1) coping the captivate movie into Flash and adding two lines of code (Actionscript)
    import flash.external.Externalinterface;
    External Interface.addCallback("unload", this, unloanSQF);
    2) the following would be added to the HTML page
    //Detect Flash container movie
    function getFlashMovie(movieName) {
       if (navigator.appName.indexOf("Microsoft") != -1) {
          return window[movieName];
       else {
          return document[movieName];
    //Function to be called by Captivate
    function captivateUnload() {
       //Calls "unload" method established in ExternalInterface Actionscript code
       getFlashMovie("simpleSwfLoader").unload();
    3) Add the Javascript call captivateUnload() to the Captivate button.
    I am hoping that the procedure has gotten better with 5.5; plus I do not want to use a button. I want the unload event to occur automatically when the movie ends. Plus, I can't see how to produce a fla version to be imported and edited in flash.
    Any help or direction would greatly appreciated.
    Thank you, Jim

    It sounds like you will need to change some functionality in the application that launces your Captivate SWF's. Currently they will be set to "completed" once they have been opened. The correct approach would be to have your application set them to "Incomplete" or "In Progress" and then have Captivate execute a JavaScript on the last slide calling a function in your application that sets the module as completed.
    /Michael
    www.cpguru.com - Adobe Captivate Widgets, Tutorials, Tips & Tricks and much more..

  • Converting Actionscript from 1.0 to 2.0

    I am trying to convert Actionscript written in 1.0 to 2.0 for
    Flash 8. It is from a tsunami menu I downloaded off kirupa.com.
    There is no actions layer where al the actionscript is kept, and I
    have tried to convert it. I customized the menu and the tsunami
    effect works great, however, when I try to convert the
    actionscript, it is a mess. I am building a flash site, and don't
    want to have to import the swf containing my menu. If I do have to
    do that, will the fact that it is written in Actionscript 1 for
    Flash Player 4 have any bearing on the fact that I am making the
    site for Flash Player 8 or above? Also, how can I import just the
    text portion without any background (transparent background) in
    Flash so it lays neatly over the background I've created for the
    site? Although I have designed many flash headers and elements for
    my HTML websites, I am a newbie when it comes to Flash Site design
    and have a ton of questions, but this will get me started. Thank
    you for your time.

    The code is not in an "actions layer", it is attached to
    buttons and movie clips. Here is the code:
    colnum = "1";
    startnum = 1;
    endnum = 19;
    numberofItems = 19;
    mouseposX = int(getProperty("../dragscale", _x));
    mouseposY = int(getProperty("../dragscale", _y));
    i = startnum;
    m = startnum;
    filledSpace = 0;
    gapspace = 0;
    if (Number(myInit) == Number(FALSE)) {
    // on first run make an array of all the text Y Pos.
    while (Number(i)<=Number(endnum)) {
    set("textY" add i, getProperty ("text" add i, _y ) );
    i = Number(i)+1;
    i = startnum;
    myInit = TRUE;
    boundleft = getProperty ("../boundbox" add colnum, _x);
    boundright = boundleft + getProperty ("../boundbox" add
    colnum, _width) ;
    boundtop = getProperty ("../boundbox" add colnum, _y);
    boundbottom = boundtop + getProperty ("../boundbox" add
    colnum,_height);
    if (Number(mouseposX)>=Number(boundleft) and
    Number(mouseposX)<=Number(boundright) and
    Number(mouseposY)>=Number(boundtop) and
    Number(mouseposY)<=Number(boundbottom)) {
    while (Number(i)<=Number(endnum)) {
    myDif = (eval("textY" add i) ) - (mouseposY - boundtop);
    // percentage increase
    scaleAmount = 175-((myDif*myDif)/14);
    alphaAmount = 100-((myDif*myDif)/6);
    if (Number(alphaAmount)<50) {
    alphaAmount = 50;
    if (Number(scaleAmount)<100) {
    scaleAmount = 100;
    setProperty("text" add i, _xscale, scaleAmount);
    setProperty("text" add i, _yscale, scaleAmount);
    setProperty("text" add i, _alpha, alphaAmount);
    i = Number(i)+1;
    // *** add up total Y pixels taken by text ***
    while (Number(m)<=Number(endnum-1)) {
    filledSpace = filledspace + getProperty ( "text" add m,
    _height);
    m = Number(m)+1;
    // *** find total Y pixels not taken by text
    totalheight = getProperty ( "text" add endnum, _y) -
    getProperty ( "text" add startnum, _y);
    gapSpace = totalheight-filledspace;
    avgDistance = gapSpace/numberofitems;
    m = Number(startnum)+1;
    while (Number(m)<=Number(endnum-1)) {
    setProperty("text" add m, _y, (getProperty ( "text" add
    (m-1), _y) + getProperty ( "text" add (m-1), _height)) +
    avgdistance);
    set("watchheight" add m, getProperty ( "text" add m,
    _height));
    m = Number(m)+1;
    } else {
    // *** shrink text back when mouse rolls out
    i = startnum;
    while (Number(i)<=Number(endnum)) {
    if (int ( getProperty ("text" add i, _yscale ) ) >= 100)
    // return scale back to original state
    setProperty("text" add i, _yscale, int ( getProperty ("text"
    add i, _xscale ) ) - 1);
    setProperty("text" add i, _xscale, int ( getProperty ("text"
    add i, _yscale ) ) -1);
    if ( getProperty ("text" add i, _y) < eval("textY" add
    i)) {
    // return y position back to original state
    setProperty("text" add i, _y, int ( getProperty ("text" add
    i, _y ) ) + 1);
    if ( getProperty ("text" add i, _y) > eval("textY" add
    i)) {
    setProperty("text" add i, _y, int ( getProperty ("text" add
    i, _y ) ) - 1);
    if ( getProperty ("text" add i, _Alpha) > 50) {
    setProperty("text" add i, _alpha, int ( getProperty ("text"
    add i, _alpha ) ) - 1);
    i = Number(i)+1;

  • Convert pdf by javascript

    Is it possible to use Acrobat to convert a web page (this web page with js http://funpage.it ) into a PDF and  retain some of the basic javascript functionality that previously  existed on the webpage?  Ie. Hide/Show of fields when a link is  clicked.  I'd like to be able to do this without taking any special  steps toward making the script compatible with acrobat if at all  possible.

    No. Converting a web-page to a PDF is basically printing it to a PDF
    printer. All interactive components will be lost.

  • Convert applescript to javascript

    I have a file which contains applescript. I need to convert this script to javascript  and run it in my windows. Please help!!!

    Muppet Mark seems right.
    Translating APS to JS is someway doable. Unless the APS script uses cmd that don't have matching items in JS, it shouldn't be a problem.
    However, I don't think a script may convert  all by itself an APS script to JS.
    For generic commands such as "set x to" or "display dialog", it's quite easy but how to translate "whose", "starts", "first", "last"....?
    What if the script goes for file on the system using a tell application "Finder" block ?
    In my opinion, the translation process can only be efficiently done by a someone knowing both languages.
    Can I help you ?
    Loic

  • Converting Actionscript 1.0 to 2.0 in Flash 8

    Hi there,
    Currently, I am developing game using Flash MX which i using
    Action Script 1.0. However, I have install Flash 8.
    My question is, how am I to convert the my previous
    actionscript 1.0 to actionscript 2.0 in Flash 8?
    Thanks.

    most of it should be done by flash when you open your a.s.
    1.0 scripted swf in flash 8 that has publish settings for a.s. 2.0.
    some of it you'll need to do by hand, though.

  • (Its Urgent) Calling ActionScript from Javascript

    Hi, How to call ActionScript files from JavaScript ??? Can anyone Explain it
    with a Simple Example?? If yes,then please let me know ASAP. Thank you

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/External Interface.html
    there are at least 100 examples out there google is your best friend.

  • Converting formcalc to javascript.

    Hi there,  I would like to know if i can convert an existing formcalc script to javascript and if so how can it be done?

    The only way I know is "manually", means you have to write the scripts by yourself in the desired language.

  • Is it possible to load Flashvar again in actionscript after javascript update?

    hello,
    I'm writing a script where I need flash to check the content of flashvars more than once.
    Does anyone know if I can reload or something flashvar in actionscript? whats the command for this?
    thanks.
    Peter

    flashvars load when the swf is embedded.  if you need to repeatedly communicate between js and flash, use the externalinterface class.

  • What is the Need for communication between Flex ActionScript to Javascript

    Hi ,
    Flex has made it communication possible from FLEX Mx:script to Java Script .
    Can anybody could please tell me what is the need or any scenario  for communication Flex with Javascript
    Thanks in advance .

    1- Printing in Flex is terrible (although for simpler requirements it can do fine), true, but it's not incredibly better elsewhere in the browser unless I'm missing the point.  This can be gotten around for many by streaming PDFs or Excel spreadsheets from a server, though.
    2- If it has to be web, I guess you're stuck.  If it can be an installed app (AIR) I'd prefer to hook into Java.  Like I said, there may be some limited specific uses, but good reasons to base the majority of your app on JS hacks are hard to come by.

  • Converting actionscript 1.0 to 3.0

    Hi,
    I was wondering: I made the game Mastermind in actionscript
    1.0. But since I have Flash CS3, I've made a MP3 Player in
    Actionscript 3.0. I want to combine those 2 files. But they have
    both different Actionscripts, and that makes it impossible for me
    to combine them. Does anybody know how to make the actionscript 1.0
    file a actionscript 3.0 file?
    Thanks in advance,
    Regards,
    Ithiriel

    The problem is. I got a slider inside of it. A Volume Slider.
    And Flash 6 Player doesn't support that. If you know an other
    solution, please tell me.
    I've already tried to copy everything from my AS1 file to the
    AS3 file. And I got 100 errors. So that's not working.
    And by MP3, I don't just mean the music file, but a complete
    MP3 Player. With Play, Stop, Next, Prev buttons. Artist name is
    showed, name of number that's currently playing, etc. And a volume
    slider.
    But if you know how to import that into AS1, it would be very
    nice.

  • Flash or Dreamweaver for HTML5

    using Flash professional cs6 for creating  interactive eLearning content.
    My costumer wants to publish to web, smartphone and tablets.
    I have the plugin “toolkit create js.” For HTML5 but this gives a lot of errors not interactivity.
    Could you advise me? Do I need to import my project to Dreamweaver ?
    Thanks,
    Ton

    Flash is very useful for creating animated and interactive content and cool stuff. But the Apple iPhone and iPad will never display Flash. Ever. And on much of the Android hardware, Flash is hardly optimal.
    HTML5 offers alternatives to using Flash and those alternatives include video and audio elements that let you display video and audio on a website where, once, you had to have a Flash Plugin in a browser. You can also do really wonderful interactive stuff using JavaScript.
    Pixelpaint has a converter that will change Flash into HTML5. It's not perfect, but it does get some things done. Google offers Swiffy for conversion to HTML5, though it can't yet convert DoubleClick Studio creatives.
    Adobe also has a toolkit for CreateJS that can help you take your Flash projects to iPad and iPhone that will only work with Flash CS6. When you install the Adobe Extension Toolkit for CreateJS by using your Adobe Extensions Manager you can access it through the Flash authoring environment by going to: Window > Other Panels > Toolkit for CreateJS.
    It's not perfect. It exports all of the Flash graphics, animations, and sounds to individual assets and Javascript files that support Canvas for HTML5. It does not support Actionscript 1.0 to 3.0 and Flash's built in 3D tools. Even though the Toolkit does not convert Actionscript to Javascript yet, it does leave you in the position to be able to do it yourself by separating out assets like graphics and sound and and animations and creating readable Javascript for the timeline animations. Adobe has instructions for getting started with this toolkit online.

  • In CS6, JavaScript Running MUCH Slower than ActionScript

    Hi All,
    I am finding that in CS6, JS code runs MUCH slower than ActionScript code. I don't want to double-post here - Full details may be found where I posted them in the InDesign Scripting forum at  - CS6 JavaScript Running Much Slower than ActionScript, before I realized that this forum might be more appropriate.
    The basic gist of it is that I had a Flex/ActionScript Extension, which I obviously needed to start converting to JavaScript in advance of the next version not supporting ActionScript. I converted 20,000 lines of my business logic code from ActionScript to JavaScript (grrr...) - only to find that it now runs 5 times slower than it did in ActionScript.
    What has been the experience of others who have converted large Extensions from ActionScript to JavaScript?
    I would greatly appreciate any and all suggestions.
    TIA,
    mlavie

    Hi All,
    I am finding that in CS6, JS code runs MUCH slower than ActionScript code. I don't want to double-post here - Full details may be found where I posted them in the InDesign Scripting forum at  - CS6 JavaScript Running Much Slower than ActionScript, before I realized that this forum might be more appropriate.
    The basic gist of it is that I had a Flex/ActionScript Extension, which I obviously needed to start converting to JavaScript in advance of the next version not supporting ActionScript. I converted 20,000 lines of my business logic code from ActionScript to JavaScript (grrr...) - only to find that it now runs 5 times slower than it did in ActionScript.
    What has been the experience of others who have converted large Extensions from ActionScript to JavaScript?
    I would greatly appreciate any and all suggestions.
    TIA,
    mlavie

  • CS6 JavaScript Running Much Slower than ActionScript

    Dear All,
    In advance of the next version of InDesign CC, which will only support HTML5 and JavaScript, I converted all of my Extension's business logic from ActionScript to JavaScript - about 20,000 lines of code.
    I am using CS6 to run my Extension, and I call my JavaScript methods from within legacy Flex/ActionScript event-handler code using this methodology:
    [Embed(source="MyJSModule1.jsx", mimeType= "application/octet-stream" )]
    private static var _myJSModule1:Class;
    [Embed(source="MyJSModule2.jsx", mimeType= "application/octet-stream" )]
    private static var _myJSModule2:Class;
    _interface = HostObject.getRoot(HostObject.extensions[0]);
    public static function Initialize()
    _interface.eval(new _myJSModule1.toString());
    _interface.eval(new _myJSModule2.toString());
    _interface.myJSMethod();
    I have found that my InDesign Extension runs about 5 times slower in JavaScript than it did in ActionScript.
    Posts I read on the web seemed to indicate that JS would only be about 30% slower.
    Would the upcoming V8-based and Node.js-supporting environment be any faster?
    I really, really need help with this.
    TIA,
    mlavie

    Hmm,
    at that project/code size you get at plenty points where things matter that would be irrelevant in smaller scripts. A few years ago I extended and re-architectured a similar project, by thorough optimizations we got an speed increase of roughly tenfold, of course partially eaten up by new features.
    For the beginning: rather than issuing 80 evals, for deployment I'd compile such an enormous pile of sources into a single file. For debugging, #include is much more fun.
    As you mention argument passing of large xml, that's one area where ExtendScript can seriously slow down. Besides you'll probably find a size limit of about 64k for the underlying XML. We used InDesign document XML for working data, while smaller configuration data was parsed into js objects as soon as possible. I wrote a JSX abstraction layer that would work on either kind of XML.
    Next problem - number of prototype slots. It definitely makes a difference if you have too much, I partitioned objects into cross-linked clusters, similar to the plugin object model (boss classes), the whole enchilada supported by an underlying framework that generated JSX collections etc. by a few declarations, roughly the equivalent to templates in other languages.
    At least you're using prototypes - one really big issue with ExtendScript is the explosion of object allocations when you apply the typical closure-based JavaScript style from web programming. Eliminating them was a very big effort in our rewrite, but also gave a pretty good improvement. At least ExtendScript can produce allocation statistics, use them. Also use them to find and eliminate circular link object leaks etc. A while ago I wrote a diff utility that extends $.summary(), InDesign Server also has some goodies.
    Have you noticed ESTK's profiler? Unfortunately it just gave up at our code size, probably it will also for yours. Instead I used an own profiler with several additions, e.g. I could apply the profiler selectively to some modules while already optimized modules were skipped. It really helps to know your candidates when management pressures for "quick wins" ... Where is most absolute computation time burnt, or what methods are invoked a couple 10000 times too often for your gut feeling. Again, eliminate dead code and thus reduce prototype/object slot count. When your central class has 100s properties and matching get/set methods, eliminating them one by one produces measurable improvements.
    Of course I also tracked down some offending statements where the same value was assigned over and over again causing severe text recomposition while nothing was actually changed ... You can only find such problems with exact measurements.
    Other areas of fun: under the hood (at C++ level) every temporary text expression is backed by an enormous aggregation "suite", there are many things you can do wrong there. For example these things just pile up and are rarely purged, therefor it has become common wisdom to do an occasional save() for lengthy scripts.
    Again at the XML side: if you do severe document XML (we did), there are some circumstances where text attributes will get lost/ignored. There are ways to speed up expressions underlying references to document XML, and so forth. To know when to rebuild the XML expressions or when they can be reused is a science for itself. Same goes for other objects, as you already mention getElements(). Sometimes it helps, sometimes it is just a waste of execution time.
    As you mention the advantage of SSDs: How frequently do you dump those jsx sources into ExtendScript? If you currently use the "main" session (is that possible for HTML extensions at all?), utilize persistent sessions instead - when you have eliminated your object leaks.
    There are plenty more optimizations, I probably should write a book - to be sold in about 5 copies. Unfortunately the strongest advice in its preface would be to not use ExtendScript/JavaScript at all for large scale projects, because they turn into a maintenance nightmare where other languages catch errors on compile time. Dependent on client preference I'd probably turn to Java or do the whole thing in C++, at increasing code size development speed will be roughly on par.

  • Convert HTML/javascript AIR app to flex-based AIR app?

    Hi all,
    I've already built an AIR app using HTML/javascript that I
    would like to monetize.
    I would like to use O2app's E-Commerce framework, which right
    now only supports Flex-created AIR apps.
    My question: Is there a simple way to "convert" an
    HTML/javascript AIR app to Flex 3 format? I'd rather not have to
    rebuild the app from scratch in Flex 3 if I don't have to. :)
    Thanks,
    Al

    Hi,
    There's no simple way to convert an HTML AIR app to flex.
    But it is possible to create HTML Root windows from a Flex
    AIR App. By root window, I mean the same kind of window that is
    launched when you launch an HTML AIR App.
    For more info, look at the HTMLLoader.createRootWindow()
    call. (This will be available from a Flex AIR app as well)

Maybe you are looking for

  • Using external display

    Right now I have an iBook G4, but next month when leopard comes out I am thinking about upgrading to the macBook Pro. I want to use my 23 inch LCD tv as an external monitor, and I am wonderring what the best way to do this would be. I am planning on

  • How to restrict pan area in oracle map viewer?

    Hi, I have added map to Jpanel,Now I want to restirct panning functionality of map to a defined area.Because when I keep on panning to extreme East or West side even when my map boudaries are panned completely,I can still drag the map and So,after so

  • Maximum window size

    hello, What is the maximum window height that can be set Regards, jyothi

  • Some issues that I'm having with the iPhone 3G

    Just bought a 3G iPhone and there are two issues that I am having with it that I was wondering if someone could help me with. First, when I am listening to music with the apple headphones and I turn the volume to zero, I can still hear the music. It'

  • Make a GUI display an image

    Im having trouble adding an image to a GUI, ive tryed adding it the same way I would add a JLabel (seeing as there both swing components, i asumed it would work) but it wont work, heres my code. import javax.swing.*; import java.awt.*; public class H