Math.power Java script in Captivate 7 function
I am trying to perform a complex calculation in a 7 Captivate tip action. I can get up now by using the user input and a series of expressions but stop trying to raise a number to a power, so I will try to use the function math.power Java [Math.pow(x,y)]; The problem is that the base number (x) is a variable of captivate (PR) calculated by the previous expression, the exponent (y) is a literal value (0,2857). The result will then return to the advanced Captivate in action for a final calculation, what I can do in a regular expression before being posted. Advice or guidance would be much appreciated. Please keep in mind, I'm an absolute novice with javascript. Thanks in advance.
When you try to get or set of Captivate variables in combination with advanced Actions and JavaScript, you can run into problems of synchronization. It is better to do everything in one or the other... or at least start in advanced actions and complete the action advanced with a final stage "execute JavaScript. So I'll take the last expression in your advanced actrion and which combine in one final step of "Execute JavaScript":
/* Get a reference to the Captivate DOM element */ var objCp = document.Captivate; /* Get the PR Captivate Variable as a Number*/ var pr = Number(objCp.cpEIGetValue('m_VarHandle.PR')); /* Do exponent calc */ var pk = Math.pow(pr, 0.2857); /* Get the Init_Temp_K Captivate Variable */ var initTempK = Number(objCp.cpEIGetValue('m_VarHandle.Init_Temp_K')); /* Calculate the final temp */ var finalTemp = pk * initTempK; /* Set the Final_Temp_K Captivate Variable so the answer is visible inside of Cp */ objCp.cpEISetValue('m_VarHandle.Final_Temp_K', finalTemp);
I commented JavaScript code so hopefully he reads logically.
Tags: Adobe Captivate
Similar Questions
-
Using a comfirmation of java script in the recording function delete?
Hello;
I'm writing a confirmation in Java script to delete a record. I don't want to delete all of the information table, just for the record, the button Delete is attached using the identifier. Here is my script, then the code on the page:
< script language = "JavaScript" >
function confirmDelete (id) {}
If (confirm ('are you sure you want to delete this record?'))
{
document. HREF.action = "ProjectCat - Action.cfm?" ID = "+ id;"
document. HREF.submit ();
}
Returns false;
}
< /script >
This is the query that I'm trying to use it:
"< name cfquery ="catMan"datasource =" "#sitedatasource #" username = "#siteUserID #" password = "#sitePassword #" >
SELECT Categories.Name AS ViewField1, HAVE categories. CategoryID ID
Categories
< / cfquery >
< head >
< / head >
< body >
< cfloop query = "catMan" StartRowOptional = "" #URL.startRow # "EndRowOptional =" #endRow #">"
< cfoutput >
#ViewField1 #.
< do action = "ProjectCat - Action.cfm" method = "post" >
< input type = "hidden" name = "ID" value = "#ID #" >
< input type = "submit" name = "proj_Delete" onClick = "return confirmDelete('#ViewField1#')" value = "Remove" > < / make >
< / cfoutput >
< / cfloop >
< / body >
#Note: there is the code here in my query to loop to the next and previous buttons, I just don't have this zip code as it relates to this question.
Is there also a way to make the State of Java script in the place where it says, "Are you sure you want to remove this record" to say "Are you sure you want to delete #ViewField1 #? (the name of the deleted record)?
Thank you!
Phoenixjust spent 2 arguments to your function js - id AND category name:
and function:
function confirmDelete (id, name) {}
If (confirm ('Are you sure you want to delete' + name + 'category?'))
{
document. HREF.action = "ProjectCat - Action.cfm?" ID = "+ id;"
document. HREF.submit ();
}
Returns false;
}but the creation of a separate form for each category displayed on the page is
very inefficient - you must revise your code... you have not yet
train, really... just use to call your js function, or a
(without any -
TypeError: this.oRoot.enable is not a function
This is popping up when I befor I open my browser,in a pop up box under the heading JAVA SCRIPT EXE. What is it, how do I get rid of it?
For me, this happened from disabling, but do not uninstall McAfee site Advisor. Recommend site completely uninstalled and the problem disappeared completely. I had turned off before site Advisor, but it seems after a update to McAfee, he was back and then turn it off again caused this problem.
Go to "uninstall a program" or "add/remove programs" in control panel. Find McAfee in your list (McAfee total protection for me). Click it and then click "Uninstall/Change" (right there in XP, up above in Vista or 7). I don't remember exactly what you see after that, but at one screen I was given the choice to uninstall the McAfee total protection and/or the Site Adviser. You can just check the Site Adviser and just uninstall the Site Adviser while retaining the rest of the McAfee protection.
Good luck!
-
How to take a SQL query result in the source section of an APEX "agenda of the page" field and allow this request to be formatted using XML in an HTML format for a Java Script file to perform a function on the result?
Currently I have the following text:
To query the DB table and format the result as HTML:
SELECT XMLELEMENT ("UL id ="ticker01"', XMLAGG (XMLFOREST (Scroll_Mess AS LI))") "item UL' OF Web_Ticker where Mess_Id < 10 order by Mess_Id;
That displays the following:
< UL id = "ticker01" > < LI > HELLO < /LI > < LI > HELLO < /LI > < /UL id = "ticker01" >
I need the output of this to be visible to a JScript function that is currently called the "head of page", but there doesn't seem to be its scope? The function works correctly if there is a list in the page field items 'Text element Pre' but does not work correctly when used in conjunction with the query to generate a table form.
If everyone is happy to help I would be grateful .
James.
Solved!
In order for the request to be part of the DOM of the page of the APEX, the Java Script allows to perform its function on the result marked "HTML" to query, you must set page of the apex on which the query resides and then add the inner text of this page to a second variable for which the function of web ticker can run on as follows:
$(function() {})
var x = $("#P9_TICKER_DATA");
var y = x [0] .innerText;
x.Append (y);
$("UL#ticker01").liScroll ();
});
From there, on the Java script is able to properly see the result of the query in HTML format.
-
Hello
I built a site of Muse and place a dashboard project animate the site. Here's the problem I have. When I saw in the browser through Muse all seem to work well. The problem is when I export to HTML. When I view the HTML file in Firefox, everything works fine. But when I discover the HTML in Chrome or Opera, I get the following error appears on the top of the browser: Java Script Alert: MuseJSAssert: error calling the function switch: security error: blocked a frame with original "null" access to a framework of cross-origin.
Any ideas what is the cause? I noticed one thing, but if I click the button refresn the animation playback. The other thing I noticed, is that my full screen lide show is also affected by this error. He plays as the first image and the rest of the images are not displayed.
Thank you for any suggestions to fix this.
Hey all!
I finally found how to solve this problem! At only took about 3 hours!
Therefore, to do with the iframe code muse did for the lively edge file.
If we take things from the outset, if everyone includes:
1 publish a 'edge Animate Deployment Package (.oam)' dashboard animate
2. in muse, file > Place > {exported .oem)
3. put the file where you want
4 muse export as HTML (file > export as HTML)
5. your browser will open and display the error message, as shown above
6 locate the HTML files and find "index.hml", or the page that your file hosted dashboard is on
7. open it in Notepad, or editing program code. I use Adobe Edge Code CC
8 remove the text: class = "animationContainer an_invi" (press ctrl + f and type to find the line)
9 be sure to save and then reopen the Web page!
10 smile for yourself and be raised
-
Create the Java script function
Hello
I try to create the following java script function to retrieve a character string:
String.prototype.left = function (findWhat)
{
try
{
var = this.search (findWhat) position;
If (position > - 1).
Return this.substr (0, position);
}
catch (e)
{
/ / alert (e.message);
}
return "";
};
var text = "myText-description";
var separator = "-";
In this example, I try to extract the word on the left before the "-" delimiter (mtText)
But I get the following error message: failed to add a property to an object sealed: left
My question is how can I create a simple js function in the Orchestrator in the following example
Thank you
Hello
You can try the code to retrieve a string from left to right below the delimiter.
searchstr(); function searchstr() { try{ var str = "angela.soni" var pos = str.indexOf("."); // Currently this is hard coded, you can pass delimiter as an input parameter. if(pos>-1) { var substr = str.substring( 0, pos ); System.log(substr); } else { System.error("Delimiter not found"); } } catch (e) { System.error("Search failed: " + e); } }
I hope this would help you.
Thank you!
Angela
-
Call a java script function, the loading of the page while in ebiz
Hi gurus of the OFA.
I have a requirement for a java script to each page renders OFA function call or charges.
That is when any OAF page load or make in Oracle e - biz, I have a java script function that should be called is possible to implement the above mentioned requirements.
Thanks in advance...
SouravOK, I have your condition. It's one of the basis OFA classes then you can try class decompile OAPageBean. I tried yesterday, there are many interesting ways you can add JavaScript and recompile class. do the backup of old, of course. And your JavaScript will work on any page of the OFA
-
java script two function in the Form HTML element attributes
Hello
How can I call two java script function (onBlur = "javascript:sumItems()"and onkeyup = "CopyFromTo (this, 'P600_AMOUNT_PAID')"); on HTML attributes of elements shaped the source in a single element.
Thank you
Maury
Published by: Ed on September 25, 2009 22:47In "Header HTML" of your page.
Saad,
-
enable/disable Java script power without clicking through menus?
tried with active Word, but did not lack ability to jump (scripted) content in the Options menu... Do manually what the script is supposed to do works very well, but runs the script leaves unchanged Java script option
Hi carsten, you could try an addon as follows: https://addons.mozilla.org/firefox/addon/quickjava/
-
Java Script: How to select all corner points?
Java Script: How to select all corner points in the open document?
This may be what you're after.
Do not expect, this works on the complex paths.* *.
very tight tolerance defined, this can be changed so smooth should not be too smooth.
//------------------------------------------------------------------------------------ // Select "Sharp" or "Smooth" pathPoints //------------------------------------------------------------------------------------ // // Qwertyfly // 06/07/2015 // Version 1.0 // //------------------------------------------------------------------------------------ // // *****Do Not expect this to work on complex paths.***** // //------------------------------------------------------------------------------------ // // Set tolerance here (this is in Radians) var tolerance = 0.0000000001; // //------------------------------------------------------------------------------------ var doc = app.activeDocument; var myPoint, angle1, angle2, sel = ""; var w = new Window('dialog'); var B1 = w.add('button',undefined,"Select Corner Anchors"); var B2 = w.add('button',undefined,"Select Smooth Anchors"); var B3 = w.add('button',undefined,"Cancel"); B1.onClick = function(){sel = "sharp"; goTime();} B2.onClick = function(){sel = "smooth"; goTime();} B3.onClick = function(){w.close()} w.show() function goTime(){ w.close(); doc.selection = null; for(var i = 0; i < doc.pathItems.length; i++){ for(var j = 0; j < doc.pathItems[i].pathPoints.length; j++){ myPoint = doc.pathItems[i].pathPoints[j]; if(sel == "smooth"){ if(isSmooth()){ myPoint.selected = PathPointSelection.ANCHORPOINT; } }else if(sel == "sharp"){ if(!isSmooth()){ myPoint.selected = PathPointSelection.ANCHORPOINT; } }else{alert("error");} } } } function isSmooth(){ angle1 = Math.atan2(myPoint.leftDirection[1] - myPoint.anchor[1],myPoint.leftDirection[0] - myPoint.anchor[0]); angle2 = Math.atan2(myPoint.rightDirection[1] - myPoint.anchor[1],myPoint.rightDirection[0] - myPoint.anchor[0]); return(Math.abs((angle1 - angle2)) > Math.PI - tolerance && Math.abs((angle1 - angle2)) < Math.PI + tolerance); }
-
AS3, convert java script
Hello
I want to convert as3 code Flash, java script to use the html5 canvas.
Any help please?
It is an as3 code:
var randNum:Number = Math.floor (Math.random () * 149) + 1;
var fixedFrame:Number = randNum + 1;
gotoAndStop (fixedFrame);
I try cela, but does not:
Function myFunction() {}
var randNum = Math.floor (Math.random () * 150) + 1;
var fixedFrame = randNum + 1;
_this.gotoAndPlay (fixedFrame);
}
Impossible to put this in the first image and expect it to work. managers further down the timeline probably did not load, yet.
Use the preload class to check.
-
Add xml by Apple/Java script tags
Hello
All, I'm new to Indesign Scripting, and I hope someone can help me with the following (add xml) problem.
Can someone write / suggest me how can I add xml tags. By Apple/Java Script
My Probleam = >
[& x + 2 y + 3 &]
Solution = > (but its manual)
are inlineequation > < inlinemediaobject > < role of the textobject 'xpressmath' = > [& x + 2 y + 3 &] < / textobject > < / inlinemediaobject > < / inlineequation >
I want to add on my powermath equaiton xml tags. His ETMV2 of xml tags.
Any idea is appreciated!
Thank you very much
snegig
Sorry for the delay.
Is it a script when I select my math equation given power and then automatically add xml tags
Oh, you just want to work on the selection?
It's pretty easy then:
var d=app.activeDocument, root=d.xmlElements[0], ie = root.xmlElements.add("inlineequation", app.selection[0]), im = root.xmlElements.add("inlinemediaobject", ie.texts[0]), to = root.xmlElements.add("textobject", im.texts[0]); to.xmlAttributes.add("role", "xpressmath");
I feel that it's a bit kludgey and that there is a better way to add objects and maintain the hierarchy, but it was the quickest way that I could make it work.
-
can I use waiting fuction in java script with qml
HII guyzz... How to use the wait in java script with QML function as if it takes 20 minutes to perform a specific operation or a process after that battery is 100%
You are better off using QTimer for something like that.
-
Using java script with QML, save a text in a variable of java script and showing in a label
I'm trying to find a way to take a text entered by the user into a text field and display it in a label using java script. The trickiest part is I want to be seen in the label after restarting the application.
Any idea?
Should I use a JS file with functions. If so, what are best practices?Thanks in advance!
This example uses a little bit of C++, I'm not sure if this can be done with purely JS
in your text box or label apply onTextChanged you probably want to have a Setup button to activate & deactivate the area of text, or if they delete it, the text of the label would be erased
. QML
TextArea { id: myTextArea onTextChanged: { myTextArea.text = myLabel.text; //you could also apply ^ to a button's onClicked function etc App.saveValueFor("mySavedText" myTextArea.text); } } Label { id: myLabel text: App.getValueFor("mySavedText", ""); }
App.saveValueFor (); QSettings uses will have to be reset in your ApplicationUI.cpp & .h
.cpp
App is obtained by setting a context property
qml->setContextProperty("App", this);
QString App::getValueFor(const QString &objectName, const QString &defaultValue) { QSettings settings; // If no value has been saved, return the default value. if (settings.value(objectName).isNull()) { return defaultValue; } // Otherwise, return the value stored in the settings object. return settings.value(objectName).toString(); } void App::saveValueFor(const QString &objectName, const QString &inputValue) { // A new value is saved to the application settings object. QSettings settings; settings.setValue(objectName, QVariant(inputValue)); }
all
public: Q_INVOKABLE QString getValueFor(const QString &objectName, const QString &defaultValue); Q_INVOKABLE void saveValueFor(const QString &objectName, const QString &inputValue);
You'll also need to slect the permission of files shared in the descriptor for QSettings bar to work
-
my Java Script and html do not work correctly in any other browser other than Internet Explorer
original title: my html and Java Script do not work correctly in another browser other than Internet Explorer, which is not the only browser used with Windows. How can I fix it?600 4 6 0 x 80000000000000 15 Windows PowerShell WIN-GRBD073PMKI FunctionHas begunProviderName = Function NewProviderState = SequenceNumber started = 5 HostName = ConsoleHost HostVersion = 2.0 HostId = 9 a 968549-639 a-4de1-9012-5b443edaae11 EngineVersion = RunspaceId = PipelineId = CommandName = CommandType = ScriptName = CommandPath = command line =.Hello
The question you posted would be better suited in the MSDN Forums. I would recommend posting your query in the MSDN Forums.
http://social.msdn.Microsoft.com/forums/en-us/iewebdevelopment/threads
I hope that helps!
Maybe you are looking for
-
How can I disable a backup in use?
When I go to turn off a backup on my phone to save space, it says "cannot delete this backup because it is in use."
-
ThinkVantage System Update 5.06 will not install in silent mode
The command-line systemupdate506-04-24 - 2014.exe - s - one /s /v "/qn" found at http://support.lenovo.com/en_CA/downloads/detail.page?&LegacyDocID=MIGR-73695 does not fuction more. It worked well on the latest version, but it seems that ThinkVantage
-
Graphics card for HP M9351.uk &; Upgrade Ram
Hello I got my PC for 5 years, and even if it's still pretty much struggling, according to me, it's time for a couple of updates. I want to check before you buy anything that everything will work properly. My PC still running the stock Windows Vista
-
Unable to reach Rise of Nations: Gold Edition Gamespy internet of matching games.
Dear Microsoft Answers, I seem unable to reach (and people seem unable to join games I host.) all RON: GE of the internet multiplayer games despite using the solutions found in several previous posts, which one to disable my firewall/antivirus, a sta
-
Error Installation of Intel high definition (HD) Graphics Driver.
(Turkish) Merhaba Intel high definition (HD) Graphics Driver SoftPaq number: Surum SP61152: 8.15.10.2559 BU surucuyu bilgisayarıma ve surum Manual HP Support Assistant Island yuklememe rağmen kurulum aşamasında hata veriyor surekli veya. Uyumlu olmad