Hello world Program in xflash

Source: Internet
Author: User

The following is a hello world instance. Although it looks the same as the button in html, all the elements in xflash are independent of the page and are pure flash. From the code perspective, it is relatively simple to use. You only need to include xflash. js files to meet further development requirements.
The specific method is to create an xflash object, and then call the method of this object to implement various functions. In this example, a button is created under _ root and an event is added to the button. The syntax is very similar to html, but the pos attribute is used for the position, the parameters are x coordinates, y coordinates, object width, and object height in sequence.
Pos is an important attribute in xflash. Each element has a keyword. In addition to constants, you can also use keywords, such as c and m in this example, indicates horizontal and vertical center, respectively.
<Script src =/xflash. js> </script>
<Xmp type = "xfml">
<Button onclick = "alert ('hello, welcome to xflash develop world ~~ ') "Pos = 'C, m,'> I'm xflash, click me </button>
</Xmp>
Specifically, xflash.jsand xflash.swf are used together to achieve resolution.

<Script src = http://www.script8.com/xflash/xflash.js> </script>
<Script>
Var xf = new xflash ()
Xf. createElement ("_ root", "<button onclick = \" alert ('ricky quietly tested ~ ') \ "Pos = 'C, m, 150,21'> Start </button> ")

Xf. createElement ("_ root2", "<button onclick = \" alert ('ricky quietly tested ~ ') \ "Pos = '2017, m + 200, 21'> Start2 </button> ")
</Script>

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.