After JSP is embedded in flex, you can disable Mouse clicking on the page when operating the flex function.

Source: Internet
Author: User

Flex's ActionScript and javascript can interact through the externalinterface class provided by Flex. The content displayed in Flex is embedded in a similar portal project, which may take a long time to operate the document. During this period, the customer is expected to wait for a moment, so the menu needs to be disabled, organize it into other modules. Therefore, you can use the call method of externalinterface to disable the mouse clicking event.

In HTML-template \ index.template.html, add the JavaScript function to be called in flex.

function callNoUse(){self.parent.frames["frame3"].donotUsed();}function callCanUse(){self.parent.frames["frame3"].canUsed();}

In this way, flex can execute the following methods in ActionScript when you need to disable Mouse clicking

ExternalInterface.call("callNoUse");

Call

ExternalInterface.call("callCanUse");

Flex and JSP are integrated using frameset. The general layout is as follows:

<frameset rows="23%,*" cols="840px"  frameborder="no" framespacing="0" style="text-align:MIDDLE;"><frame src="../top.html" name="frame3" frameborder="0" scrolling="no" noresize="noresize"/><frameset  rows="*" cols="*,1025,*"><frame/><frame src="<%=path%>/WorkplaceFx.html" name="frame2" frameborder="0" scrolling="no" noresize="noresize" /><frame/></frameset></frameset>

The JavaScript method that needs to be finally executed is in frame3. the code is as follows.

Function donotused () {document. onmousedown = nonclick;} function canused () {document. onmousedown = NULL;} function nonclick (e) {If (window. event) {e = Window. event;} If (E. button = 1) {alert ("Please wait... ");}}

The above flex call method is put in HTML-template \ index.template.html because of the special nature of the file's Flex. We can see from its name that it is a template file, changing all files in the directory does not actually work for the deployment project. However, in the compilation phase, SwF and the corresponding HTML are generated based on this template. Put the relevant code into it to ensure its stability is not lost. A Brief Introduction to the structure of the Flex HTML-template folder contains three files and one folder:

1、index.template.html. html.

2. swfobject. js. A JavaScript library that contains the method for loading Flash Player during runtime and the function for judging the user's Flash Player version. Flex4 now uses the swfobject. js open source JS library to deploy Flash Player and programs, while flex3 uses ac_oe_tags.js. For more information about swfobject. JS, see the Adobe official website http://code.google.com/p/swfobject.

32.16playerproductinstall.swf. A flash program is used to update the Flash Player of the user system after the Flash Player is installed later than 6.65.

4. The history folder contains several file files used for History Management:
· Historyframe.html. html page template, which is loaded by <IFRAME> of the homepage at runtime.
· History.js.a criptlibrary contains some methods that can be called by historyframe.html.
· History.css. Contains the styles required by historyframe.


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.