Animation using JavaScript

Hi,
I have created an animation exercise for an eLearning lesson in a program that uses JavaScript as the scripting for a Windows executable. A retired social worker who creates these eLearning materials as give-away's to help people in the community improve health, it would be a big help to reaching more people if instead of a Windows executable version, the animation could be developed in a web page. A lot more people could view the eLearning and try this exercise which trains people in pacing their breathing.
The animation has a 300X300 circle on the canvas with a couple of text input boxes and a start button. The JS < 50 lines of script, but since it was not developed for a web page, it has no tags and it depends on objects like the circle or button (or 2 audio files to craete the inhale/exhale sounds) that were already placed on the canvas in the Windows executable program.
I'm not very skilled using Dreamweaver CS5, but with help, reading, references can try to convert this JS into a web version, if it's possible. Not sure how to do this and would appreciate any help.
I am adding a screenshot of the interface and the JS functions that are called by the start button.
//JS: ( bar1 is the variable entered by the use as breaths per minute-BPM; time1 is the exercise length; the variables initially are set as follows: time1=15, //volume=100)
var time1
function minuteTimer()
breakLoop = false
stopLoop = false
fork (calcBreathing)
for (var i=0;i<time1;i++)
    wait(60)
    breakLoop = true
    Submit.Show()
    Text122.Show()
    Text12.Show()
    TextInput22.Show()
    TextInput2.Show()
    Submit2.Hide()
    TextInput2.SetTransparency(0,false)
    TextInput22.SetTransparency(0,false)
    Text12.SetTransparency(0,false)
    Text122.SetTransparency(0,false)
    Text5.SetTransparency(0,false)
    Frame12.SetTransparency(0,false)
    Submit.SetTransparency(0,false)
    TextInput2.Enable(true)
    TextInput22.Enable(true)
    Debug.trace("\n minutes elapsed "+(i+1)+"\n")
stopLoop = true   
function calcBreathing()
    var bar2 = 60/bar1
    for (loop = 0;loop<bar1;loop++)
        mySound.Play(1,volume)
        Vector8.Scale(.5,.5, bar2*.3)
        mySound.Stop()
        wait (bar2*.05)
        mySound2.Play(1,volume)
        Vector8.Scale(-.5,-.5,bar2*.6)
        mySound2.Stop()
        wait (bar2*.05)
        if (breakLoop) break
    breakLoop = false
    if (bar1 > 6) bar1--
    if (!stopLoop) calcBreathing()
Any help appreciated. Thanks very much.
Kind Regards,
saratogacoach

joel pau thank you for all the support.
now i will explain the anwer if anyone else will be stuck with the same problem.
first of all in edge animate need to mark all the things that created and "convert to symbol"(mark all and right click).
second:
in the top of your html file you got the script to the edge_preLoad.js .....
so now in your js code:
lets say we use append to add new div to our code and now we got <div id="new"</div>.
$.Edge.getComposition("yourCompositionID").createSymbolChild("yourSymbolThatCreatedInStepO ne","#new");
like this you can get new animation of the same composition.
if you want to conroll the animation you just need to take the id of the new symbol your created using jquery or any way you like.
and example of control it:
$.Edge.symbol.get("#theNewID").play();

