

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Unexpected &#8220;Gotcha&#8221; with Relative Paths in ActionScript</title>
	<atom:link href="http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript/feed" rel="self" type="application/rss+xml" />
	<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript</link>
	<description>Luck is the residue of good design.</description>
	<lastBuildDate>Tue, 20 Mar 2012 15:33:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-380299</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Wed, 08 Apr 2009 13:19:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-380299</guid>
		<description>Ezra,

Glad it&#039;s working for you!  w00t!</description>
		<content:encoded><![CDATA[<p>Ezra,</p>
<p>Glad it&#8217;s working for you!  w00t!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ezra</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-380098</link>
		<dc:creator>Ezra</dc:creator>
		<pubDate>Wed, 08 Apr 2009 02:06:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-380098</guid>
		<description>Hey David,

Thanks for this post. I had been scratching my head for some time trying to fix an xml based videoPlayer. I had a single video working with a relative path to the swf. With the multi-video version, I was referencing the xml compared to the swf rather than the html. I updated things to the html and presto. 

In this case, the video paths defined in the xml have to be relative to the swf. There is a seeming contradiction at first, but then the xml is simply strings for the swf to play with in it&#039;s own relative world.</description>
		<content:encoded><![CDATA[<p>Hey David,</p>
<p>Thanks for this post. I had been scratching my head for some time trying to fix an xml based videoPlayer. I had a single video working with a relative path to the swf. With the multi-video version, I was referencing the xml compared to the swf rather than the html. I updated things to the html and presto. </p>
<p>In this case, the video paths defined in the xml have to be relative to the swf. There is a seeming contradiction at first, but then the xml is simply strings for the swf to play with in it&#8217;s own relative world.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dana Jones</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-109688</link>
		<dc:creator>Dana Jones</dc:creator>
		<pubDate>Fri, 07 Dec 2007 20:52:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-109688</guid>
		<description>David:

Thanks SO MUCH for your insight into this problem. We’ll also check out ZINC and Jugglor, for additional functionality of the Projector.

Best Regards,

Dana</description>
		<content:encoded><![CDATA[<p>David:</p>
<p>Thanks SO MUCH for your insight into this problem. We’ll also check out ZINC and Jugglor, for additional functionality of the Projector.</p>
<p>Best Regards,</p>
<p>Dana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-109621</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Fri, 07 Dec 2007 14:13:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-109621</guid>
		<description>&lt;strong&gt;To Mechthild ...&lt;/strong&gt;

By your original description, it certainly sounds to me as if you had done everything right.  In any case, I&#039;m glad to hear you resolved the issue!  Ultimately, I think you&#039;ll be happier with this closer control over the video.  And like you said, the visual design is now yours.  :)

Thanks for sharing those links, too!

&lt;strong&gt;To Dana ...&lt;/strong&gt;

The Projector is indeed the parent, or the base of your file references.  Obviously, you can&#039;t use the Debugger panel when you&#039;re testing a Projector (which is too bad!), but you can still arrange for something akin to &lt;code&gt;trace()&lt;/code&gt; statements in your Projectors.  In a case like this, you could put a dynamic text field somewhere on the Stage for testing purposes.  Give it an instance name, say &lt;code&gt;debugger&lt;/code&gt;.  In your keyframe code, add the following line:

&lt;pre&gt;&lt;code&gt;debugger.text = this._url;&lt;/code&gt;&lt;/pre&gt;

... which invokes &lt;code&gt;MovieClip._url&lt;/code&gt; on the main timeline (assuming that&#039;s where your code is) and sends the return value to the text field.  That will show you where the SWF believes itself to be, and if your experience is like mine, you&#039;ll see a file reference directly to the EXE.

That aside, if you&#039;re distributing this as a professional product, you may want to consider a 3rd party Projector enhancer like &lt;a href=&quot;http://www.multidmedia.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;ZINC&lt;/a&gt; or &lt;a href=&quot;http://www.flashjester.com/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;Jugglor&lt;/a&gt;.  Not only with those allow you to customize the appearance of the executable, they&#039;ll also give you system level functionality you can&#039;t get with a native Projector alone.</description>
		<content:encoded><![CDATA[<p><strong>To Mechthild &#8230;</strong></p>
<p>By your original description, it certainly sounds to me as if you had done everything right.  In any case, I&#8217;m glad to hear you resolved the issue!  Ultimately, I think you&#8217;ll be happier with this closer control over the video.  And like you said, the visual design is now yours.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thanks for sharing those links, too!</p>
<p><strong>To Dana &#8230;</strong></p>
<p>The Projector is indeed the parent, or the base of your file references.  Obviously, you can&#8217;t use the Debugger panel when you&#8217;re testing a Projector (which is too bad!), but you can still arrange for something akin to <code>trace()</code> statements in your Projectors.  In a case like this, you could put a dynamic text field somewhere on the Stage for testing purposes.  Give it an instance name, say <code>debugger</code>.  In your keyframe code, add the following line:</p>
<pre><code>debugger.text = this._url;</code></pre>
<p>&#8230; which invokes <code>MovieClip._url</code> on the main timeline (assuming that&#8217;s where your code is) and sends the return value to the text field.  That will show you where the SWF believes itself to be, and if your experience is like mine, you&#8217;ll see a file reference directly to the EXE.</p>
<p>That aside, if you&#8217;re distributing this as a professional product, you may want to consider a 3rd party Projector enhancer like <a href="http://www.multidmedia.com/" target="_blank" rel="nofollow">ZINC</a> or <a href="http://www.flashjester.com/" target="_blank" rel="nofollow">Jugglor</a>.  Not only with those allow you to customize the appearance of the executable, they&#8217;ll also give you system level functionality you can&#8217;t get with a native Projector alone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mechthild Scheierling</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-108832</link>
		<dc:creator>Mechthild Scheierling</dc:creator>
		<pubDate>Wed, 05 Dec 2007 08:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-108832</guid>
		<description>My solution to the &quot;Mozilla-doesn&#039;t-play&quot; phenomenon was to cancel using the FLVPlayback componet.
Decided to use NetStream with my own controls. 

The vid_player from Datic was a good starting-point.
Found it at tutorials.de:
http://www.tutorials.de/forum/flash-faq/180861-sammel-thread-und-flash-faq-2.html
This is the ZIP-File with fla and swf:
http://www.tutorials.de/forum/attachments/flash-faq/16585d1117140120-vid_player.zip

Now everything works fine. And I like my own design...

Mechthild</description>
		<content:encoded><![CDATA[<p>My solution to the &quot;Mozilla-doesn&#8217;t-play&quot; phenomenon was to cancel using the FLVPlayback componet.<br />
Decided to use NetStream with my own controls. </p>
<p>The vid_player from Datic was a good starting-point.<br />
Found it at tutorials.de:<br />
<a href="http://www.tutorials.de/forum/flash-faq/180861-sammel-thread-und-flash-faq-2.html" rel="nofollow">http://www.tutorials.de/forum/flash-faq/180861-sammel-thread-und-flash-faq-2.html</a><br />
This is the ZIP-File with fla and swf:<br />
<a href="http://www.tutorials.de/forum/attachments/flash-faq/16585d1117140120-vid_player.zip" rel="nofollow">http://www.tutorials.de/forum/attachments/flash-faq/16585d1117140120-vid_player.zip</a></p>
<p>Now everything works fine. And I like my own design&#8230;</p>
<p>Mechthild</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dana Jones</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-107711</link>
		<dc:creator>Dana Jones</dc:creator>
		<pubDate>Sat, 01 Dec 2007 01:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-107711</guid>
		<description>Hi David:
Great topic. We&#039;re suffering a similar problem as those who have written here. We have a projector file running on a local machine. It calls an outside swf running on our CDN. That swf calls an .flv residing in the same folder as that swf on the CDN. The flv won&#039;t load/play. There are no HTML containers anywhere along the path. We&#039;ve tried absolute paths and relative paths. No luck.

The projector is the parent file, right? Then how do we reference the projector file locale from the outside swf that&#039;s calling the .flv?

We are distributing a P2P product that will be a projector. It will call swfs that will call flvs. Thoughts?

--Dana</description>
		<content:encoded><![CDATA[<p>Hi David:<br />
Great topic. We&#8217;re suffering a similar problem as those who have written here. We have a projector file running on a local machine. It calls an outside swf running on our CDN. That swf calls an .flv residing in the same folder as that swf on the CDN. The flv won&#8217;t load/play. There are no HTML containers anywhere along the path. We&#8217;ve tried absolute paths and relative paths. No luck.</p>
<p>The projector is the parent file, right? Then how do we reference the projector file locale from the outside swf that&#8217;s calling the .flv?</p>
<p>We are distributing a P2P product that will be a projector. It will call swfs that will call flvs. Thoughts?</p>
<p>&#8211;Dana</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mechthild Scheierling</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-99334</link>
		<dc:creator>Mechthild Scheierling</dc:creator>
		<pubDate>Sat, 10 Nov 2007 15:57:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-99334</guid>
		<description>Hi David,

I encounter an ugly phenomenon with Mozilla and relative paths.

The files are located in separate paths for html and flash related files:

webroot/html/showvideo.html

webroot/flash/player.swf
webroot/flash/skin.swf
webroot/flash/video.flv

So I embed 
* player.swf relative to the .html
* skin.swf relative to the .html 
* video.flv relative to the player.swf

This works fine as long as showvideo.html is opened locally in Mozilla.
When I open it via a host (webserver or localhost) it&#039;s going weird:
Opening the file the first time (after clearing the cache) everything is ok. 
But when opening again or pressing &#039;Refresh&#039; or opening showanothervidedo.html to see anothervideo.flv there is no video and no skin displayed.
Even worse: Trying to see another video (video2.flv) with another player (player2.swf) and another skin (skin2.swf) from another html (showvideo2.html) on the same host fails.

To be true: I can see the skin for about a second, then it disappears into empty space.
To be completely true: sometimes the first picture of the video is shown.

The player.swf IS loaded (displaying some text).

Any idea what&#039;s going wrong there?

Maybe I have to set some -parameters I&#039;ve never heard of?
But why does it work once an then nevermore? Sometimes even clearing the cache doesn&#039;t help.
Something wrong with the Flash-Plugin?
Because in InternetExplorer everything is fine. Only Firefox and Iceweasels do that!

It&#039;s really the relativity - when all files are in the same directory there is no problem..,

I&#039;m completely at a loss.

Mechthild</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>I encounter an ugly phenomenon with Mozilla and relative paths.</p>
<p>The files are located in separate paths for html and flash related files:</p>
<p>webroot/html/showvideo.html</p>
<p>webroot/flash/player.swf<br />
webroot/flash/skin.swf<br />
webroot/flash/video.flv</p>
<p>So I embed<br />
* player.swf relative to the .html<br />
* skin.swf relative to the .html<br />
* video.flv relative to the player.swf</p>
<p>This works fine as long as showvideo.html is opened locally in Mozilla.<br />
When I open it via a host (webserver or localhost) it&#8217;s going weird:<br />
Opening the file the first time (after clearing the cache) everything is ok.<br />
But when opening again or pressing &#8216;Refresh&#8217; or opening showanothervidedo.html to see anothervideo.flv there is no video and no skin displayed.<br />
Even worse: Trying to see another video (video2.flv) with another player (player2.swf) and another skin (skin2.swf) from another html (showvideo2.html) on the same host fails.</p>
<p>To be true: I can see the skin for about a second, then it disappears into empty space.<br />
To be completely true: sometimes the first picture of the video is shown.</p>
<p>The player.swf IS loaded (displaying some text).</p>
<p>Any idea what&#8217;s going wrong there?</p>
<p>Maybe I have to set some -parameters I&#8217;ve never heard of?<br />
But why does it work once an then nevermore? Sometimes even clearing the cache doesn&#8217;t help.<br />
Something wrong with the Flash-Plugin?<br />
Because in InternetExplorer everything is fine. Only Firefox and Iceweasels do that!</p>
<p>It&#8217;s really the relativity &#8211; when all files are in the same directory there is no problem..,</p>
<p>I&#8217;m completely at a loss.</p>
<p>Mechthild</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-94739</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Sun, 28 Oct 2007 02:28:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-94739</guid>
		<description>Brian,

Either use &quot;../CommonScripts/images.xml&quot; or simply &quot;/CommonScripts/images.xml&quot;, as the slash alone (preceding any path) should send the point of view to the root.

In the first case, the SWF effectively says, &quot;Okay, I am where my HTML page is, so that means I&#039;m in the &#039;en&#039; folder.  Let me back up one folder &#8212; now I&#039;m in the root &#8212; and look for a folder named &#039;CommonScripts,&#039; then a file named &#039;images.xml.&#039;&quot;

In the second case, the SWF says, &quot;Let me go straight to the root and look for a folder named &#039;CommonScripts,&#039; then a file named &#039;images.xml.&#039;&quot;</description>
		<content:encoded><![CDATA[<p>Brian,</p>
<p>Either use &#8220;../CommonScripts/images.xml&#8221; or simply &#8220;/CommonScripts/images.xml&#8221;, as the slash alone (preceding any path) should send the point of view to the root.</p>
<p>In the first case, the SWF effectively says, &#8220;Okay, I am where my HTML page is, so that means I&#8217;m in the &#8216;en&#8217; folder.  Let me back up one folder &mdash; now I&#8217;m in the root &mdash; and look for a folder named &#8216;CommonScripts,&#8217; then a file named &#8216;images.xml.&#8217;&#8221;</p>
<p>In the second case, the SWF says, &#8220;Let me go straight to the root and look for a folder named &#8216;CommonScripts,&#8217; then a file named &#8216;images.xml.&#8217;&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Artka</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-93794</link>
		<dc:creator>Brian Artka</dc:creator>
		<pubDate>Thu, 25 Oct 2007 15:39:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-93794</guid>
		<description>Hi David,

Wow, thanks for the quick response.

actually, here is the file structure:

the index.html file, which calls the .swf file is located here:

/en/index.html

the swf file is located here:

/CommonScripts/myflash.swf

the images.xml and images folder are located here:

/CommonScripts/

right now the actionscript in the swf is &quot;images.xml&quot; and I understand that since the swf loads from the index.html, the &quot;images.xml&quot; means it looks in the 

/en/

folder since that is relative to the html file.

what the heck do I put in there to reference the images.xml from the CommonScripts folder.</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>Wow, thanks for the quick response.</p>
<p>actually, here is the file structure:</p>
<p>the index.html file, which calls the .swf file is located here:</p>
<p>/en/index.html</p>
<p>the swf file is located here:</p>
<p>/CommonScripts/myflash.swf</p>
<p>the images.xml and images folder are located here:</p>
<p>/CommonScripts/</p>
<p>right now the actionscript in the swf is &#8220;images.xml&#8221; and I understand that since the swf loads from the index.html, the &#8220;images.xml&#8221; means it looks in the </p>
<p>/en/</p>
<p>folder since that is relative to the html file.</p>
<p>what the heck do I put in there to reference the images.xml from the CommonScripts folder.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-93786</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Thu, 25 Oct 2007 15:23:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/unexpected-gotcha-with-relative-paths-in-actionscript#comment-93786</guid>
		<description>Brian,

It sounds to me like your site has a swf folder and an images folder.  I&#039;m guessing your HTML files are in the root, and they references images like this:

images/someImage.jpg

... and SWFs like this:

swf/someSwf.swf

If that&#039;s right, then from your SWF&#039;s point of view, the XML document is here:

../images/images.xml

But that&#039;s not how Flash works.  The SWF takes its point of view from the HTML document that contains it.  If I&#039;ve correctly described the arrangement of your files, that would mean you&#039;d drop the &quot;../&quot; in this case.  The only exception to &quot;the SWF&#039;s point of view is actually the HTML&#039;s point of view&quot; is when the SWF is loading FLV files.</description>
		<content:encoded><![CDATA[<p>Brian,</p>
<p>It sounds to me like your site has a swf folder and an images folder.  I&#8217;m guessing your HTML files are in the root, and they references images like this:</p>
<p>images/someImage.jpg</p>
<p>&#8230; and SWFs like this:</p>
<p>swf/someSwf.swf</p>
<p>If that&#8217;s right, then from your SWF&#8217;s point of view, the XML document is here:</p>
<p>../images/images.xml</p>
<p>But that&#8217;s not how Flash works.  The SWF takes its point of view from the HTML document that contains it.  If I&#8217;ve correctly described the arrangement of your files, that would mean you&#8217;d drop the &#8220;../&#8221; in this case.  The only exception to &#8220;the SWF&#8217;s point of view is actually the HTML&#8217;s point of view&#8221; is when the SWF is loading FLV files.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

