Flex Javascript interaction

In my application, the Flex Javascript interaction works
correctly only when I have a "alert" pop-up!!! I do not want the
"alert" in my final application.
Here is my code snippet:
Javascript code:
<script language = "JavaScript" type="text/JavaScript"
charset="ISO_8859-1">
var jsReady = false;
function isReady()
return jsReady; //to set up communication with Flex
function pageInit()
// Record that JavaScript is ready to go.
jsReady = true;
var newTerm="Flex"; //This is the input variable, right now
its hard-coded
alert(newTerm);//this alert causes trhe problem, I get to see
the desired output with alert, but without alert, I get "Error on
Page"
getMyApp("test").myFlexFunction(newTerm);//call to Flex
function
function getMyApp(appName) //Function to find the type of our
browser
if (navigator.appName.indexOf ("Microsoft") !=-1)
return window[appName];
} else {
return document[appName];
</script>
pageInit() is called onLoad in body tag==> possible cause
of problem

Hey Tracy! Thanks for replying!
Here is the ExternalInterface code. I am working on Yahoo
API. So you will find some API calls there.
=========================
[Bindable]
public var question:Question;
public function myFunc(s:String):void
var keyword:String;
params.results = 50;
params.type = "resolved";
searchService.searchQuestionsByTerm(s, params);
private function setupCallbacks():void
ExternalInterface.addCallback("myFlexFunction",myFunc);
private function isContainerReady():Boolean
var result:Boolean = ExternalInterface.call("isReady");
return result;
public function startUp():void //initial call made hwn the
application starts
var isAvailable:Boolean = ExternalInterface.available;
trace(isAvailable.toString());
if (ExternalInterface.available)
var containerReady:Boolean = isContainerReady();
if (containerReady)
// If the container is ready, register the SWF's functions.
setupCallbacks();
else
trace("External interface is not available for this
container.");
// Define the Event Listeners for the Answer Service
searchService.addEventListener(AnswersResultEvent.QUESTIONS_SEARCH,
questionsResult, false, 0, true);
searchService.addEventListener(AnswersErrorEvent.ERROR_EVENT,
showError, false, 0, true);
=======================

Similar Messages

  • Adobe flex vs Interactive adobe forms

    Hi, I have used SAP Interactive adobe forms extensively. We used to use Web dynpro java or web dynpro abap to develop adobe related applications. In the meanwhile I would like to understand how adobe flex forms are different when compared to interactive adobe forms. Also I would like understand if the development environment remains the same if we use adobe flex instead of interactive adobe forms. And are there any special licensing requirements?
    thanks
    anantharam

    I would recommend Googling about this ;)

  • HTML/javascript interaction with swf content - can I call swf functions from JS?

    Hi,
    I've created an AIR application where the
    intialWindow.content is a HTML page / JavaScript application. On
    this HTML page I want to include some SWF content as a plugin (a
    Flex 3 app), so I have an object tag.
    From my SWF I can call out to JavaScript using
    flash.external.ExternalInterface fine. I can also call methods
    within the AIR and Flex APIs via the window or runtime objects.
    However, if I try to call methods within my SWF from
    JavaScript, nothing happens. Further, I can pass a function
    reference from my SWF to JavaScript (via ExternalInterface), and
    while I can see a valid function reference in JavaScript, calling
    it doesn't call the function within the SWF.
    Is this not supported? Or is this something else, like an
    applicationDomain issue? My SWF object is loaded via the app:/ uri,
    so I didn't think it would be that.

    I hadn't tried that, and it does work. Thank you. Everyone
    should note though that the documentation here
    Flex
    3 - External Interface
    and
    Flash
    9 - ExternalInterface.html
    says:
    "Note: Adobe AIR currently does not support the
    ExternalInterface class."
    which by my reading means that none of this should work,
    although it clearly does.
    The page
    Example:
    Using the external API with a web page container was most
    helpful in finding the solution, since it mentions referencing the
    object id of the plugin (e.g.
    window['my-object-id'].functionToCall()) when referencing the
    callback function.
    This
    page has a more concise example.

  • Mac/FireFox Java/JavaScript interaction bug

    Hi,
    I'm desperately trying to find a solution to a very platform-specific issue. Basically, I'm trying to get an applet to interact with the DOM of a web page. The basic procedure should be as follows:
    1) Page loads
    2) Applet loads
    3) Applet reads in data file (as specified by parameter in object tag)
    4) Applet sets title of document to contents of datafile
    5) Applet sets flag to indicate that it's finished
    6) Javascript checks flag regularly
    7) When applet flag is set, JavaScript transfers the title to the body (using a div and changing the innerHTML property)
    This works perfectly on most platforms (FF2/PC, FF3/PC, IE6/PC, IE7/PC, Safari/Mac) but for some reason FF/Mac isn't working. Or rather it is, but only about once per 50 attempts.
    I had read that having an applet inside a <div> tag was a problem for FF/Mac, so I moved it outside, but it's still not working. Most of the time the applet is simply failing to set the title.
    I'm using Eclipse for development, and the following libraries:
    java.net.URL
    org.w3c.dom.html.*
    com.sun.java.browser.dom.*
    The Java code in question is as follows:
    DOMService serv = DOMService.getService (this);
    dummy = (String) serv.invokeAndWait (new DOMAction () {public Object run (DOMAccessor accessor) {HTMLDocument website = (HTMLDocument)accessor.getDocument (FeedApplet.this); website.setTitle(docstring); return website.getTitle ();}});
    Any help would be much appreciated - thanks!
    Andrew

    Thanks for your replies. Sorry for being a bit vague - it was an end-of-the-day-end-of-my-wits posting!
    baftos, I've tried replacing the init() routine with a start() routine, but this hasn't changed anything. The problem appears to be with the Javascript timing, in that it's assuming the applet has finished before it has actually finished.
    jschell, step 4 appears to be the one that's failing. The title isn't being changed, but usually the taskbar says that the applet has started (occasionally it comes up with a NullPointerException). The system just seems to wait for a long time and nothing happens.The Javascript checks every second to see if a $ symbol (which is effectively the trigger) has appeared in the title, and if so then it moves the contents of the page from the title to the holding div. The flag in the applet is reset on starting the applet, and accessed through a get-type method, so it shouldn't be cached.
    It works in OmniWeb and Safari on a Mac, and IE/FF/Opera on a PC, so it's very specifically rooted in the FF/Mac problem zone.

  • Flex Javascript IE7

    I define a method in Flex. In asp.net page, i use javascript
    to call it. Just pass the string to Flex and display.
    In firefox2, the page has no error information, but the Flex
    didn't display the string. when I fresh this page, Flex work good,
    it display the String.
    In IE7, the page display a error information "Object doesn't
    support this property or method",click "No", Flex display nothing.
    After fresh this page, Flex work good too.
    Why?
    By the way, i google some information about it
    (https://bugs.adobe.com/jira/browse/SDK-9681), but i could not fix
    it.
    Thanks.

    Post some code, maybe?
    Tracy

  • Oracle PL/SQL or JavaScript Interaction with a PDF Document

    I'm new to LiveCycle - be gentle. . . :-)
    My department is attempting to develop a web application which will, among other things, generate fixed layout forms filled with data from the database or from an application web page. The web pages for this application will be served via stored procedures from an Oracle database through a dedicated web server - that is, the web pages are actually contained within stored procedures called by the browser through the web server (we're sort of an odd-ball shop, serving pages this way, but Oracle does lend itself well to this technique). We are exploring the feasibility of using LiveCycle to design the fixed layout forms without having to form a connection to the database from within the document or PDF viewer. We are currently using Crystal Reports to generate forms or reports but we are trying to get away from it due to implementation difficulties, dependability and connection issues and the fact that a license for a Crystal Reports viewer must be purchased for everyone who needs to view the reports.
    Is it possible to add a JavaScript snippet to an existing PDF form template from within an Oracle stored procedure to accomplish this (this appears to be the simplest solution to me)? The solution can be either PL/SQL or JavaScript based. Barring that, is it possible to merge data into PDF form fields before the document is sent to the browser?
    After several hours of searching through Google in general and the Adobe forums in particular, the closest possibilities I can find is XPAAJ or maybe the LiveCycle PDF Generator service that comes with LiveCycle - I'll be researching those approaches to determine their feasibility. In the meantime, suggestions for simpler approaches would be welcome. Thanks in advance.
    Woody

    A quick glance at PDF Generator shows that it doesn't handle document access, only document conversion. XPAAJ looks promising, but appears to require Java programming knowledge to utilize it - we're not a Java shop. I'll investigate further, see if the XPAAJ interface is available to other languages.

  • QTVR and Javascript interaction

    I am developing a piece of training courseware which shows a 'start-up' procedure involving several panels / displays, and is being produced using HTML, Javascript and Quicktime VR. This is to be run 'client-side', i.e. on a local machine, no server technology is being used. The layout consists of a HTML page with a quicktime VR movie, which has 4 hotspots. Each hotspot links to a particular panel shown on a new HTML page.
    For example, select hotspot "1" and jump to page "A", complete some process and return to the VR to select hotspot "2", jumping to page "B" to carry out further actions, then returning to the VR, and so on.
    The VR and hotspots are set up using the code below:-
    <script type="text/javascript">
    QTWriteOBJECTXHTML('Media/VR/SCO013VR.MOV', '600', '282', '',
    'autoplay', 'true',
    'align', 'middle',
    'EnableJavaScript', 'true',
    'controller', 'true',
    'showlogo', 'false',
    //Hotspot for Hand Controller.....//
    'Hotspot13', '../../CTS253_PMS_00_Sco013.6_Cde001V01.htm',
    //Hotspot for Drivers Master Display.....//
    'Hotspot59', '../../CTS253_PMS_00_Sco013.3_Cde001V01.htm',
    //Hotspot for Central Control Panel.....//
    'Hotspot66', '../../CTS253_PMS_00_Sco013.2_Cde001V01.htm',
    //Hotspot for Drivers Slave Display.....//
    'Hotspot172', '../../CTS253_PMS_00_Sco013.4_Cde001V01.htm');
    </script>
    All hotspots are to be available all the time, BUT must be selected in the required order. Selection in the wrong sequence will NOT result in jumping to the relevant page, but will remain on the VR display and provide some feedback text onscreen, re. the incorrect choice of panel.
    My problem is that I cannot find a way to "override" the hotspot links set up in the code above. Ideally I need to intercept the selection and carry out some function to check if it is the correct selection at that particular time, hence determine if the new page should be shown, or remain on the current page and just display the feedback text.
    I have searched on many sites and found the following in a pdf from Apples site, which suggests that this can't be done (at least not with Javascript):-
    "Important: Starting with QuickTime 7.1.5, you can no longer issue javascript:// URLs or call JavaScript functions from within a QuickTime movie. This feature was removed from QuickTime for security reasons."
    Can anyone suggest any ways around this?
    Cheers,
    Andy
      Windows 2000  

    This page used to have a similar kind of operation.
    http://www.amway.com/en/Product/products-10329.aspx
    The latest QuickTime update kills it though. I'm not sure if there is a workaround, but have you joined the QuickTime developer list? You may find interesting threads there.

  • LIVE CONNECT: Applet-Javascript interaction: JSObject.class

    Does anyone know where I can get a copy of "java40.jar", or its latest equivalent?
    It contains JSObject.class and JSException.class, and is needed for LiveConnect functionality.
    The file used to be part of Netscape's Netscape Java Classes, distributed with old Communicator distributions. None of this is contained in Netscape's latest offerings. Not a word from Netscape on the subject , though LiveConnect was primarily their baby.
    Thanks in advance,
    Laurence

    Netscape.javascript is in the plugin.jar not in the java40.jar.
    jre 1.4.0_03 and higher installation:
    {java.home}\lib\plugin.jar
    before 1.4.0_03
    {java.home}\lib\jaws.jar

  • FLEX / PHP Interaction

    Right now I have a tilelist with some stuff and I wanted to
    know if it is possible to make it when a key is pressed it connects
    to a php file updates something on the mysql db and then reloads
    the tilelist with the newly updated information?

    I have plenty of Flex/PHP examples using Remoting and AMFPHP,
    SabreAMF or WebORB for PHP on my blog at
    http://renaun.com/blog.
    You can also use Flex's HTTPService or WebService components
    to communicate to PHP.

  • CF session - can javascript interact with it?

    Hello, everyone.
    Just wondering if JavaScript can manipulate a CF session variable?
    I'm submitting a form via jQuery .post() method.  Upon success or failure, I'd like to set a CF session variable (confirm or failure, respectively) and reload the page to display the message.  Can this be done via JavaScript?
    Thank you,
    ^_^

    WolfShade wrote:
    Just wondering if JavaScript can manipulate a CF session variable?
    If it could, then every user would be able to manipulate your application. If your application is a web store, for example, he will be able to change session.totalPrice from $1500.00 to $0.10.
    I'm submitting a form via jQuery .post() method.  Upon success or failure, I'd like to set a CF session variable (confirm or failure, respectively) and reload the page to display the message.  Can this be done via JavaScript?
    Yes. Infact, you've been doing that already! JQuery is Javascript. You could redesign the form page such that it is its own action page. That is, the form submits to its own page.
    The page checks for the existence of form variables. If there are none, the form is displayed(the page default). If there are, then the form must have been submitted, and so form processing like validation, confirmation, etc., is done.

  • How to use Flex in JSP

    Hi ,
    I am new to Oracle BPM . I have created a sample Process flow with Two Participants and two roles .And Also i have created the ScreenFlow using Jsp's . Now my problem is we need to integrate Adobe flex inside Jsp's or is there a way we can directly use Flex mxml files for UI . Is there way to use Taglibs which supports Adobe Flex in Jsp ..?
    Thanks,
    KM
    Edited by: user7711237 on Sep 23, 2009 5:00 AM

    This is a very interesting question. Please pardon my limited knowledge of OBPM and Flex, but it sounds like there are a couple of options.
    1. PAPI - build an external web app with Flex front end and a server server-side component that uses PAPI (or PAPI WS) for integration with OBPM
    2. JSP - this is a lot more hacky (if at all possible) - build custom JSPs using the standard OBPM taglibs, etc., and Flex app. Then use Flex / JavaScript interaction to invoke submit the from on the JSPs.
    Here are a few links for #2
    http://www.switchonthecode.com/tutorials/flex-javascript-tutorial-simple-interaction
    http://www.vipercreations.com/tutorials/Adobe%20Flex/35/
    http://www.abdulqabiz.com/blog/archives/2005/04/28/calling-a-flex-function-from-javascript/
    It almost sounds like #1 might be a good long-term solution for complex UIs, while #2 would fit better for a smaller and more simple Flex UI that need to be developed quickly. Hope others might offer better suggestions.
    HTH.

  • Javascript in Flex

    Hello,
    I would like to put a hit counter in my flex website. So, I go to www.hitscount.com and create my hit counter and then, I have a javascript script, but how put it in my website... Can you explain to me very easily, I'm a newbie
    My script is :
    <code>
    <div align='center'>...............</div>
    </code>
    Thank you very much
    Chandler

    you'll have to do an external call to your javascript in the template file, from your flex application.
    here's an example of flex<-> javascript communication
    http://www.switchonthecode.com/tutorials/flex-javascript-tutorial-simple-interaction
    here's an example of how to do a hit counter using PHP instead of Javascript
    http://www.mattlefevre.com/viewExample.php?tut=flexPHP&proj=Hit%20Counter

  • Interact with indesign javascript through Jtree

    i can display indesign script files in tree view. what is my question is if i click the indesign javascript file i want
    to execute. that means i want to interact with java swing to indesign cs3. How it is possible could anyone tell me.

    Welcome to the Sun forums.
    >
    i can display indesign script files in tree view. what is my question is if i click the indesign javascript file i want
    to execute. that means i want to interact with java swing to indesign cs3. How it is possible could anyone tell me.>About the only way you will be able to get interaction between a JTree and JavaScript is to put the JTree in a JApplet and put that applet in a web page that also references the scripts.
    As far as Java/JS interaction go, look to [Real's HowTo|http://www.rgagnon.com/howto.html] (<- link) and the categories 'Java|JavaScript Interaction' & 'JavaScript|Interaction with Java'.
    Testing will be a hassle, since the AppletViewer does not support Java/JS interaction and browsers cache the classes. Not that applet development is not a PITA to start with.
    And a few points before closing:
    - All sentences should start with a single upper case letter. This helps the reader to quickly scan text, looking for ways they can help. You would not want to make it harder for people who are trying to help, would you?
    - The word 'I' should be always upper case, always.
    - ..and it is JTree, not Jtree. Please be very careful with class names so we can all be sure you refer to J2SE classes, and not some 3rd part class about which we know nothing and do not support.
    Edited by: AndrewThompson64 on Jul 6, 2009 9:19 PM

  • How to control SWF Video using JavaScript?

    Hi,
    I'm developing a web page which will use Flash Videos. I need
    to control the video without using a typical skin. The current tool
    I'm using to convert my wmv to SWF FLV is Coffee Cup. A hex edit
    suggests this is a Version 8 SWF.
    I am trying to write some javascript to control which Frame
    is displayed. I have seen code such as movie.TGotoFrame(...); and
    movie.GotoFrame, movie.StopPlay() etc. Unfortunately I cannot seem
    to use these methods. Eventually I suspected that my SWF simply did
    not make these methods available and when I run my video in my web
    page a RightClick shows a Context Menu that has no Reverse,
    Forward, Back options. Other SWF videos do have these options
    (obviously). This seems to prove that nothing I could code would
    make the GotoFrame work (ie no Forward (by one frame) option in
    menu suggests it could never work from javascript).
    Some Questions
    Is there a tool to examine a SWF to see what methods are
    available to javascript control? (expose the API) and is there a
    setting required in the <object> setup to enable javascript
    interaction?
    Is there something about SWF V8 files that is the problem or
    is likely that the CoffeeCup Web Video Player can only make
    partially functioning SWF Videos?
    What is the difference between GotoFrame and TGotoFrame and
    have these perhaps been superceeded by something else (there is an
    Adobe page which suggests they are only available up to Version 5
    (not sure if that means Version 5 of SWF files or Version 5 of the
    FlashPlayer - to add to my confusion).
    I'm not currently a Flash type developer and have no tools to
    speak off and don't know ActionScript. I'm thinking of heading in
    the Flash direction but not sure how to move forward.
    Cheers
    Stuart

    Thanks Alex,
    quote:
    You need to learn to move forward :)
    I have a Greek friend who when I asked him how he was getting
    on with his dissertation project stated "in Greece we have a saying
    - every start is different".
    In this case my start is to dip a toe in the Flash water and
    not get scalded.
    Anyhow,
    One clarification from the CoffeeCup forum helped me to
    understand that my SWF used an external FLV and that may explain
    why the rightclick context menu did not have the more movie
    specific Back, Forward etc. Sounds plausible. So assume external
    FLV.
    quote:
    it is very easy to add a small script into the root timeline
    of your SWF file
    A little hand holding here would be appreciated. I have
    downloaded the Flex SDK. Can I use this free tool to do what you
    suggest? Using MXML and ActionScript. If so, a little bit more info
    would help.
    quote:
    That's all, it should work. Of course, you can tell me that
    your movie
    already has an onEnterFrame() eventhandler at the root
    timeline.
    What's a problem? Just create an empty movieclip and add this
    script
    into its frame 1 (it maybe the only frame). But do not forget
    to
    change "this.xxxx" to "_root.xxxx" within such script.
    Hhhmmm. A bit stumped. I've had a look at the SWF using
    FlashDig. I noticed what appears to be Assembly Language (Push,
    Pops, Jumps etc) and presumably in amongst all of that may be an
    onEnterFrame. Perhaps linked to a DefineFunction2 node.
    Unfortunately the SWF is very large (60K) and there is no
    search/find tool so that makes finding functions a bit harder than
    expected. Struggling a little with the concept of _root and Level0
    etc.
    I assume you are suggesting manually building a replacement
    SWF (empty movieclip?) if the onEventHandler happens to be used for
    something else. Presumably set/getVariables only interacts with
    this function so if it is 'booked' in my SWF I would be in a spot
    of bother with your suggested approach?
    I wonder if you are assuming I have some sort of Flash tool.
    Possibly like this one shown in this tutorial
    WebWasp
    Panorama tutorial
    Note. The panorama is actually close to what I eventually
    want to do except I intend to make a video of a scene by rotating
    clockwise by 360 degrees. Then add buttons onto the SWF (or DHTML)
    which communicates with the SWF to move forward or back through the
    video. Moving forward would be like a clockwise rotation and moving
    back would create anticlockwise rotation. This explains the need to
    GotoFrame (or similar). From that perspective I don't need to
    become a Flash guru (for now) and can't justify buying all the
    expensive flash tools for this one (apparently) simple task: Frame
    by Frame control of an external FLV via the SWF.
    Note. I've started using SWFObject. Might this library help?
    In summary.
    How do I add the onEnterFrame ActionScript sample (or
    something similar) into a SWF using only the Flex SDK command line
    tools or similar in order to control an external FLV?
    Cheers
    Stuart

  • Call javascript function in an html page, how to?

    How can i call a javascript function in an html page were my flash catalyst swf is?

    I think you will need to import the catalyst fxp into flash or flash builder and add action script to invoke the javascript.
    These two links may be of use
    http://blog.codefidelity.com/?p=15
    http://www.switchonthecode.com/tutorials/flex-javascript-tutorial-simple-interaction
    I hope that helps

Maybe you are looking for

  • Trouble downloading "The Photoshop Guys"

    Every week, I used to download those great tutorials. Now, suddenly, I keep running into the following: "There was a problem downloading 'Photoshop TV.' An unknown error occurred (-50)." The pop-up also invites me to "Please check that the URL is cor

  • Drag and Drop image to desktop == Zero Byte File

    Drag and Drop image to desktop == Zero Byte File == This happened == Every time Firefox opened == FireFox 3.6 OR Windows 7 64

  • Vertical variable in oracle developer report 6i

    Hi I want to define a vertical variable in oracle report 6i but this ''Only text and boilerplate can be rotated'' what can I do that?

  • Not enough grunt left to burn movie!

    I know nothing, OK? My hard drive ( Model Name: iMac Model Identifier: PowerMac6,1 Processor Name: PowerPC G4 (3.3) Processor Speed: 1 GHz Number Of CPUs: 1 L2 Cache (per CPU): 256 KB Memory: 1 GB Bus Speed: 133 MHz) is almost full. I bought a WD 1Tb

  • New Xperia S apps

    Hi guys i installed the new xperia S apps on my phone but the weather widget would not work with my neo l and each time i reboot my phone the phonebook app would unistall itself can that be fixed and on the launcher when i reboot i lose some of my sh