Getting started with a simple Flex verification code case _flex

Source: Internet
Author: User
Just wrote a simple flex verification mechanism, provided for everyone to download, only to do a good job.
[Flex Verification Code Verification Mechanism source code DOWNLOAD]
The first step is to build a project. Named Validcode
Validcode.mxml
<?xml version= "1.0" encoding= "Utf-8"?>
xmlns:mx= "Http://www.adobe.com/2006/mxml" layout= "absolute" width= "<mx:application" height= ">"
<mx:Script>
<! [cdata[
private var Bisup:boolean = false;
Private Function Doclickup (): void {
Bisup = true;
}
Private Function Doclickdown (): void {
if (bisup) externalinterface.call ("suc", "verify success [www.dc9.cn]");
}
]]>
</mx:Script>
<mx:label x= "0" y= "0" text= "Please first hit this" Width= "height=", "" fontsize= "and" click= "doclickup ()/>
<mx:label x= "" "Y=" text= "and then hit this" Width= "" height= "" "Fontsize=" "" Click= "" Doclickdown () "/>
</mx:Application>
Step two, add in the script inside the index.template.html
function suc (str) {
alert (str);
}
Test Presentation page
This is just a call to alert, and real validation can invoke an Ajax using Shareobject,
or with Httpservice or urlrequest, you can, Flex is very powerful oh.

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.