<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ladysign Dev Blog &#187; extern actionscript</title>
	<atom:link href="http://www.ladysign-apps.com/blog/tag/extern-actionscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ladysign-apps.com/blog</link>
	<description>Girls can code.</description>
	<lastBuildDate>Mon, 12 Dec 2011 16:58:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Flex: load extern actionscript</title>
		<link>http://www.ladysign-apps.com/blog/code/flex-code/flex-load-extern-actionscript/</link>
		<comments>http://www.ladysign-apps.com/blog/code/flex-code/flex-load-extern-actionscript/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 11:49:20 +0000</pubDate>
		<dc:creator>Lee</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[extern actionscript]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[mxml]]></category>

		<guid isPermaLink="false">http://ladysign-apps.com/blog/?p=394</guid>
		<description><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>The cool thing about Adobe Flex is that you can run within your mxml file Actionscript.<br />
I love standards and clean code. [......]</p><p class='read-more'><a href='http://www.ladysign-apps.com/blog/code/flex-code/flex-load-extern-actionscript/'>继续阅读</a></p>]]></description>
			<content:encoded><![CDATA[<p><strong>Difficulty:</strong> 2 out of 5 stars</p>
<p>The cool thing about Adobe Flex is that you can run within your mxml file Actionscript.<br />
I love standards and clean code. That&#8217;s why I wanted to know how I can run an extern Actionscript.as file.<br />
It&#8217;s pretty easy:</p>
<p>1. Create a new folder in your Flex project. &#8211; I called it: includes<br />
2. In my mxml I define the extern Actionscript:</p>
<p>    <mx:Script><br />
    	<![CDATA[<br />
        include "../includes/scripts.as";<br />
    	]]&gt;<br />
    </mx:Script></p>
<p>3. I&#8217;ll also define the action into mxml, I want it after a button click:</p>
<p><mx:Button label="Next page" click="init();" x="156" y="375"/></p>
<p>4. In my includes folder I create an Actionscript: scripts.as:<br />
For example:</p>
<p>import mx.controls.Alert;</p>
<p>private var alert:Alert;</p>
<p>private function init():void {<br />
    var alertText:String = &#8220;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Suspendisse rutrum metus nonummy augue. In hac habitasse platea dictumst. Nulla arcu libero, nonummy non, suscipit a, mollis non, augue. Maecenas porttitor urna vel enim. Nam eget tortor. Mauris facilisis suscipit felis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Proin nunc turpis, venenatis non, laoreet at, fringilla nec, purus. Sed sodales. Sed turpis. Vestibulum sagittis justo id metus. Sed placerat, nibh lobortis mattis adipiscing, sapien wisi interdum arcu, nec vehicula sem tortor id nibh.&#8221;;<br />
    var alertTitle:String = &#8220;The quick brown fox jumped over the lazy dog.&#8221;;<br />
    alert = Alert.show(alertText, alertTitle);<br />
    alert.status = &#8220;I&#8217;m a status message&#8221;;<br />
}</p>
<p>That made my day!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ladysign-apps.com/blog/code/flex-code/flex-load-extern-actionscript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

