<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: How to Tell a SWF What File(s) to Load &#8212; From the Outside</title>
	<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Sat, 11 Oct 2008 14:17:42 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: alex</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-278655</link>
		<pubDate>Thu, 25 Sep 2008 01:31:53 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-278655</guid>
					<description>Ok this may not be related to the topic. But you seems to know stuff...so i ask a basic question on problem i am facing.

I am using FLVplayback for playing video. 

When i assign 
//display is flvplayback instance.
display.source=&quot;http://localhost:81/media/teaser.flv&quot; 
it works. 
But when i make it streamable using the following statement it do not like it. It does not like ? in the URL.
display.source=&quot;http://localhost:81/media/flvprovider.php?flie-teaser.flv&quot;;

There are two issues here. One it expects flv extension for source.
two it does not like ? in the url.

it throws this error.
VideoError: 1005: Invalid xml: URL: &quot;http://localhost:81/media/flvprovider.php?file=teaser.flv&amp;#38;FLVPlaybackVersion=2.0&quot; No root node found; if url is for an flv it must have .flv extension and take no parameters

If you can solve this...you solve many people problem in the whole world. 

thanks in advance.</description>
		<content:encoded><![CDATA[<p>Ok this may not be related to the topic. But you seems to know stuff&#8230;so i ask a basic question on problem i am facing.</p>
<p>I am using FLVplayback for playing video. </p>
<p>When i assign<br />
//display is flvplayback instance.<br />
display.source=&#8221;http://localhost:81/media/teaser.flv&#8221;<br />
it works.<br />
But when i make it streamable using the following statement it do not like it. It does not like ? in the URL.<br />
display.source=&#8221;http://localhost:81/media/flvprovider.php?flie-teaser.flv&#8221;;</p>
<p>There are two issues here. One it expects flv extension for source.<br />
two it does not like ? in the url.</p>
<p>it throws this error.<br />
VideoError: 1005: Invalid xml: URL: &#8220;http://localhost:81/media/flvprovider.php?file=teaser.flv&amp;FLVPlaybackVersion=2.0&#8243; No root node found; if url is for an flv it must have .flv extension and take no parameters</p>
<p>If you can solve this&#8230;you solve many people problem in the whole world. </p>
<p>thanks in advance.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-275322</link>
		<pubDate>Thu, 18 Sep 2008 18:57:35 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-275322</guid>
					<description>&lt;strong&gt;To Kelley ...&lt;/strong&gt;

Sorry for the late reply!  Sounds like you found a solution, though, and that's the most important part.  Glad to hear it!  :)

&lt;strong&gt;To Richard ...&lt;/strong&gt;

You nailed it:  FlashVars feed in their values at the time the SWF loads, and not afterward.  If you want to pass values into (or out of) the SWF after it loads, use either the &lt;code&gt;LoadVars&lt;/code&gt; class or &amp;#8212; probably better suited to this scenario &amp;#8212; the &lt;code&gt;ExternalInterface&lt;/code&gt; class.  &lt;code&gt;ExternalInterface&lt;/code&gt; lets you call functions inside the SWF from outside code (i.e., JavaScript).  You can pass in parameters, too, so set up some &quot;receiver functions in your FLA and call those with JavaScript.</description>
		<content:encoded><![CDATA[<p><strong>To Kelley &#8230;</strong></p>
<p>Sorry for the late reply!  Sounds like you found a solution, though, and that&#8217;s the most important part.  Glad to hear it!  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>To Richard &#8230;</strong></p>
<p>You nailed it:  FlashVars feed in their values at the time the SWF loads, and not afterward.  If you want to pass values into (or out of) the SWF after it loads, use either the <code>LoadVars</code> class or &mdash; probably better suited to this scenario &mdash; the <code>ExternalInterface</code> class.  <code>ExternalInterface</code> lets you call functions inside the SWF from outside code (i.e., JavaScript).  You can pass in parameters, too, so set up some &#8220;receiver functions in your FLA and call those with JavaScript.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Richard</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-275315</link>
		<pubDate>Thu, 18 Sep 2008 18:49:21 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-275315</guid>
					<description>Hi, David

Have you tried to change Flashvar on the a fly? I tried, something like after clicking a HTML button, changed the Flashvar value, but somehow, Flash still read the original value of Flashvar? Any suggestion? Thanks.

//------ my code, it shows the new value of Aname, but Flash always reads the value in embed tag --//

</description>
		<content:encoded><![CDATA[<p>Hi, David</p>
<p>Have you tried to change Flashvar on the a fly? I tried, something like after clicking a HTML button, changed the Flashvar value, but somehow, Flash still read the original value of Flashvar? Any suggestion? Thanks.</p>
<p>//&#8212;&#8212; my code, it shows the new value of Aname, but Flash always reads the value in embed tag &#8211;//
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kelley</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-242236</link>
		<pubDate>Wed, 06 Aug 2008 18:18:08 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-242236</guid>
					<description>David 

Okay, I found the solution online elsewhere, and it is a lot more simple than I expected:  

&lt;pre&gt;&lt;code&gt;//------create scrollbar----------\\
this.createClassObject(mx.controls.UIScrollBar, &amp;#34;my_sb&amp;#34;, 20);
my_sb.setScrollTarget(loadedInfo);
my_sb.setSize(12, loadedInfo._height);
my_sb.move(loadedInfo._x + loadedInfo._width, loadedInfo._y);

//----set scroll default to top-----\\
if (my_sb._y&lt;=top)
my_sb._y = top;&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>David </p>
<p>Okay, I found the solution online elsewhere, and it is a lot more simple than I expected:  </p>
<pre><code>//------create scrollbar----------\
this.createClassObject(mx.controls.UIScrollBar, &quot;my_sb&quot;, 20);
my_sb.setScrollTarget(loadedInfo);
my_sb.setSize(12, loadedInfo._height);
my_sb.move(loadedInfo._x + loadedInfo._width, loadedInfo._y);

//----set scroll default to top-----\
if (my_sb._y<=top)
my_sb._y = top;</code></pre>
]]></content:encoded>
				</item>
	<item>
		<title>by: Kelley</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-232217</link>
		<pubDate>Mon, 28 Jul 2008 14:10:37 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-232217</guid>
					<description>David

You've been a major source of help in the past, I am hoping you can give me some advice on a new project:

I searched your site for anything on COMPONENTS or SCROLLBAR, and found nothing - forigve me if I am posting in an inaccurate area of your site or if perhaps I have overlooked any postings on this subject matter.

I am utilizing Flash VARS, loading .txt files into a dynamic text box to which I have added a scrollbar from components.  It is working well, however I noticed that when I move from one area of my site to another, the scrollbar does not reset itself in a 'default' position each time a different text file is loaded. I have narration audio loading on each external SWF; the text box loads the text form of the narrative for those who either do not have speakers or are hearing impared.   

I have several frames on a main timeline, and on each individual frame I have an external SWF file loading into the main (index.swf) SWF; the textbox is located on the index.swf.  

On the index.swf file, in the first frame to load a text file, I have this code for the scrollbar:

----------------------------------------------------------------------------
this.createTextField(&quot;my_txt&quot;, 10, 10, 20, 200, 100);
loadedInfo.wordWrap = true;

this.createClassObject(mx.controls.UIScrollBar, &quot;my_sb&quot;, 20);

// Set the target text field.
my_sb.setScrollTarget(loadedInfo);

// Size it to match the text field.
my_sb.setSize(12, loadedInfo._height); 

// Move it next to the text field.
my_sb.move(loadedInfo._x + loadedInfo._width, loadedInfo._y);

-----------------------------------------------------------------------------

Each individual external SWF is coded like this on it's last frame:

-----------------------------------------------------------------------------

onEnterFrame = gotoAndStop(_level0.nextFrame()) 

-----------------------------------------------------------------------------

This moves the program to the next frame, which loads the next external SWF and the text for the text box -

The code for each frame on the index.swf is: 

-----------------------------------------------------------------------------

stop();
unloadMovieNum(5);
onEnterFrame = _root.myMCL.loadClip(&quot;assets/SWFs/fileName.swf&quot;, 5);

// Load text to display and define onData handler.
var my_lv:LoadVars = new LoadVars();
my_lv.onData = function(src:String) {
    if (src != undefined) {
        loadedInfo.text = src;
    } else {
        loadedInfo.text = &quot;Error loading text.&quot;;
    }
};

my_lv.load(&quot;assets/vars/fileName.txt&quot;);

--------------------------------------------------------------------------------

This loads the appropriate text file into the text box, which corrosponds to the external SWF file currently playing.  

Basically, I want the scrollbar to reset to the top of the text file each time a new text file is loaded - at present, when the scrollbar is utilized to read the loaded text, it remains at the bottom of the text file when a new file is loaded into the dynamic text box, (so that the user is reading the last line of the text file instead of the first line).  The user has to manually scroll up in order to read the first line of the text file.  

Is there a simple way to set a default for the scrollbar to reset to the top of the text file each time a new file is loaded?</description>
		<content:encoded><![CDATA[<p>David</p>
<p>You&#8217;ve been a major source of help in the past, I am hoping you can give me some advice on a new project:</p>
<p>I searched your site for anything on COMPONENTS or SCROLLBAR, and found nothing - forigve me if I am posting in an inaccurate area of your site or if perhaps I have overlooked any postings on this subject matter.</p>
<p>I am utilizing Flash VARS, loading .txt files into a dynamic text box to which I have added a scrollbar from components.  It is working well, however I noticed that when I move from one area of my site to another, the scrollbar does not reset itself in a &#8216;default&#8217; position each time a different text file is loaded. I have narration audio loading on each external SWF; the text box loads the text form of the narrative for those who either do not have speakers or are hearing impared.   </p>
<p>I have several frames on a main timeline, and on each individual frame I have an external SWF file loading into the main (index.swf) SWF; the textbox is located on the index.swf.  </p>
<p>On the index.swf file, in the first frame to load a text file, I have this code for the scrollbar:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
this.createTextField(&#8221;my_txt&#8221;, 10, 10, 20, 200, 100);<br />
loadedInfo.wordWrap = true;</p>
<p>this.createClassObject(mx.controls.UIScrollBar, &#8220;my_sb&#8221;, 20);</p>
<p>// Set the target text field.<br />
my_sb.setScrollTarget(loadedInfo);</p>
<p>// Size it to match the text field.<br />
my_sb.setSize(12, loadedInfo._height); </p>
<p>// Move it next to the text field.<br />
my_sb.move(loadedInfo._x + loadedInfo._width, loadedInfo._y);</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Each individual external SWF is coded like this on it&#8217;s last frame:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>onEnterFrame = gotoAndStop(_level0.nextFrame()) </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>This moves the program to the next frame, which loads the next external SWF and the text for the text box -</p>
<p>The code for each frame on the index.swf is: </p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>stop();<br />
unloadMovieNum(5);<br />
onEnterFrame = _root.myMCL.loadClip(&#8221;assets/SWFs/fileName.swf&#8221;, 5);</p>
<p>// Load text to display and define onData handler.<br />
var my_lv:LoadVars = new LoadVars();<br />
my_lv.onData = function(src:String) {<br />
    if (src != undefined) {<br />
        loadedInfo.text = src;<br />
    } else {<br />
        loadedInfo.text = &#8220;Error loading text.&#8221;;<br />
    }<br />
};</p>
<p>my_lv.load(&#8221;assets/vars/fileName.txt&#8221;);</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>This loads the appropriate text file into the text box, which corrosponds to the external SWF file currently playing.  </p>
<p>Basically, I want the scrollbar to reset to the top of the text file each time a new text file is loaded - at present, when the scrollbar is utilized to read the loaded text, it remains at the bottom of the text file when a new file is loaded into the dynamic text box, (so that the user is reading the last line of the text file instead of the first line).  The user has to manually scroll up in order to read the first line of the text file.  </p>
<p>Is there a simple way to set a default for the scrollbar to reset to the top of the text file each time a new file is loaded?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211619</link>
		<pubDate>Fri, 27 Jun 2008 01:54:44 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211619</guid>
					<description>Scott,

Difficulty is a relative term, but I hear what you're saying. There really isn't an easy way to read &lt;em&gt;any&lt;/em&gt; value in the HTML outside of FlashVars.  In a sense, that's why FlashVars is there.  You could certainly use JavaScript to create a FlashVars variable on the fly, passing in the value of the parameter/attribute you're after.</description>
		<content:encoded><![CDATA[<p>Scott,</p>
<p>Difficulty is a relative term, but I hear what you&#8217;re saying. There really isn&#8217;t an easy way to read <em>any</em> value in the HTML outside of FlashVars.  In a sense, that&#8217;s why FlashVars is there.  You could certainly use JavaScript to create a FlashVars variable on the fly, passing in the value of the parameter/attribute you&#8217;re after.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Scott</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211614</link>
		<pubDate>Fri, 27 Jun 2008 01:44:36 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211614</guid>
					<description>So there is no easy function you can use to read the value?  I only need to read the value and determine if the value is set to always.

Scott</description>
		<content:encoded><![CDATA[<p>So there is no easy function you can use to read the value?  I only need to read the value and determine if the value is set to always.</p>
<p>Scott
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211575</link>
		<pubDate>Fri, 27 Jun 2008 00:06:44 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211575</guid>
					<description>Scott,

That's communication in the opposite direction &amp;#8212; from the SWF out, rather than from the HTML in.  If your HTML is formatted as XHTML, you can pass the URL of that very page to the SWF itself, as described here:

&lt;a href=&quot;http://www.communitymx.com/abstract.cfm?cid=02395&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://www.communitymx.com/abstract.cfm?cid=02395&lt;/a&gt;

There's more to it than that first article, but the first one (which is free) contains enough information to get you started.  From that point, it's a matter of locating the node that contains your parameter (actually, a tag attribute) and evaluating its value.</description>
		<content:encoded><![CDATA[<p>Scott,</p>
<p>That&#8217;s communication in the opposite direction &mdash; from the SWF out, rather than from the HTML in.  If your HTML is formatted as XHTML, you can pass the URL of that very page to the SWF itself, as described here:</p>
<p><a href="http://www.communitymx.com/abstract.cfm?cid=02395" target="_blank" rel="nofollow"><a href='http://www.communitymx.com/abstract.cfm?cid=02395' rel='nofollow'>http://www.communitymx.com/abstract.cfm?cid=02395</a></a></p>
<p>There&#8217;s more to it than that first article, but the first one (which is free) contains enough information to get you started.  From that point, it&#8217;s a matter of locating the node that contains your parameter (actually, a tag attribute) and evaluating its value.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Scott</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211568</link>
		<pubDate>Thu, 26 Jun 2008 23:55:22 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211568</guid>
					<description>I know it's not really related to the flashvars topic but would you happen to know how to reference the allowscriptaccess parameter in a flash movie with ActionScript 2.0?

Scott</description>
		<content:encoded><![CDATA[<p>I know it&#8217;s not really related to the flashvars topic but would you happen to know how to reference the allowscriptaccess parameter in a flash movie with ActionScript 2.0?</p>
<p>Scott
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Scott</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211423</link>
		<pubDate>Thu, 26 Jun 2008 19:11:07 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/how-to-tell-swf-from-outside#comment-211423</guid>
					<description>Yep, I got it, thanks.</description>
		<content:encoded><![CDATA[<p>Yep, I got it, thanks.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