Similar Messages

  • Can I use JavaScript to force objects to overlap a Web Object in Captivate 7?

    Hi, so I have all of these great ideas for using Web Objects to enhance my courses, but am discouraged by the fact that I can't seem to get anything to overlap a Web Object. The only thing I can seem to get to overlap a Web Object is another Web Object. I have found that buttons seem to still work under the Web Object (which is good) but I really would like to know of a way to allow things on the Captivate timeline to be viewed on top of them. Things like text fields and images.
    I've seen posts about how to use JavaScript to have the menu show above Web Objects, but that code doesn't seem to work for regular objects. I read that Web Objects sit in an "<iframe>" tag and that that forces it to appear above everything else. I'm left wondering if it is possible to get around this by somehow putting Captivate objects in an <iframe> of their own with JavaScript? Or is there some other way? Does anybody know any JavaScript I can apply to Captivate objects to get them to appear above a Web Object?
    Thanks,
    Dan

    So I have come to learn that the "<iframe>" tag for a Web Object is simply a window that sits on top of the course. Now I'm wondering if anyone has an effective method for importing flash quality animation (in whatever form) that can sit underneath of Captivate objects and still be HTML5 compliant?
    Thanks,
    Dan

  • Change shape height using javascript

    Hi, is it possible to change e.g. the height of a Shape using javascript?

    I believe you can do this.
    Once you have the information (variables) that you want to display in the graph, call a javascript function.
    In this function it will ask the CP file for the variables you set:
         cp.cpEIGetValue("m_VarHandle.yourVariable Name");
    you'll have to write a loop to put all of the variable in an array.
    If you are using an LMS you can store and retreive the info there, if not you will have to write the array in a cookie.
    Build a webpage with just a graph. Have that page read the cookie and build the graph based on those variables. Insert the web page into Captivate using the Web Object.
    Worked for me in a simplified version. I also used this tutorial for the graph which is quite fancy (coding.smashingmagazine.com/2011/09/23/create-an-animated-bar-graph-with-html-css-and-jque ry/), there are other pages to build dynamic graphs though.

  • Why does Firefox 35.0.1 crash regularly on many sites that use javascript image rotation?

    Since the latest update to version 35, many sites that use javascript to manipulate images tend to crash firefox and make either the guilty tab or all of firefox close suddenly. (Firefox on Debian 7 Wheezy Linux, all updates current). I use firefox daily for web development and this regression bug is VERY annoying for my workflow. I understand you cannot take every situation into account. I do not have the time to investigate what has made Firefox less stable. I really hope you can fix this performance problem. If I can do anything concrete to help besides jumping into the code, let me know.

    '''[https://addons.mozilla.org/en-US/firefox/addon/flashblock/ Flash block]''' {web link}
    Never be annoyed by a Flash animation again! Blocks Flash so it
    won't get in your way, but if you want to see it, just click on it
    If you have problems with current Shockwave Flash plugin versions then check this:
    * see if there are updates for your graphics drive drivers
    '''https://support.mozilla.org/kb/upgrade-graphics-drivers-use-hardware-acceleration'''
    * disable protected mode in the Flash plugin (Flash 11.3+ on Windows Vista and later)
    '''https://forums.adobe.com/message/4468493#TemporaryWorkaround'''
    * disable hardware acceleration in the Flash plugin
    '''https://forums.adobe.com/thread/891337'''
    See also:
    * '''http://kb.mozillazine.org/Flash#Troubleshooting'''

  • How can I automatically close a dialog box using Javascript after I click the OK button to submit it?

    How can I automatically close a dialog box using Javascript after I click the OK button to submit it? I don't want to have to X out of the dialog box after I am done.
    Thanks
    Linda

    JS can not interact with open dialogs in any way, unless it's a dialog
    created in JS using the Dialog object.
    On Thu, Jul 24, 2014 at 11:13 PM, lindaeliseruble <[email protected]>

  • How to retrieve value of one column to other in Apex using Javascript

    Hi all,
    Can any one help me in solving this problem.
    How to send a value from one column to another column using javascript in Apex. I heard that we can use onChange().
    My requirement is,
    I have a column(Varchar2) in form where i need to enter a value and the data need to be sent to another column(Number) when i press apply changes.
    ex: if i enter a value say 1/3 or 1/4 or 1/3*1/6
    the result should be entered in the other column.
    Message was edited by:
    Raman

    Try something like
    html_GetElement('P1_ITEM2').value = eval(html_GetElement('P1_ITEM1').value);

  • How to show modal window without popup in a web page using javascript

    Hi,
    How to show modal window without popup in a web page using javascript, means when the modalwindow is opened it should not ask for popup blocker alert......
    pls help me.....

    Thanx for ur reply,
    Actually the senario is when i click on a button, another jsp page should be displayed in a modal window without popup, but the functions alert() and confirm() will not accept the url path of the another jsp page...

  • How to create new subsite while adding new item to the list by using javascript?

    hi,
    I hav a task ie, when I add item to the list then subsite will create with that list item title and description . So By using javascript, I have to create subsite while adding new item to the list.
    Help me to solve this.
    Thank you, 

    Is your item getting added through Javascript client object model ? If yes, you can write in the success delegate of your list creation method the logic to create the subsite.
    function CreateListItem()
    var clientContext = new SP.ClientContext.get_current();
    var oList = clientContext.get_web().get_lists().getByTitle('List Name');
    var itemCreateInfo = new SP.ListItemCreationInformation();
    this.oListItem = oList.addItem(itemCreateInfo);
    oListItem.set_item('Title', 'My New Item!');
    oListItem.set_item('Body', 'Hello World!');
    oListItem.update();
    clientContext.load(oListItem);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.CreateListItemOnSuccess), Function.createDelegate(this, this.onQueryFailed));
    function CreateListItemOnSuccess() {
    var subsiteTitle = oListItem.get_item('Title');
    //Logic to create a subsite
    function onQueryFailed(sender, args) {
    I have added a sample flow for the above scenario. Have a look at the following lnk for how you can craete a subsite using ecmascript.
    http://ravisoftltd.wordpress.com/2013/03/06/sharepoint-2010-create-site-with-ecma-script-with/
    Geetanjali Arora | My blogs |

  • How to get page number from the PDF using Javascript

    Hi,
    We are having list of Single page PDF. The pdf are named in the order,
    ISBN_Author_01.PDF  (with real page number as i)
    ISBN_Author_02.PDF  (with real page number as ii)
    ISBN_Author_03.PDF  (with real page number as iii)
    ISBN_Author_04.PDF  (with real page number as 1)
    ISBN_Author_05.PDF  (with real page number as 2)
    ISBN_Author_06.PDF  (with real page number as 3)
    ISBN_Author_nn.PDF  (with real page number as 500)
    Here each pdf has a page number and in sequential order.
    The task is to check whether all the pdfs are in sequential order (i.e i, ii, iii, 1, 2, 3). If any page is missing, the script should throw an error report.
    To do this task, I am writing a Javascript to get the real page number from the PDF.
    Can anybody help me how to get the page number from the PDF using Javascript.
    Thanks,
    Gopal

    The "real" page number within a PDF is the count of the physical page starting at 0, zero.
    pageNum numPages
    The number printed on each page is the page label.
    setPageLabels  getPageLabel
    You will have to open each PDF and your script would need to know the page label for that file. I would expect you would need to build a 2 dimensional  array of the file names and the page label for the page within that array.

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • Problem with using javascript in interactive adobe form

    Hi All,
        I have a problem when accessing text field value which is present inside a subform using javascript.
    I tried giving data.page4.sub-5.<fieldname>.rawvalue but its not working. Please provide a solution.
    Thank you in Advance.

    Since this question is related to JavaScript running within the Form and not the connection between the form and Web Dynpro - it really belongs in the Interactive Forms by Adobe Forum.

  • Using Javascript and ScriptUI to create a form that brings in a symbol from library

    Hello everyone,
    I've been trying to pull together the right info to use javascript to create a form to bring in particularsymbols from the symbol library based on the variables taken from the form. I've taken bits and pieces from various sample scripts and tried to make this work, but my problem appears when I try to use conditionals.
    This is a limited version of what I want to do, but it is enough to get the point across.
    1. I want to select a script that has various dropdown boxes. I would like the first dropdown to give me 3 options: 10, 13, 18
    2. I would also like another drop down box that gives me three more options: single needle, double needle, and knife edge.
    3. I would then like it to have an "ok" button and "Cancel" button.
    4. From here when I click the ok button, a symbol is brought in from the library depending on what parameters were given to the form.
    ex. If I selected 10 in the first drop down and double needle in the second, I would like "SYMBOL A" to be pulled from the library and centered on the artboard.
    ex. If I selected 13 in the first drop down and double needle in the second, I would like "SYMBOL B" to be pulled from the library and centered on the artboard.
    I've gotten the UI to pop up and it works as planned as well as bringing in a symbol, my problem comes when I try to incorporate conditionals and functions.
    Here is my script. Please let me know what I'm doing wrong.
    var myDoc = app.activeDocument;
    var Pallette = new Window ("dialog", "Create a Shell");
    Pallette.add ("statictext", undefined, "Fill Opening in Inches:");
    Pallette.orientation = "row";
    var myDropdown =  Pallette.add ("dropdownlist", undefined, ["10", "13", "18"]);
    myDropdown.selection = 1;
    var myButtonGroup =  Pallette.add ("group");
    myButtonGroup.orientation = "column";
    var btnCreate = myButtonGroup.add ("button", undefined, "OK");
    MyFillSelection = myDropdown.selection
    btnCreate.onClick = function () {
        if ( MyFillSelection = "13") {
                   symbolRef = myDoc.symbols["SYMBOL A"];
            symbolItemRef1 = myDoc.symbolItems.add(symbolRef);
           redraw();
    var btnCancel = myButtonGroup.add ("button", undefined, "Cancel");
      Pallette.show ();
    If anyone has any input, it would be much appreciated.
    thanks,

    MyFillSelection = myDropdown.selection is outside the function, so it will always read "13", nothing is making the value change.
    move that line into your function and add the text property to it...MyFillSelection = myDropdown.selection.text;
    then do your if comparisons, that will do it.

  • How to pass a single quote in a URL using Javascript

    Can someone tell me how to pass a single quote in a URL using Javascript. I have created a Javascript funciton in which I pass several column values from an APEX report.
    The URL for the report link I am using is "JAVASCRIPT:passBack('#EMP_ID#','#Name#','#e-mail#')"
    The problem occurs with the Name and e-mail columns contain a single quote (i.e. James O'Brien)

    Thank you Saad, that worked.
    Since I built the report using type 'SQL Query (PL/SQL function fody returning SQL query)' I had to add some additional quotes to get it to work.
    i.e.
    replace(EMP_EMAIL_NAME,'''''''',''\'''''')
    or
    replace(EMP_EMAIL_NAME,chr(39),''\'''''')
    Thanks for the help,
    Jason

  • Child Report Window Size XI 3.0 SP2 Using Javascript

    Hi All,
    I have to admit this is not my area  . I'm trying to get a new webi report in a sizeable window using javascript. I want to achieve this by selecting an open doc link from an existing webi report.
    We have been trying with the code below but get the 404 Missing Page error.
    We have been trying to get this to work on Edge. Do I need to install any SDK on to the system to get this to work?  Can anyone let me know the steps, please.
    Thanks...
    Mark
    Code:
    "<a href=__\"javascript:window.open('../../opendoc/openDocument.jsp?iDocID=Aa252KU2ReBDm4TkGkVTOLM&sIDType=CUID&sType=wid&sReportPart=UIREF%3ARID%3D1005%3ABID%3D1008&mode=Part&sRefresh=N&sWindow=New','SAMPLE ','width=350,height=250') \" title=\"\" target=\"_self\" nav=\"doc\">"[Actual].[Kpi Group]"</a>"

    Thanks for the response Guys.
    I have done a bit more digging and I think that you can only create a link referencing Java script in a  crystal report, not Webi?
    One way I thought of getting round this is to create a copy of opendocument.jp and add my Java script, in there, to resize my child window.
    Any comments or experiences to share?
    All the Best,
    Mark.

  • How to pass value to pop up window using javascript function?

    I am not sure how to do this, I want to open new window from existing form,This is Mod/PLsql for consists some javascript functions also. When I am clicking on new window in form then new form should open with results of value entered,but new window form is opening with main page :( , not able to get text box value from parent form. How to call textbox input value in popup window from parent window using javascript?
    currently I'm using following code:
    HTP.p('<script type="text/javascript">
    function pop_up5()
    var l_url=window.opener.document.getElementById("p_single_store_pc").value;
    window.open(l_url, '''', ''fullscreen=no, scrollbars=1'');
    </script>' );
    Edited by: user11970612 on Jun 14, 2012 5:02 AM

    this is probably due to the Javascript code and not a "real link" to another page... I don't know if the null is due to the Javascript...
    But if you really really want to use javascript instead of a ... you can pass the location of the url with JSP (on your main page) as a parameter to the open window... (...) u can put instead of main.jsp <%= request.getServerName()+request.getRequestURI() %>
    the value <%= ... %> will return something like test.com/html/main.jsp
    Hope this helps.

Maybe you are looking for