<?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"
	>

<channel>
	<title>Mark Ledford's Blog</title>
	<atom:link href="http://www.markledford.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markledford.com/blog</link>
	<description>Mostly some useful tidbits from an Adobe Flex / Flash Developer</description>
	<pubDate>Mon, 05 Jan 2009 23:14:44 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>encodeURIComponent in AS3</title>
		<link>http://www.markledford.com/blog/2008/12/17/encodeuricomponent-in-as3/</link>
		<comments>http://www.markledford.com/blog/2008/12/17/encodeuricomponent-in-as3/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 23:20:05 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=27</guid>
		<description><![CDATA[Haven&#8217;t posted in awhile. Been Keeping busy here at KickApps and took a 2 week vacation to South Korea. It was awesome :)
I was looking into interfacing with some Facebook APIs today via actionscript and was having some issues passing some nested querystring vars. Turned out using escape() wasn&#8217;t enough and encodeURIComponent() did the trick. [...]]]></description>
			<content:encoded><![CDATA[<p>Haven&#8217;t posted in awhile. Been Keeping busy here at KickApps and took a 2 week vacation to South Korea. It was awesome :)</p>
<p>I was looking into interfacing with some Facebook APIs today via actionscript and was having some issues passing some nested querystring vars. Turned out using escape() wasn&#8217;t enough and encodeURIComponent() did the trick. I didn&#8217;t realize it was even available in actionscript until i did some googling. encodeURI() and encodeURIComponent() are available along with escape() as top level functions in AS3.</p>
<p><a href="http://xkr.us/articles/javascript/encode-compare/">Here&#8217;s a useful link explaining the difference</a> between them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/12/17/encodeuricomponent-in-as3/feed/</wfw:commentRss>
		</item>
		<item>
		<title>mysterious “Where is the debugger or host application running?” dialogue on non-debug swfs</title>
		<link>http://www.markledford.com/blog/2008/09/01/mysterious-where-is-the-debugger-or-host-application-running-dialogue-on-non-debug-swfs/</link>
		<comments>http://www.markledford.com/blog/2008/09/01/mysterious-where-is-the-debugger-or-host-application-running-dialogue-on-non-debug-swfs/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 06:49:40 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[bugs]]></category>

		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=22</guid>
		<description><![CDATA[Remember awhile back when you&#8217;d go to a flash site and randomly get accosted by a “Where is the debugger or host application running?” modal prompt? Haven&#8217;t seen one in a while have you? Happily these days debug swfs normally don&#8217;t pop open this dialogue unless you explicitly right click a debug swf and click [...]]]></description>
			<content:encoded><![CDATA[<p>Remember awhile back when you&#8217;d go to a flash site and randomly get accosted by a “Where is the debugger or host application running?” modal prompt? Haven&#8217;t seen one in a while have you? Happily these days debug swfs normally don&#8217;t pop open this dialogue unless you explicitly right click a debug swf and click on &#8220;Debugger&#8221; from its context menu. Unfortunely there are still some tricky situations where this prompt will still rear its ugly head.</p>
<p>My Google-foo (or Adobe?) has let me down on getting solid information on this but in my tests it appears this functionality changed with Flash Player Debugger 9,0,115,0 (Yeah, I thought it was earlier too). This is the debugger version that installs with Flex so even tho you may no longer get the prompt its keen to note that any viewer with a &lt;9,0,115,0 Flash 9 debugger (like the 9,0,45,0 debugger that installs with Adobe CS3) will still receive it. In most cases this isn&#8217;t anything to worry about though as its second nature to turn off debugging on your production swf. However did you know you have to take into account all embedded and run-time loaded swfs as well?</p>
<p>After receiving reports of said infamous debugger on our production swfs and a lot of time spent investigating with <a href="https://addons.mozilla.org/en-US/firefox/addon/5044" target="_blank">Flash Switcher</a> I found a couple insignificant embedded icon swfs and a few run-time loaded font swfs were the debug swf culprits. Duplicating the issue in the Flash 9.0.45.0 Debugger, what made matters worse is that each debug swf that loaded was getting its own modal popup and, atleast in Mac FF3, each consecutive modal popup was showing up blank but still needed to be clicked or the user was locked out of the site.</p>
<p>After another extensive google search the only thing I could find regarding this child swf debugger policy is a brief mention in <a href="http://www.kaourantin.net/2007/12/adobe-flash-player-9-update-3-released.html" target="_blank">Tinc Uro&#8217;s Blog regarding Flash Player 9 Update 3</a> (again Player 9,0,115,0). The one line from his release notes was: &#8220;210746 When a release swf loads a debug swf, flash player doesn&#8217;t look for the debugger&#8221;.  I&#8217;m assuming that this was the &#8220;fix&#8221; as this player version does indeed keep the issue from happening. So to prevent your viewers from ever getting spammed with &#8220;Where is the debugger&#8221; modal windows, ensure all your swfs (embedded and run-time loaded) are non-debug or force your viewers to update to the most recent flash player if they don&#8217;t have atleast 9,0,115,0.</p>
<p>With the proliferation of &#8220;dot&#8221; releases of the Flash Player its now really important to know which sub version of the player you are targeting. Looking at the Flash Player 9 version penetration rates at KickApps I was surprised to find around 80% of our audience had atleast 115. I&#8217;m not sure of the remaining 20% how many are debug players though.</p>
<p>Version        Penetration<br />
9,0,124,0:    ~56%<br />
9,0,115,0:    ~24%<br />
9,0,47,0:     ~10%<br />
9,0,28,0:      ~7%<br />
9,0,45,0:      ~4%</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/09/01/mysterious-where-is-the-debugger-or-host-application-running-dialogue-on-non-debug-swfs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why some AS3 swfs work stand alone but fail to load into other swfs</title>
		<link>http://www.markledford.com/blog/2008/08/13/why-some-as3-swfs-work-stand-alone-but-fail-to-load-into-other-swfs/</link>
		<comments>http://www.markledford.com/blog/2008/08/13/why-some-as3-swfs-work-stand-alone-but-fail-to-load-into-other-swfs/#comments</comments>
		<pubDate>Wed, 13 Aug 2008 23:05:23 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/2008/08/13/why-some-as3-swfs-work-stand-alone-but-fail-to-load-into-other-swfs/</guid>
		<description><![CDATA[Most developers who create standalone swfs have some standard instantiation code in their class constructor, something like this:
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
This works fine when the swf is embedded on a page directly as the &#8220;stage&#8221; property will be available instantaneously.
When this swf is loaded into another swf however, say like this:
var loader:Loader = new [...]]]></description>
			<content:encoded><![CDATA[<p>Most developers who create standalone swfs have some standard instantiation code in their class constructor, something like this:</p>
<p>stage.align = StageAlign.TOP_LEFT;<br />
stage.scaleMode = StageScaleMode.NO_SCALE;</p>
<p>This works fine when the swf is embedded on a page directly as the &#8220;stage&#8221; property will be available instantaneously.<br />
When this swf is loaded into another swf however, say like this:</p>
<p>var loader:Loader = new Loader();<br />
addChild(loader);<br />
loader.load(new URLRequest(&#8221;http://widget.meebo.com/mcr.swf?id=RQYRkTseLc&#8221;));</p>
<p>It generates the infamous and ambiguous: TypeError: Error #1009: Cannot access a property or method of a null object reference.<br />
I&#8217;m pretty sure this is because when a swf is loaded into another swf, it&#8217;s class constructor is called to create the object before it is even added to it&#8217;s parent (the Loader object).<br />
Thus the stage property is undefined, which throws the error, which kills the call stack including what ever else was in the constructor after the stage reference.<br />
I&#8217;d kind of consider this a bug in the flash architecture.</p>
<p>The work around to insure your swf is compatible with loading into other swfs:<br />
If the stage references are just the above, you can throw a try/catch around them as they would probably get set by the loader anyways:</p>
<p>try {<br />
stage.align = StageAlign.TOP_LEFT;<br />
stage.scaleMode = StageScaleMode.NO_SCALE;<br />
} catch(er:Error) { };</p>
<p>or just ensure the property is available:</p>
<p>if (stage){<br />
stage.align = StageAlign.TOP_LEFT;<br />
stage.scaleMode = StageScaleMode.NO_SCALE;<br />
}</p>
<p>or, if there is setup that absolutely requires the stage reference, put this in your constructor:</p>
<p>Constructor(){<br />
if (stage){<br />
onAddedToStage();<br />
} else {<br />
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);<br />
}<br />
}</p>
<p>private function onAddedToStage(evt:Event=null):void {<br />
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);<br />
stage.align = StageAlign.TOP_LEFT;<br />
stage.scaleMode = StageScaleMode.NO_SCALE;<br />
initApp();<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/08/13/why-some-as3-swfs-work-stand-alone-but-fail-to-load-into-other-swfs/feed/</wfw:commentRss>
		</item>
		<item>
		<title>handy way of removing event listeners via arguments.callee</title>
		<link>http://www.markledford.com/blog/2008/08/09/handy-way-of-removing-event-listeners-via-argumentscallee/</link>
		<comments>http://www.markledford.com/blog/2008/08/09/handy-way-of-removing-event-listeners-via-argumentscallee/#comments</comments>
		<pubDate>Sun, 10 Aug 2008 05:04:36 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[actionscript]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/2008/08/09/handy-way-of-removing-event-listeners-via-argumentscallee/</guid>
		<description><![CDATA[Theo&#8217;s entry reminded me how useful this can be especially when using an anonymous function as a one time callback. Try it out:
stage.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event):void { event.currentTarget.removeEventListener(event.type, arguments.callee); trace(&#8217;ran once&#8217;); });
FYI you should always use event.currentTarget and not event.target when removing a mouse event listener because event.currentTarget will always reference the object that the listener was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.iconara.net/2007/11/05/a-generic-way-to-remove-an-event-listener/" target="_blank">Theo&#8217;s entry</a> reminded me how useful this can be especially when using an anonymous function as a one time callback. Try it out:</p>
<p>stage.addEventListener(MouseEvent.MOUSE_DOWN, function(event:Event):void { event.currentTarget.removeEventListener(event.type, arguments.callee); trace(&#8217;ran once&#8217;); });</p>
<p>FYI you should always use event.currentTarget and not event.target when removing a mouse event listener because event.currentTarget will always reference the object that the listener was explicitly attached to. event.target can easily reference a different object like a child displayObject inside the displayObject you were listening for a bubbling event on.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/08/09/handy-way-of-removing-event-listeners-via-argumentscallee/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fix for when Flex and your debug flash player won&#8217;t connect for a debug session</title>
		<link>http://www.markledford.com/blog/2008/08/06/fix-for-when-flex-and-your-debug-flash-player-wont-connect-for-a-debug-session/</link>
		<comments>http://www.markledford.com/blog/2008/08/06/fix-for-when-flex-and-your-debug-flash-player-wont-connect-for-a-debug-session/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 04:16:24 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=19</guid>
		<description><![CDATA[Luckily this guy wasted hours finding a fix to this strange issue so I didn&#8217;t have to. Right click on the swf and click on &#8220;debugger&#8221; in the flash context menu (if the &#8220;Where is the debugger or host application running?&#8221; pop up isn&#8217;t already open). Select the &#8220;Other Machine&#8221; radio box button and type [...]]]></description>
			<content:encoded><![CDATA[<p>Luckily <a href="http://therush.wordpress.com/2008/03/11/resolved-flex-builder-3-debugger-stopped-working/" target="_blank">this guy wasted hours finding a fix to this strange issue</a> so I didn&#8217;t have to. Right click on the swf and click on &#8220;debugger&#8221; in the flash context menu (if the &#8220;Where is the debugger or host application running?&#8221; pop up isn&#8217;t already open). Select the &#8220;Other Machine&#8221; radio box button and type in &#8220;127.0.0.1&#8243;.Â  Voila. Why does this work when &#8220;localhost&#8221; was already selected by default? No idea but i&#8217;ll be getting something done tonight. Thank you guy and your blog.</p>
<p>If this doesn&#8217;tÂ  solve your issue and your using Firefox 3 check out <a href="http://bugs.adobe.com/jira/browse/FB-13064" target="_blank">this Jira</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/08/06/fix-for-when-flex-and-your-debug-flash-player-wont-connect-for-a-debug-session/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to launch Flex debug session via keyboard shortcut on mac (part deux)</title>
		<link>http://www.markledford.com/blog/2008/07/30/how-to-launch-flex-debug-session-via-keyboard-shortcut-on-mac-part-deux/</link>
		<comments>http://www.markledford.com/blog/2008/07/30/how-to-launch-flex-debug-session-via-keyboard-shortcut-on-mac-part-deux/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 16:40:28 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=18</guid>
		<description><![CDATA[So continuing on this post I took a gander at Flex > Preferences > Keys to get my command-f11 key working&#8230; with success! Under the list of keyboard shortcuts about halfway down the &#8220;>Category]]></description>
			<content:encoded><![CDATA[<p>So continuing on <a href="http://www.markledford.com/blog/?p=17">this post</a> I took a gander at Flex > Preferences > Keys to get my command-f11 key working&#8230; with success! Under the list of keyboard shortcuts about halfway down the &#8220;>Category<&#8221; column is Run/Debug. The command &#8220;Run Last Launched&#8221; is mapped to Command-F11 as it should be but under the &#8220;When&#8221; column it is set to &#8220;In Windows&#8221;. Not sure what all &#8220;In Windows&#8221; entails but I edited this shortcut adding a new &#8220;When&#8221; to this shortcut found under the drop down list called &#8220;Editing Flex Source&#8221; and bam, functional command-f11. Sure beats the kung-fu move of a keyboard shortcut mentioned in my last entry.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/07/30/how-to-launch-flex-debug-session-via-keyboard-shortcut-on-mac-part-deux/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to launch Flex debug session via keyboard shortcut on mac</title>
		<link>http://www.markledford.com/blog/2008/07/29/how-to-launch-flex-debug-session-via-keyboard-shortcut-on-mac/</link>
		<comments>http://www.markledford.com/blog/2008/07/29/how-to-launch-flex-debug-session-via-keyboard-shortcut-on-mac/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 05:38:32 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=17</guid>
		<description><![CDATA[Â 
OMG. For over 2 years I&#8217;ve launched Flex by mousing over to the little bug icon and clicking. I&#8217;ve done it so often its become second nature. All because I took one look at this cryptic glyph sequence, tried to guess..tecute it, then gave up to pretend this shortcut didn&#8217;t exist.
After a brief stint back [...]]]></description>
			<content:encoded><![CDATA[<p>Â <img src="http://markledford.com/bloghost/flexshortcut.png" /><br />
OMG. For over 2 years I&#8217;ve launched Flex by mousing over to the little bug icon and clicking. I&#8217;ve done it so often its become second nature. All because I took one look at this cryptic glyph sequence, tried to guess..tecute it, then gave up to pretend this shortcut didn&#8217;t exist.</p>
<p>After a brief stint back in the Flash IDE&#8211;instantly returnign to hitting command-enter to debug, I came back to Flex with the determination to slay this gnarly shortcut sequence once and for all. And here&#8217;s the secret:</p>
<p>That up arrow icon is shift.Â  Thats an easy one. The bizzare serif-X-with-one-leg-missing glyph represents alt/option. Yeah I don&#8217;t understand that either. Then there&#8217;s the letter &#8220;D&#8221; and &#8220;F&#8221;. Naturally, hitting all 4 together does nothing. But wait, see the slight excess kerning between those 2 letters? Thats a space. It means let go of the current key combination before hitting the next letter. And there it goes.</p>
<p>Why 4 keys in 2 combinations just to debug your project? Seams a little absurd for one of the most important and common shortcuts. Is every other normal key combination really taken? Really? I&#8217;m using the Eclipse plugin version of Flex btw, but I assume its the same with the stand alone.</p>
<p>Did anyone else have trouble with this? Don&#8217;t make me feel stupid and annoyed all by myself :P</p>
<p>UPDATE: Figured out how to get the more straight forward command-f11 shortcut working <a href="http://www.markledford.com/blog/?p=18">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/07/29/how-to-launch-flex-debug-session-via-keyboard-shortcut-on-mac/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Serious (and seriously obscure) bug with flash embed code redirects and variables in IE</title>
		<link>http://www.markledford.com/blog/2008/07/24/serious-and-seriously-obscure-bug-with-flash-embed-code-variables-and-ie/</link>
		<comments>http://www.markledford.com/blog/2008/07/24/serious-and-seriously-obscure-bug-with-flash-embed-code-variables-and-ie/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 18:27:51 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=16</guid>
		<description><![CDATA[Haven&#8217;t been posting too frequently, been pretty busy at KickApps working on the Widget Studio. I&#8217;d like to write about it in another entry at another time but for now I&#8217;d like to help expose a pretty vicious bug we&#8217;ve encountered during the course of developing this app.
The Widget Studio is a Flex based WYSIWYG [...]]]></description>
			<content:encoded><![CDATA[<p>Haven&#8217;t been posting too frequently, been pretty busy at <a href="http://kickapps.com">KickApps</a> working on the <a href="http://affiliate.kickapps.com/kickapps/widget/displayManageFeed.kickAction?nav=WB#/widget_manager/">Widget Studio</a>. I&#8217;d like to write about it in another entry at another time but for now I&#8217;d like to help expose a pretty vicious bug we&#8217;ve encountered during the course of developing this app.</p>
<p>The Widget Studio is a Flex based WYSIWYG widget generator who&#8217;s end product is embed code for widgets. The embed src points to a server side redirect that returns our main SWF file with some variables appended to it. These variables have to be dynamic to pass things like the build version number (cache control) and refferal url to the swf. After much debugging we realized if querystring variables are appended to the redirect in &lt;embed src=&#8221;"/&gt; then variables attached to the swf from inside the redirect do not get passed to the SWF in IE.Â  After much googling, these are the only 2 entries we could find on the matter:</p>
<p><a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2245594&amp;SiteID=1" target="_blank">MSDN forum post</a><br />
<a href="http://www.jeroenwijering.com/?thread=11441" target="_blank">JW Player (?) forum post</a></p>
<p>If both appended-to-redirect and inside-redirect variables are neccessary, the only viable answer is a rest style architecture to pass variables to your SWF (assuming, like in our case, the appended-to-redirect variables can&#8217;t be moved to flashVars as they are used by the redirect script itself)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/07/24/serious-and-seriously-obscure-bug-with-flash-embed-code-variables-and-ie/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Event.INIT and Event.COMPLETE don&#8217;t fire when loading an unpacked swc</title>
		<link>http://www.markledford.com/blog/2008/07/24/eventinit-and-eventcomplete-dont-fire-when-loading-an-unpacked-swc/</link>
		<comments>http://www.markledford.com/blog/2008/07/24/eventinit-and-eventcomplete-dont-fire-when-loading-an-unpacked-swc/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 18:01:13 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=12</guid>
		<description><![CDATA[Cleaning out the wordpress there were a few posts I hadn&#8217;t finished. This one is mainly a for-future-reference for myself.
I&#8217;ve been doing some run-time class loading involving loading SWF files into the same ApplicationDomain as the container via Loader then using getDefinitionByName to access new instances of the loaded classes. I was perplexed that the [...]]]></description>
			<content:encoded><![CDATA[<p>Cleaning out the wordpress there were a few posts I hadn&#8217;t finished. This one is mainly a for-future-reference for myself.</p>
<p>I&#8217;ve been doing some run-time class loading involving loading SWF files into the same ApplicationDomain as the container via Loader then using getDefinitionByName to access new instances of the loaded classes. I was perplexed that the INIT and COMPLETE events weren&#8217;t being dispatched and found some info <a href="http://blog.andre-michelle.com/2007/generate-accessible-swf-does-not-generate-a-swf/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/07/24/eventinit-and-eventcomplete-dont-fire-when-loading-an-unpacked-swc/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SecurityError: Error #2000: No active security context.</title>
		<link>http://www.markledford.com/blog/2008/07/24/securityerror-error-2000-no-active-security-context/</link>
		<comments>http://www.markledford.com/blog/2008/07/24/securityerror-error-2000-no-active-security-context/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 17:51:01 +0000</pubDate>
		<dc:creator>markledford</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[actionscript]]></category>

		<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://www.markledford.com/blog/?p=15</guid>
		<description><![CDATA[Always interesting to throw an error that has only 4 obscure results in google.
Using setTimeout with navigateToURL:
var urlRequest:URLRequest = new URLRequest(&#8221;http://google.com&#8221;);
setTimeout(navigateToURL, 1000, urlRequest, &#8220;_blank&#8221;);
Generates:
SecurityError: Error #2000: No active security context.
at global/flash.net::navigateToURL()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at &#60;anonymous&#62;()
at SetIntervalTimer/onTimer()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
A work around is to wrap the call in an anonymous function:
setTimeout(function():void { navigateToURL(urlRequest, &#8220;_blank&#8221;); }, 1000);
]]></description>
			<content:encoded><![CDATA[<p>Always interesting to throw an error that has only 4 obscure results in google.<br />
Using setTimeout with navigateToURL:<br />
var urlRequest:URLRequest = new URLRequest(&#8221;http://google.com&#8221;);<br />
setTimeout(navigateToURL, 1000, urlRequest, &#8220;_blank&#8221;);</p>
<p>Generates:<br />
SecurityError: Error #2000: No active security context.<br />
at global/flash.net::navigateToURL()<br />
at Function/http://adobe.com/AS3/2006/builtin::apply()<br />
at &lt;anonymous&gt;()<br />
at SetIntervalTimer/onTimer()<br />
at flash.utils::Timer/_timerDispatch()<br />
at flash.utils::Timer/tick()</p>
<p>A work around is to wrap the call in an anonymous function:<br />
setTimeout(function():void { navigateToURL(urlRequest, &#8220;_blank&#8221;); }, 1000);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markledford.com/blog/2008/07/24/securityerror-error-2000-no-active-security-context/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
