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>