FlashDevelop+OMSF第一个例子,关于编译常量的问题

OMSF出了1.0版,刚用FlashDevelop3.2.1来新建一个as3工程测试官方提供的代码:

public class Main extends Sprite 
	{
		private var _mediaPlayer:MediaPlayerSprite;
		
		public function Main():void 
		{
			if (stage) init();
			else addEventListener(Event.ADDED_TO_STAGE, init);
		}
		
		private function init(e:Event = null):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, init);
			// entry point
			_mediaPlayer = new MediaPlayerSprite();
			addChild(_mediaPlayer);
			
			var filePath:String = "test.flv";
			var urlResource:URLResource = new URLResource(filePath);
			_mediaPlayer.resource = urlResource;
		}
		
	}

 

居然报错,错误如下:

F:\studyCase\as3Lib\org\osmf\media\DefaultMediaFactory.as(37): col: 10 Error: Access of undefined property FLASH_10_1.
CONFIG::FLASH_10_1
^
F:\studyCase\as3Lib\org\osmf\media\DefaultMediaFactory.as(145): col: 12 Error: Access of undefined property FLASH_10_1.
CONFIG::FLASH_10_1
^
F:\studyCase\as3Lib\org\osmf\media\DefaultMediaFactory.as(240): col: 11 Error: Access of undefined property FLASH_10_1.
CONFIG::FLASH_10_1
^
F:\studyCase\as3Lib\org\osmf\media\DefaultMediaFactory.as(240): col: 11 Error: Access of undefined property FLASH_10_1.
CONFIG::FLASH_10_1
^
F:\studyCase\as3Lib\org\osmf\utils\OSMFStrings.as(220): col: 11 Error: Access of undefined property FLASH_10_1.
CONFIG::FLASH_10_1
^
F:\studyCase\as3Lib\org\osmf\utils\OSMFStrings.as(400): col: 12 Error: Access of undefined property FLASH_10_1.
CONFIG::FLASH_10_1
^
F:\studyCase\as3Lib\org\osmf\utils\Version.as(102): col: 12 Error: Access of undefined property FLASH_10_1.
CONFIG::FLASH_10_1
^
F:\studyCase\as3Lib\org\osmf\utils\Version.as(121): col: 12 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRenderer.as(33): col: 10 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRenderer.as(535): col: 12 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRenderer.as(638): col: 12 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRenderer.as(680): col: 11 Error: Access of undefined property LOGGING.
CONFIG::LOGGING private static const logger:org.osmf.logging.Logger = org.osmf.logging.Log.getLogger("org.osmf.layout.LayoutRenderer");
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRenderer.as(680): col: 11 Error: Access of undefined property LOGGING.
CONFIG::LOGGING private static const logger:org.osmf.logging.Logger = org.osmf.logging.Log.getLogger("org.osmf.layout.LayoutRenderer");
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRendererBase.as(919): col: 12 Error: Access of undefined property LOGGING.
CONFIG::LOGGING { logger.debug("ON EXIT FRAME: BEGIN"); }
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRendererBase.as(926): col: 14 Error: Access of undefined property LOGGING.
CONFIG::LOGGING { logger.debug("VALIDATING LAYOUT"); }
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRendererBase.as(928): col: 14 Error: Access of undefined property LOGGING.
CONFIG::LOGGING { logger.debug("LAYOUT VALIDATED"); }
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRendererBase.as(935): col: 12 Error: Access of undefined property LOGGING.
CONFIG::LOGGING { logger.debug("ON EXIT FRAME: END"); }
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRendererBase.as(944): col: 11 Error: Access of undefined property LOGGING.
CONFIG::LOGGING private static const logger:org.osmf.logging.Logger = org.osmf.logging.Log.getLogger("org.osmf.layout.LayoutRendererBase");
^
F:\studyCase\as3Lib\org\osmf\layout\LayoutRendererBase.as(944): col: 11 Error: Access of undefined property LOGGING.
CONFIG::LOGGING private static const logger:org.osmf.logging.Logger = org.osmf.logging.Log.getLogger("org.osmf.layout.LayoutRendererBase");
^
F:\studyCase\as3Lib\org\osmf\media\pluginClasses\PluginLoader.as(37): col: 10 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
F:\studyCase\as3Lib\org\osmf\media\pluginClasses\PluginLoader.as(212): col: 13 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
F:\studyCase\as3Lib\org\osmf\media\pluginClasses\PluginLoader.as(221): col: 12 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
F:\studyCase\as3Lib\org\osmf\media\pluginClasses\PluginLoader.as(256): col: 11 Error: Access of undefined property LOGGING.
CONFIG::LOGGING
^
Build halted with errors (fcsh).

原来是编译常量问题,解决如下:

右击as3项目,选择属性,出来如下对话框:

设置Compiler Constants参数如下:

确定就ok了!有关编译常量的更多介绍可以看下面这个链接:

http://www.insideria.com/2009/10/create-cleaner-actionscript-wi.html

posted @ 2010-06-14 11:46  ywxgod  阅读(6436)  评论(0编辑  收藏  举报