Starting Animation From JavaScript

Hi.
I just made my first edge animate project and made a progress loader animation. Works well.
When i placed the code in the site the animation was always on, so i've hidden the item in css
#Stage { display:none; }
When my animation is needed i'm making is visible however the animation has already been started in the background so wont begin the right place.
I'm wondering should i stop the stage autoplay in the config and then start the animation in JS? If so how can i go about starting the animation via JS.
I've been playing around with  AdobeEdge.bootstrapCallback but cant seem to get it to play.
Many thanks.

Thanks Elaine. That got it.
Added
AdobeEdge.bootstrapCallback(function (compId) {
comp = AdobeEdge.getComposition(compId).getStage();
then
comps.play(0); when i make my indicator visible

Similar Messages

  • Next button in symbol, start animation from the timeline and after 3 sec playReverse

    Hello,
    I have a next button in a symbol. When I click on the button I would like to start the animation from the timeline.
    It wil starts at one second. But if the timeline is after 3 seconds I would like to play the animation backwards (if you click on the same button).
    I tried it with the code below but it starts always at 1 second.
    var pos = sym.getPosition() //
    if (pos <= '1000'){
             sym.getComposition().getStage().play(1001);
    else if (pos <= '3000'){
              sym.getComposition().getStage().playReverse(2999);
    Can anybody help me with the code?
    Thanks!

    Hello,
    Thanks for the demo file, I checked it, tried it in my project and it works.
    But I think I have to explain better.
    I have a button in the symbol. When I am between 0 and 1 second on the stage timeline
    and I click on the button. The stage timeline (slider) will start from 1 second till 2.
    But when I'm in the timeline after 3 seconds (doesn't matter if its at 10 sec) and I click on the button,
    I would like to play the stage timeline from 3 seconds till 2.
    Is this possible and how do I do that?
    Thanks

  • Start Computation from Javascript APEX 4.0

    Hello,
    I'm using Apex 4.0 and i need to do a computation to get the value from the database for some items.
    The problem is that i must run this computation by pressing a link(javascript).
    I would like to know if i can start a computation from a javascript function.
    Thanks in advance,
    Kind Regards,
    Dan

    Hi Dan,
    the easiest way to do this is using the ApexLib Framework, this comes with "AJAX Computations". See this Blog posting for Details: http://www.oracle-and-apex.com/ajax-computations-rich-client-feeling/
    brgds,
    Peter
    Blog: http://www.oracle-and-apex.com
    ApexLib: http://apexlib.oracleapex.info
    BuilderPlugin: http://builderplugin.oracleapex.info
    Work: http://www.click-click.at

  • Start program from javascript in adobe reader

    Hi,
    I'm trying to develop a javascript that add a button.
    When the user click on the button, the javascriopt should run an executable, wait for the end of the process, then open a text file and save the pdf as the content of this text file.
    I've found how to open the text file in the api reference but i can not run the exe.
    Has anybody already done before?
    thx a lot
    Benjamin

    So, i have to develop them on a computer with the pro version to correctly compile the plugin?
    For testing I have copied an api file (already compiled) from the sdk folder to the plugin folder, i have disabled the certified mode but I cannot see this one into the list (see pic)
    What i'm trying to do is simple:
    Ad a save button, when the user click on this button, the plugin will have to run a program that write a path into a text file. After closing the program, the plugin will read the path and then save the opened pdf at this place.
    I think that the acrobat pro is a little bit "overkilled" for tht stuff, don't you?
    Javascript can do that:
    var shell = new ActiveXObject("WScript.shell");
    shell.run("explorer.exe");
    Why the adobe reader is not able to do that?

  • How to start animation from var

    Am trying to start my symbol from a var... but it just don't works, even if i gave it constant
    For example:
    var s2 = 35000;
    sym.getSymbol("second_arrow").play(s2);
    Whats wrong with it??
    thanks

    The variable declared inside a function, can't be accessed outside of it.
    So, better instead of declaring the variable "s" inside updateClock() function, declare it above that function definition, and things will work.
    See below:
       var s;
        var updateClock = function(){
              s = currentSeconds * 1000;
        updateClock();
        sym.getSymbol("second_arrow").play(s);  // now "s" is accessible
    hth,
    Vivekuma

  • Facebook like & twitter tweet buttons disable my animation from starting

    Hi,
    I have just added social media buttons (G+, tweet, like) to my web page and they seam to interfereing with my animation. I am using the HTML method for facebook like, however if I use IFRAME method everything works fine in Firefox and Chrome BUT NOT Safari. Also I don't wish to use the IFRAME as when the user clicks like the post popup does not display.
    Predominently Safari seams to be most problematic. I have tried moving the JS to the end of the file etc but nothing works. Also my html for the buttons is after the edge animation html.
    Is there a way to get these buttons to work whilst not interfering with my animation from loading and playing.
    Here is my page http://goo.gl/d948f
    P.S If you reload the page a couple of times it fixes itself.

    First, I would eject whatever it is that you downloaded. Go to Finder and eject it that way or depending how you have your system set up, do the two finger tap and Eject it. Download the link above. Once it downloads, double click it to install it. It should work. If it doesn't you need to use your Disk Utility to check for errors. Click your Finder again and then Applications. Scroll down to Utilities and then Disk Utility. Click on your hard drive and you will get a menu of items on the right side. Towards the bottom, you will see a button to Verify Disk Permissions. Click that and let it run. It may take a few minutes to finish. Once it's finished there may be a list of things wrong with your system. Click the Repair Permissions and let the computer do it's thing. Use Disk Utility at least once a month to make sure everything is in order on your system. If this doesn't fix it, I don't have any other suggestions. I'd hate to say do a fresh install but that might be the next step if this doesn't work.
    Something else to consider is that is if you use Time Machine and the system did work at one point, you could go back to the last known good point and reinstall that back-up. You would lose anything you have saved since that point (obviously). If you take steps to back up your information, that should not be an issue. (For me), Time Machine works as advertised. If you are not backing system up regularly, shame on you. You need to start ASAP backing up. It's an easy process and it's times like you are having now, that make the small preventive maintenance, worth extra time and effort.
    Good luck.

  • How to get FindAgain & FindPrevious from javascript OR other options

    Hi All, I'm trying to use the 'SearchResults -> Next Hit [Old]     'SearchSubmenu -> FindAgain' [New]
    Out of all these: Find | FindSearch | SearchSubmenu | FindAgain | FindPrevious
    Only 'Find' and 'FindSearch' works from javascript - None of others worked on Adobe 9 Pro:
    For example: app.execMenuItem("FindAgain") did not work and no errors on debugger,
    Please let me know, how I will be able to get to the next search item and previous search item from app.execMenuItem
    I even tried these two to include with priv restrictions: app.beginPriv(); app.execMenuItem("FindAgain"); app.endPriv();
    ========================================================================================
    I'm attaching the zip file that contains the two required files to view a pdf in a browser through html.
    History: I'm working on this to help a old aged home where they have touch screens and it is very difficult for some to identify a pdf tool bar buttons or use their pdf's efficiently.
    So, I was thinking about it for over six months and started two weeks back to really help them. Though I did not expect that it is going to make me purchase pdf 9 pro. I did. But, even after that with all these hours working on this, I could not get this working.
    I got few samples from Jeff's:    http://www.adobe.com/devnet/air/ajax/quickstart/scripting_pdf.html
    I did use these files and trying to get that only feature which is 'Find Next' and 'Find Previous'. In fact tried almost all 'AcroSrch.....  es
    In the html, I have hard coded a search string 'lorem' with #search=lorem..., I plan to get a new search string from other html page. I will do it later.
    As per Jeff, I had that 'Edit java Script' inlcuded in the pdf file.
    If you get a chance please check the attachment. (Open test.html in the browser)
    IS THERE ANY OTHER WAY IN THIS WHOLE WORLD TO GET THIS 'FIND NEXT' and 'FIND PREVIOUS' to work? OR ANY OTHER IDEAS THAT WOULD GET THIS WORKING. THANKS A LOT. OR ATLEAST IN OLDER VERSIONS, IF POSSIBLE, ANY IDEAS THAT WOULD BE MOST WELCOME
    ========================================================================================
    if you can think of any ideas which can make this happen, it can be any even to buy some additional software or option to add some buttons in pdf itself that can do the job or sending the keyboard shortcuts commands like 'Ctrl+G' and 'Shift+Ctrl+G' [which does the same like 'FindNext' 'FindPrevious'] to the pdf object from the html button action would help,

    Both app.execMenuItem("FindAgain") and app.execMenuItem("FindPrevious") work just fine in Acrobat 8 Pro (from the console), but only after manually running the Find version once.
    Think about it, all that JS does is call these functions. So calling Find from JS will basically not do anything because you can't specify to it what to search for. Even typing the string you want to search for in the "find" field doesn't work.
    If you want to find words in a file using a script you will need to use getPageNthWord.

  • Calling1.4.1 signed applet from Javascript causes keyboard/focus problems

    Pretty sure there's a JRE bug here, but I'm posting to forums before I open one in case I'm missing something obvious :-)
    This issue may be specific to IE, I haven't tested elsewhere yet. Our web application is centered around a signed applet that is initialized with XML data via Javascript. We first noticed the problem when our users started upgrading from the 1.3.x plug-in to the 1.4.x plug-in. The major symptom was that shortcut keys stopped working. I debugged the problem off and on for about a month before I boiled it down to a very simple program that demonstrates the issue (included below). Basically, the program has a function that adds a JButton to a JPanel and registers a keyboard listener (using the new DefaultKeyboardFocusManager class) that prints a message to the console. This function is called by the applet's init() method, as well as by a public method that can be called from Javascript (called callMeFromJavascript()). I also included a very simple HTML file that provides a button that calls the callMeFromJavascript() method. You can test this out yourself: To recreate, compile the class below, JAR it up, sign the JAR, and put in the same dir with the HTML file. Load the HTML file in IE 5.0 or greater, and bring the console up in a window right next to it. Now click the button that says init--you should see the small box appear inside the button that indicates it has the focus. Now press some keys on your keyboard. You should see "KEY PRESSED!!!" appearing in the console. This is proper behavior. Now click the Init Applet from Javascript button. It has removed the button called init, and added one called "javascript". Press this button. Notice there is no focus occurring. Now press your keyboard. No keyboard events are registered.
    Where is gets interesting is that if you go back and make this an unsigned applet, and try it again, everything works fine. This bug only occurs if the applet is signed.
    Furthermore, if you try it in 1.3, signed or unsigned, it also works. So this is almost certainly a 1.4 bug.
    Anyone disagree? Better yet, anyone have a workaround? I've tried everything I could think of, including launching a thread from the init() method that sets up the components, and then just waits for the data to be set by Javascript. But it seems that ANY communication between the method called by Javascript and the code originating in init() corrupts something and we don't get keyboard events. This bug is killing my users who are very reliant on their shortcut keys for productivity, and we have a somewhat unique user interface that relies on Javascript for initialization. Any help or suggestions are appreciated.
    ================================================================
    Java Applet (Put it in a signed JAR called mainapplet.jar)
    ================================================================
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MainApplet extends JApplet implements KeyEventDispatcher
        JPanel test;
        public void init()
            System.out.println("init called");
            setUp("init");
        public void callMeFromJavascript()
            System.out.println("callMeFromJavascript called");
            setUp("javascript");
        private void setUp(String label)
            getContentPane().removeAll();
            test = new JPanel();
            getContentPane().add( test );
            JButton button = new JButton(label);
            test.add( button );
            test.updateUI();
            DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
        public boolean dispatchKeyEvent(KeyEvent e)
            System.out.println("== KEY PRESSED!!! ==");
            return false;
    }================================================================
    HTML
    ================================================================
    <form>
    <APPLET code="MainApplet" archive="mainapplet.jar" align="baseline" id="blah"
         width="200" height="400">
         No Java 2 SDK, Standard Edition v 1.4.1 support for APPLET!!
    </APPLET>
    <p>
    <input type="button" onClick="document.blah.callMeFromJavascript();" value="Init Applet via Javascript">
    </form>

    I tried adding the requestFocus() line you suggested... Same behavior.
    A good thought, but as I mention in my description, the applet has no trouble gaining the focus initially (when init() is called). From what I have seen, it is only when the call stack has been touched by Javascript that I see problems. This is strange though: Your post gave me the idea of popping the whole panel into a JFrame... I tried it, and the keyboard/focus problem went away! It seems to happen only when the component hierarchy is descended from the JApplet's content pane. So that adds yet another variable: JRE 1.4 + Signed + Javascript + components descended from JApplet content pane.
    And yes, signed or unsigned DOES seem to make a difference. Don't ask me to explain why, but I have run this little applet through quite a few single variable tests (change one variable and see what happens). The same JAR that can't receive keyboard events when signed, works just fine unsigned. Trust me, I'm just as baffled as you are.

  • Newbie qs. how to find duration or set position (in time) of a flash movie from Javascript?

    I am trying to control the Flash player browser plugin from
    Javascript.
    - I need to set the start position to play, based on time.
    example, setPosition(10 seconds)
    However I notice that the flash player API is based upon
    number of frames.
    for example, the methods TotalFrames() and GotoFrame() are
    based on frame number.
    How do I convert it to time? I don't see a frame rate
    variable.
    I don't see a call to access this - but the duration of a
    clip is always shown near the slider
    - can I also query the duration from the player?
    - I also need a callback into my Javascript object when an
    event occurs - for example,
    when the player stops playing because it is stopped by the
    user. Should work on earlier versions than Flash 8.
    Any help appreciated.
    thanks,
    Anil

    no replies?

  • Keep getting a message from Javascript (not Java)- "Uninstall Set", help it will not go away

    Each time I use Firefox, the message "Uninstall Set" keep popping up from Javascript (not Java). I can not use Firefox because this keeps popping up.

    That would be from an extension, anything similar from Firefox would have been cleaned up. If you'd been on 4.0.1 for a while and it just started happening, then I'd try Tools > Add-ons > Extensions then on the gear wheel choose "View Recent Updates" the date will appear the list small and the. The "last updated" button near top right does something mysterious.
    To see list in normal fashion again choose "Appearances" then return to "Extensions".
    If you dislike the formatting of the Add-ons list during normal viewing you can improve it tremendously with a custom style:
    * [https://addons.mozilla.org/firefox/addon/stylish/ Stylish :: Add-ons for Firefox]
    * [http://userstyles.org/styles/42112/firefox-4-compact-addons-manager Firefox 4 - Compact Addons Manager - Themes and Skins for browser - userstyles.org]
    From the wording the message could possible be referring to a Collection of Extensions. I avoid collection sets like the plague.
    Also see related answer
    * [https://support.mozilla.com/en-US/questions/824098 i keep getting a pop up saying uninstall set | Firefox Support Forum | Firefox Help] by Cor-el.

  • About Animation from EDGE on Windows 8 apps?

    Hi, My name is Michel.
    So. I'm wonder if I could put some animation into a app made on Visual Studio Epress. Creating an aplication in Javascript with HTML5, just importing the files created/exported from Adobe Edge animate.
    I think could be a nice work in apps put some animations from EDGE AN.
    Thanks for any information.

    Hi, I'm trying the same thing and just figured out how to get this working. When you publish your Edge Animate composition do the following:
    Publish for Web and make sure all three checkbox options are deselected.
    When you move your published files into your VS solution, make sure you copy over the "edge_includes" folder along with all other assets.
    Open your Edge composition's HTML file and copy the Adobe Edge Runtime script and the <div id="" class=""> codes into the VS project's HTML file between the head and body tags respectively.
    That should do it!
    -Sam

  • Calling from javascript a method which uses accesscontroller.dopriviledged

    Hello everybody!
    I've a problem in accessing my pc resources from a signed applet when calling methods from Javascript.
    If I try from start() or init() methods, I can do it, but as soon as I try from anoter method defined by myself, it throws this me an AccessControlException:access denied.
    I googled and found that I should use this code:
    KeyStore smartCardKeyStore= (KeyStore)
                 AccessController.doPrivileged(
                           new PrivilegedExceptionAction() {
                             public Object run() throws KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException, IOException {
                                 KeyStore alfa;
                                 alfa = KeyStore.getInstance("PKCS11",pkcs11Provider.getName());
                                 alfa.load(null,null);//this is the point where it trhew the AccessControlException
                                 return alfa;
                         );The problem is that with this code, I can't get it work with Firefox (which doesn't throw any exception, just won't work!) neither with IE, which throws this:
    netscape.javascript.JSException: Nome sconosciuto.
    java.lang.Exception: netscape.javascript.JSException: Nome sconosciuto.
         at sun.plugin.com.DispatchImpl.invokeImpl(Unknown Source)
         at sun.plugin.com.DispatchImpl$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at sun.plugin.com.DispatchImpl.invoke(Unknown Source)Please, help me! I'm in a big trouble, since I should finish my project asap and I am not able to pass this cumbersome obstacle...
    Thank you in advance! :)

    Hi! Don,
    You cannot call methods which breach Security from Javascript. That is what SUN says.
    But there is a hack, or a work around...
    Declare a boolean Variable , say named buttonClicked.
    Initailly keep its value false(default).
    Write an inner class that extends a thread class whose RUN method will contain the following piece of Code:
    public void run(){
        while(buttonClicked){
                     KeyStore smartCardKeyStore= (KeyStore)
                 AccessController.doPrivileged(
                           new PrivilegedExceptionAction() {
                             public Object run() throws KeyStoreException, NoSuchProviderException, NoSuchAlgorithmException, CertificateException, IOException {
                                 KeyStore alfa;
                                 alfa = KeyStore.getInstance("PKCS11",pkcs11Provider.getName());
                                 alfa.load(null,null);//this is the point where it trhew the AccessControlException
                                 return alfa;
    }You start the Thread inner class in your init method.
    So, its RUN method will continuously be waiting to go into the while loop.
    And in your start method you will set the +"buttonClicked"+ variable to true upon a Javascript onclick event of a button.
    So, the moment you click a button, you only set the buttonClciked variable to true in your start method--------
    This does, in no way breach security. So no exception is thrown.. But the code which breaches security is initiated by another thread other than that spawned the Applet; so the browser does not care anything about its privileges. It just lets the execution of the code.
    I hope it works for you; be in contact, if it doesn't.
    Thanks and Regards,
    Samba

  • Help with calling java functions from javascript

    I am using javax.script to interpret javascript from a java applet. it loads the js file into a string, and then does engine.eval(script_string). My question is, how would I make functions in the class file that are available to javascript?
    Update: Instead of that, I am loading a js script that will contain all of the usable functions. Here it is:
    //core.js for Javasphere 0.31
    var pkgs = new JavaImporter(java.lang, java.lang.System, java.awt);
    with(pkgs) {
    function Abort(msg) {
            var graph = new Graphics();
            g = graph.getgraphics();
            g.drawString(msg, 20, 20);
    }When I do engine.eval("Abort(\"something\")"); it throws this error:
    javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: error instantiating (0): class java.awt.Graphics is interface or abstract (<Unknown source>#8) in <Unknown source> at line number 8

    Eggbertx, let's start from scratch if you don't mind. Say you have this Applet
    pubic class MyApplet extends Applet
      String message;
      //CALL THIS METHOD FROM JAVASCRIPT
      public void setMessage(String msg)
        message = msg;
        // this saves you from having
        // to call getGraphics() from JavaScript
        repaint();
      public void paint(Graphics g)
        g.drawString(message, 10, 30);
    }Then in your HTML file you may have something like this:
    <input type="text" id="msg" value=""></input>
    <input type="button" value="Set Message" onclick="setAppletMessage()"></input>
    <applet id="myApplet" code="MyApplet.class" width="400" height="100"></applet>And in the JavaScript file:function setAppletMessage()
      var msg = document.getElementById("msg").value;
      document.myApplet.setMessage(msg);
    }This is about all you really need to do. See how the Graphics object is no longer in your .js file?
    Note: You may run into other difficulties in getting this code to work because of browser, security, or some other pain-in-the-neck issues, but this is the idea.
    Eggbertx, I see you added a star to my first post and I think you should take that off because:
    1. <tt>Component</tt> is abstract... so you can not call the <tt>new</tt> operator.
    2. The call <tt>component.getGraphics()</tt> is not going to work either, because <tt>component</tt> was never created.

  • Animate 1.5 Can you trigger animation from elsewhere on the html page (ie outside Adobe Div)?

    I would like to use a button and jquery to trigger the animation from elsewhere on my web page (outside the Adobe Div) on  Adobe Animate 1.5.
    Is this possible?
    (I looked here but my javacript is only beginner level. http://www.adobe.com/devnet-docs/edgeanimate/api/old/1.5.0/EdgeAPI.1.5.0.html)

    <!DOCTYPE html>
    <html>
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
      <title>Africa</title>
    <!--Adobe Edge Runtime-->
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <script type="text/javascript" charset="utf-8" src="edge_includes/edge.5.0.0.min.js"></script>
        <style>
            .edgeLoad-EDGE-Africa { visibility:hidden; }
        </style>
    <script>
       AdobeEdge.loadComposition('Africa', 'EDGE-Africa', {
        scaleToFit: "none",
        centerStage: "none",
        minW: "0",
        maxW: "undefined",
        width: "100%",
        height: "3000px"
    }, {dom: [ ]}, {dom: [ ]});
    </script>
    <!--Adobe Edge Runtime End-->
    <!--Adobe Edge Runtime-->
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <script type="text/javascript" charset="utf-8" src="edge_includes/edge.5.0.0.min.js"></script>
        <style>
            .edgeLoad-EDGE-America { visibility:hidden; }
        </style>
    <script>
       AdobeEdge.loadComposition('America', 'EDGE-America', {
        scaleToFit: "none",
        centerStage: "none",
        minW: "0px",
        maxW: "undefined",
        width: "100%",
        height: "2108px"
    }, {dom: [ ]}, {dom: [ ]});
    </script>
    <!--Adobe Edge Runtime End-->
    </head>
    <body style="margin:0;padding:0;">
      <div id="Stage-Africa" class="EDGE-Africa">
      </div>
        <div id="Stage-America" class="EDGE-America">
      </div>
    </body>
    </html>

  • Can JWS accept somekind of param's values from JavaScript

    Like in Applet we could pass a param's value from JavaScript. Is it possible to do something similar to JWS?.
    Thanks.

    Java Web Start is implemented as a browser helper application, the browser downloads
    the jnlp file, and launches javaws with that downloaded temp file as an arg. Because of this
    you cannot pass args to javaws except thru the jnlp file.
    The most common way to dynamically generate args and parameters to a javaws app is
    to dynamically generate the jnlp file use a jsp page or a servlet.

Maybe you are looking for