Calling Flex function from javascripty for window.close
Using a set up in my ActionScript of:
ExternalInterface.addCallback("tagWithClosed",windowClosed);
How can I write a JavaScript function that calls
'tagWithClosed' to Flex when the user closes the window
(window.close() )?
Tried something like this:
<SCRIPT LANGUAGE="JavaScript">
window.onbeforeunload = closingWindow;
function closingWindow()
FXVideo.tagWithClosed();
</SCRIPT>
Didn't work though.
My swf is called FXVideo.swf. Is calling the
FXVideo,tagWithClosed correct or should be something else?
Similar Messages
-
Calling flex functions from flash swf (AS3)
Hi all, i'm stuck with communication between loaded AS3 SWF
from Flash and Flex3 project. I use SWFLoader for runtime loading
SWF, call functions inside SWF, but cannot find the way to call
functions declared in Flex project. I try to use ExternalInterface
class, but it does not help me, or maybe i use it incorrect. Is
there a method to call Flex user declared functions from Flash SWF?
All i need is a syntax sample, thank you in advance!Also, application.application will point to the top-level app
scope, even from a loaded swf.
I believe parentApplication will resolve to what you usually
want as well.
For looser coupling, consider using a bubbling event.
Tracy -
Calling Flex function from loaded SWF
Hello,
I need to load an external SWF file, wity ability to call functions from the base FLEX code script .
Is that possible ? noting that the loaded SWF can be either in AS2 or AS3
Thanks in advance ..There are some third party ways of talking to an as2 swf. Google
as2interface (or maybe as3interface) -
Getting Error while calling Flex function from JavaScript
Hi,
I have an aspx page, which shows charts as per dropdown selection,
I am using flex charts for flex.In aspx page, i am calling an mxml function using javascript.below is the code for javascript in aspx.
Javascript code in aspx page:
<script type="text/javascript">
function callApp(formid) {
try {
var objectChart = document.getElementById("statisticsChart");
alert(objectChart.id);
objectChart.myFlexFunction(formid,get('<%=HiddenDashboardWS.ClientID %>').value);
catch (e) {
alert(e.message);
function getDropDownListvalue() {
var IndexValue = $get('<%=FormDropDownList.ClientID %>').selectedIndex;
var SelectedVal = $get('<%=FormDropDownList.ClientID %>').options[IndexValue].value;
// alert(SelectedVal);
callApp(SelectedVal);
</script>
Html code where dropdown control is placed
<asp:DropDownList CssClass="combo" ID="FormDropDownList" runat="server" AutoPostBack="false"></asp:DropDownList>
<object id="statisticsChart" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0"
height="220" width="680">
<param name="src" value="../swf/DashboardStatisticChart.swf" />
<param name="flashVars" value="" />
<embed name="statisticsChart" src="../swf/DashboardStatisticChart.swf" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" height="220" width="680" flashvars=""></embed>
</object>
Mxml code:
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="white" creationComplete="initApp();" >
<mx:script>
public function initApp():void {
ExternalInterface.addCallback("myFlexFunction",myFunc);
public function myFunc(s:String,wsurl:String):void {
Formid.text = s;
webService.wsdl = wsurl;
Alert.show("webservice");
//Getdata calls webservice and gets xml data
GetData();
//showchart() will draw chart
ShowChart();
</mx:script>
</mx:Application>
Above code works perfect in ie, but in firefox, it gives An error saying “chartObject.MyFlexFunction is not a function”.
I am getting the object in javascript in all the browsers, but not the functions!
Does anyone has worked with this?
Any help will be highly appreciated.
Regards,
Nirav PatelFound the solution from here... http://74.125.153.132/search?q=cache:4BC9BY04B5EJ:livedocs.adobe.com/flash/8/main/00002201 .html+externalinterface.addcallback+not+working&cd=1&hl=en&ct=clnk&gl=in
Hope it will help others...
Regards, -
Calling a Function in the Parent Window from the Child Window
QUESTION: How do I call a function resident in the parent
window from a child window?
BACKGROUND
I have a JavaScript function resident in the parent window
that reformats information obtained from the Date object and writes
the result to the parent window using the document.write( ) method.
I would like to call this function from the child window and have
it write to the child window instead. Is this possible? If not,
must I rewrite the entire function and nest it in the below code?
If so, what is the proper form of nesting?
CODE: The code that creates and fills the child window is
provided below. The highlighted area indicates where I would like
to enter the information from the function resident in the parent
window. I have tried every imaginable permutation of code that I
can imagine and nearly destroyed my parent document in the process.
I am very happy that I had a back-up copy!
function openCitationWindow() {
ciDow = window.open("", "", "width=450, height=175, top=300,
left=300");
ciDow.document.write("A proper way to cite a passage of text
on this page:<br /><br />Stegemann, R. A. 2000.
<cite>Imagine: Bridging a Historical Gap</cite>. " +
document.title + ". [<a href='" + location.href + "'
target='_blank'>online book</a>] <" + location.href
+ "> (");
MISSING CODE;
ciDow.document.write(").<br /><br /><input
type='button' value='Close Window' onclick='window.close()'>");
ciDow.focus();Never mind - I was doing something very stupid and wasn't
calling the function as a method of a movie clip. I was simply
calling checkTarget(event) rather than
event.currentTarget.checkTarget(event); which seems to work. -
Trying to call a function from a variable in Flex 4.0 ActionScript and need some suggestions
I am attempting to build a site map in Flex. I have my links (or will have) in a database, along with a "link." On click from a datagrid, I have an event handler where I can get the link. However, everything I have tried to use won't call the function. Ideally, I would like to call a function from from my topLevel application, and I can do that using the mx.core.FlexGlobals.topLevelApplication call. Can anyone point a fairly new Flex coder in the right direction? Thank you.
Here is the function on the group component (simplified): -- I got this from one of my google searches. The other was using the SWFLoader, but since this is in the same application, I didn't think it was as relevant. Plus, the SWFLoader used some references that I couldn't resolve.
private function site_click(event:ListEvent):void {
var sURL:String=list.dataProvider[event.rowIndex].link;
var sCommand:String="mx.core.FlexGlobals.topLevelApplication." + sURL;
this.[sCommand]();
This yields the error message ReferenceError: Error #1059: Property mx.core.FlexGlobals.topLevelApplication.myths_click() not found on sitemap and there is no default value.
Whereas this works fine:
mx.core.FlexGlobals.topLevelApplication.myths_click();
sitemap is my component name. -
Calling a function in the HTML window the course sits inside - Captivate 8
Hi,
I've scoured the forums for an answer to this but as yet have come up blank.
Our LMS launches a course in a popup window and inside of this the .htm Captivate output file sits.
Currently this pop up window has a button in it which executes a function. The problem is this button is rather unsightly sitting above the course in the HTML window and I'd like to be able to call this function from inside the Captivate course itself.
The function is called closeSCOContent() and it closes the course window but crucially forwards the user to a feedback page.
So essentially is it possible to call this function using the Javascript function in Captivate 8?
I hope I've explained that sufficiently
Many thanks!Hi,
This gave me the nudge in the right direction I needed, after a bit of basic frameset research I've got the desired functionality.
Huge thanks! -
Calling user function from Interface mapping
I am getting error "Bad query:ORA-00904: invalid identifier" while calling function in the mapping of an interface.
Can some one provide the syntax of calling user function from interface mapping.
Thanks,
RPuser452108 wrote:
Can some one provide the syntax of calling user function from interface mapping.Oracle's Call Iinterface, the OCI, does not work differently when coding using a Dvorak keyboard, or writing code using a pretty pink font in the editor.. or coding the call from an interface mapping (whatever the hell that that is).
You have 2 types of calls. SQL and PL/SQL.
To call a function via SQL, it can be done using a the standard cursor interface. E.g.
select MyFunkyFunction from dualIt will return the function value via a single row with a single column. The standard cursor fetch and close cursor calls are used.
To call it via PL/SQL, an anonymous PL/SQL block is needed, and the caller needs to use a bind variable to receive the value from the function. The anon block will look as follows:
begin
:bindVar := MyFunkyFunction;
end;Refer to your client's abstract layer for interfacing with the Oracle Call Interface, on how to deal with bind variables. -
Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?
My vendor has sent me a .sys file with functions accessing their hardware. Can i call these function from labview directly or do I have to wrapper the .sys with a dll?
Well a sys file is a kernel device driver. LabVIEW does not have any direct way of accessing such a driver. The way kernel drivers are accessed is usually through a DLL which makes calls to WinAPI functions such as CreateFile(), ReadFile(), WriteFile(), CloseHandle() and DeviceIORequest(). Since these WinAPI calls are basically just DLL calls too, you could theoretically use the Call Library Node to call them and access the kernel device driver in such a way.
However for any kernel device driver with more than one or two device driver calls, it will certainly be easier in terms of development, debugging and maintenance of the code, to write actually a dedicated DLL in C/C++ for this device driver and access that DLL from LabVIEW, especially if you consider the LabVIEW datatype limitations when designing the DLL interface (Basically this same DLL can then be called from any other Windows development environment, be it Visual Basic (similar datatype limitation as LabVIEW), Delphi, (Visual) C, LabVIEW or also various scripting environments like Python and Lua.
Some of the necessary WindAPI calls are rather involved and pose quite a bit of trouble to get the parameter data right in LabVIEw.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
How do I call a function from an Itemrenderer?
Hi, Im new in flex and I wonder if I can call a function from within an AdvancedDataGridRendererProvider
for example:
<mx:AdvancedDataGrid>
<mx:columns>
<mx:AdvancedDataGridColumn dataField="id" />
</mx:columns>
<mx:rendererProviders>
<mx:AdvancedDataGridRendererProvider
dataField="detail"
renderer="components.myRendererProvider"
columnIndex="2"
depth="2"
/>
</mx:rendererProviders>
</mx:AdvancedDataGrid>
<mx:Script>
<![CDATA[
public function outerFunction(){
]]>
</mx:Script>
myRendererProvider
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" paddingLeft="10" paddingRight="2" horizontalGap="2" paddingTop="0">
<mx:Script>
<![CDATA[
public function callOuterFunction( ){
how do I call the outerFunction() from here?
]]>
</mx:Script>
<mx:LinkButton fontSize="13" fontWeight="bold" click="callOuterFunction( )" label="label" />
</mx:HBox>
thank you in advance.There are two ways to call a function from within an ItemRenderer. One way is to dispatch an event from your ItemRenderer and listen for the event in your main application. This approach has the advantage of creating loosely coupled code which is eaiser to maintain and extend if needed, but it takes a bit more work to set things up than using the second aproach lised below. You could also create a custom event to have greater control over what data is sent with the event.
private function callOuter():void {
this.dispatchEvent(new MouseEvent());
The other approach is to call the main application by using parentDocument.
private function callOuter():void {
parentDocument.handleItemRenderer();
Chris -
Hi, I am working on Labview 8.0.
I am trying to communicate to a thrid party HW using the driver file he has provided to me.
The drive file is a *.lib file.
I am unable to call the function from the lib file.
I could get only from a DLL.
Pls help .
Regards
-Patilpatil wrote:
When it is possible in Lab Windows, why calling a function from a static library is prohibited?
I was trying to use Function node, but found that it is only for functions from a DLL file.
Will CIN be useful.?
LabWindows is not the same as LabVIEW. LabVIEW cannot call .lib files. LIB files are intermediary products and you need to use a wrapper DLL that's compatible with the object format of the .lib file. It's as simple as that. LabWindows creates C application and from that perspective is no different than a regular C
compiler. That's why you can call .lib files because that's how .lib
files are used.
A CIN, as pointed out, is something completely different and will not help you. -
How to call a function from asp
Hi!, I'd like to know how to call a function from an asp page. I've written:
set rs = server.createobject("Adodb.recordset")
rs.open "call dbo.sf_Obt_Des_Producto ('0000161')",Conn
if err.description <> "" then
response.write ("No se pudo! :(")
else
response.write ("rs: " & rs(0))
end if
rs.close
set rs = nothing
but there is an error:
ORA-06576: not a valid function or procedure name
Please is very urgent!!!
Thanks.
Angie.You need to use the syntax "{call <procedure_name>}".
The {call } syntax tells the OLE DB provider that it needs to translate the call into whatever the database's procedure calling syntax is. This means that even though different databases have different syntax for calling stored procedures, your OLE DB code can be run against any of them without changing.
Justin -
Is their a possibility to call SDK functions from TestStand directly?
Hello!
I want to call a function from the Windows SDK.
Is this possible?
Regards,
Brosig
Using TestStand 3.5 and Windows XPBrosig,
sadly i dont know what the error with the pdb-file could be. but as far
as i see from the description to the function found here, there should
be no such dependency.
please take a look into the "requirements"-section of the link. it
seems that kernel32.dll is sufficient for usage of the function. and
for myself, i never had such problems when using the kernel32.dll.....
one problem could be the type of the parameter you are using. i know
that there are sometimes odd issues on SDK when the parameters do not
fit exactly the needed type. so make sure that all strings are
null-terminated and the buffers you pass are preallocated!
Norbert B.
Edit: forgot the link.....
Message Edited by Norbert B on 12-22-2005 09:31 AM
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it. -
How call Flash function from C++?
Communication between C++ and ActiveX Flash object is
adjusted. The ActiveX calls C++ functions. But how a call Flash
functions from C++?
I try so: v_flash is control variable of the ActiveX the
container.
A code: v_flash. CallFunction ("test");
No effect
How it to make?Hi David, Thanks for the response. I found this solution by
following method:
Flash code either in class or frame:
ExternalInterface.addCallback("sendTextToFlash",
getTextFromJavaScript);
public function getTextFromJavaScript(user):void {
trace(user);
//Now whenever JavaScript function will be called from any
HTML or back end language then it definetly call directly that
flash function by following method
//HTML Code
function sendData(user){
//alert("values coming "+user);
SendDataToFlashMovie(user);
function getFlashMovieObject(movieName){
if (window.document[movieName]){
return window.document[movieName];
if (navigator.appName.indexOf("Microsoft Internet")==-1){
if (document.embeds && document.embeds[movieName])
return document.embeds[movieName];
else {// if (navigator.appName.indexOf("Microsoft
Internet")!=-1) {
return document.getElementById(movieName);
function SendDataToFlashMovie(user) {
var flashMovie=getFlashMovieObject("myFLA");
flashMovie.sendTextToFlash(user);
Now HTML or back end language has just need to call
sendData(
value)
I think its the right way, but if there is any other short
method like just call the function name from HTML and that directly
respond to Flash as per function name, then please let me
know. -
Calling a function from a DLL, exectution in background mode.
Dear Experts,
We have created an ABAP report the calls a function from a DLL file. If the report is executed in on-line mode the program calls and executes the function from the DLL, but if the ABAP programa is executed in background mode it doesnt calls the DLL function.
Do you know a way to solve the problem when executing in background mode?
Best regards.
AntonioHi Gabriel,
Let me explain in details about my DLL function.
We are importing the business partners from legacy system into the SAP CRM system, so at the moment we created the BP master data via BAPI, I get the name of the BP and this moment I call the function in the DLL file. I export the parameter name and I receive back a simplified string with the name reduced to a code. This code I get back from the dll it is insert in a Z table, so there is no interaction in the screen, all must be executed in background mode, because there are a lot of business partners to be converted in SAP system.
I am sending my code for your considerations.
Instancia a DLL
CREATE OBJECT dll 'MTCODE.CPFONET'.
IF sy-subrc NE 0.
RAISE without_dll.
ENDIF.
Move para a tabela interna IT_NAME os valores recebidos na TI_NAME
it_name[] = ti_name[].
Para cada registro importado
LOOP AT it_name.
CLEAR v_string_ret.
wa_matchcode-zregid = it_name-zregid.
wa_matchcode-name1_text = it_name-name1_text.
v_string = it_name-name1_text.
CONDENSE v_string.
TRANSLATE v_string TO UPPER CASE.
CALL METHOD OF dll 'SetNome' EXPORTING #1 = v_string.
CALL METHOD OF dll 'ExecMatch'.
CALL METHOD OF DLL 'GetMCData' = v_string_ret.
FREE OBJECT dll.
Preenche os campos do match-code de acordo com o retorno da DLL
SPLIT v_string_ret
AT '|'
INTO wa_matchcode-zparmcln
wa_matchcode-zparmcfn
v_empty
wa_matchcode-name_first
wa_matchcode-name_last
wa_matchcode-namemiddle.
Adiciona o registro com o match-code correspondente na TE_MATCHCODE
APPEND wa_matchcode TO te_matchcode.
ENDLOOP.
Maybe you are looking for
-
How to find the back ground job details
Hi All, I have a back ground job running from many days, now we would like to know when this job was created on what date this job actvlly created and schuduled. Please informe me how to check this. Thanks & Regards, Muralikrishna
-
[solved] dvd drive no longer recognized
my dvd drive used to work. i was able to burn a cd just a couple weeks ago, not sure when exactly, but definitely no more than 3 weeks ago. today i pushed the eject button (just a keybinding mapped to `eject -T`) and i received an error saying eject:
-
Can't find admin files on former startup disk - now 2nd drive on MacPro
Help, My G5 tower died and I bought a MacPro tower. I put the drive from the G5 in the MacPro as a second drive and it runs fine but I can't find any files I created under the root user. I used Root for about six months while my system was dying a sl
-
How to extract DB FILE FROM NONSAP SYSTEM IN BI-7
how to extract DB FILE FROM NONSAP SYSTEM IN BI-7
-
Hi, I currently using v2.25 mac bookflip. The problem I am facing is that the onMouseDown and onMouseUp works well in swf. However, when the I upload to the web server and localhost. The chances for them to work are 50-50. The truth is I was unable t