flex中嵌入swf

 

/*Images.as*/
package
{
	public class Images
	{
		[Embed("images/bgskin.swf")]   
		public   static   const  BACKGROUND_SKIN:Class;   
	}
}

/*mxml_as_embed.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">
	<s:layout>
		<s:BasicLayout/>
	</s:layout>
	<fx:Script>
		<![CDATA[
			import Images;
		]]>
	</fx:Script>
	<fx:Declarations>
		<!-- 将非可视元素(例如服务、值对象)放在此处 -->
	</fx:Declarations>
	<mx:Image   id ="checkBtn"  source ="{Images.BACKGROUND_SKIN}" /> 
</s:Application>

 

你可能感兴趣的:(Flex)