加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

How to take advantage of Alcon

发布时间:2020-12-15 06:52:59 所属栏目:百科 来源:网络整理
导读:After unzipping the compressed file,the folder looks like: Copy the folder into Adobe Flash installation directory. And add the lib path in 'Actionscript3.0 Setting Panel': Go to Flash CS5.5,create a new ActionScript3.0 fla file,put the co

After unzipping the compressed file,the folder looks like:


folder



Copy the folder into Adobe Flash installation directory. And add the lib path in 'Actionscript3.0 Setting Panel':


as3-setting



Go to Flash CS5.5,create a new ActionScript3.0 fla file,put the code on the timeline:


import com.hexagonstar.util.debug.Debug;

Debug.trace("hello Vincent");

Debug.traceObj(stage);

Debug.monitor(stage,1000); 

Publish the fla,to generate SWF and html files. Then run Alcon.exe,and open the html in Firefox,almost at the meantime,we can see the window of Alcon populating data:


alcon



How to use it in Flex environment?


Download the latest version from official site:?http://www.hexagonstar.com/project/alcon/#download


And install it. Then in Flash Builder 4.5,select the project right-click mouse,select properties in the context menu,in the pop up panel,find the swc file under Alcon installation directory,and set as shown:


?

properties-build-path


The following steps may be tricky,in Flex program,the reference 'stage' is not available immediately after the program initiated,if you access the stage in applicationComplete handler,it will be null. There are two workarounds.?


1. To use callLaterfunction:


<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" xmlns:local="*"
           creationComplete="callLater(init)">

...
            <fx:Script>
		<![CDATA[
			import com.hexagonstar.util.debug.Debug;
			
			import mx.events.FlexEvent;
                        private function init():void
			{   
				Debug.monitor(stage,1000);
			}
]]>
	</fx:Script>
...

Within the above block,the method init() will be invoked for more than one times untill it eventually be executed.


2. To use ADD_TO_STAGE event:


<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" xmlns:local="*"
			   addedToStage="application1_addedToStageHandler(event)">
	...
	<fx:Script>
		<![CDATA[
			import com.hexagonstar.util.debug.Debug;
			
			import mx.events.FlexEvent;
			protected function application1_addedToStageHandler(event:Event):void
			{
				Debug.monitor(stage,1000);
			}
			
		]]>
	</fx:Script>
	...

Within the snippet,the handling function will be invoked after the applicatipn instance be added to the stage,at that moment the stage must be aready to use.



Added at 4th-Dec-2012


Alcon.exe file can run without the as files under /debug/ path,the sources codes are only for the enviroment what you are publishing your swf. It is not necessary in product enviroment.


under-production-enviroment




refs:


http://hi.baidu.com/caijx/blog/item/ad474c23c22c745a9922edac.html


Official Site of Alcon

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读