flex - Running a program with a package -
can 1 tell me if have saved following file test.mxml
if run program errors.if include class in package how should program run??
package { import flash.display.sprite; import flash.media.*; public class test { public function test() { //alerting code } } }
you can either have mxml class test.mxml:
<?xml version="1.0" encoding="utf-8"?> <s:application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minwidth="955" minheight="600" creationcomplete="application1_creationcompletehandler(event)"> <fx:script> <![cdata[ import mx.controls.alert; import mx.events.flexevent; protected function application1_creationcompletehandler(event:flexevent):void { alert.show("test"); } ]]> </fx:script> </s:application>
or can have pure actionscript class looks this:
test.as
package { import mx.controls.alert; public class test { public function test() { alert.show("test"); } } }
Comments
Post a Comment