<?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 Load External Flash Video (FLV) Files (AS3)</title>
	<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Wed, 19 Nov 2008 03:51:45 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275171</link>
		<pubDate>Thu, 18 Sep 2008 15:09:01 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275171</guid>
					<description>TJ3182,

Sounds like you didn't read my reply carefully.  ;)  It all hinges on what version of ActionScript you're using.</description>
		<content:encoded><![CDATA[<p>TJ3182,</p>
<p>Sounds like you didn&#8217;t read my reply carefully.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />   It all hinges on what version of ActionScript you&#8217;re using.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: TJ3182</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275170</link>
		<pubDate>Thu, 18 Sep 2008 15:08:04 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275170</guid>
					<description>Nevermind!! i figured it out!!

Thanks A Million!!</description>
		<content:encoded><![CDATA[<p>Nevermind!! i figured it out!!</p>
<p>Thanks A Million!!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: TJ3182</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275168</link>
		<pubDate>Thu, 18 Sep 2008 15:04:08 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275168</guid>
					<description>When I add that script to the rest of my AS..

I get this error:

The class or interface 'SoundTransform' could not be loaded.</description>
		<content:encoded><![CDATA[<p>When I add that script to the rest of my AS..</p>
<p>I get this error:</p>
<p>The class or interface &#8216;SoundTransform&#8217; could not be loaded.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275160</link>
		<pubDate>Thu, 18 Sep 2008 14:56:09 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275160</guid>
					<description>TJ3182,

The code you're showing in your second post is all ActionScript 2.0, so it's going to break 8,000 ways when you try to compile it in a file configured for AS3.

AS3 is significantly different from AS2 in regard to handling events.  AS3 doesn't allow you to attach your code to the button (or to any object), so you'll have to give your button an instance name, like you're doing in that sample code.

But there's another difference, and that's that AS3 doesn't use &lt;code&gt;onRelease&lt;/code&gt;, etc., like you're showing.  You've also got a problem in that you're using &lt;code&gt;SoundTransform&lt;/code&gt; as a method (no sign of that &lt;code&gt;volume&lt;/code&gt; property) ... here's how it might look, in AS3:

&lt;pre&gt;&lt;code&gt;var xform:SoundTransform;
muteBtn.addEventListener(MouseEvent.CLICK, onMute);
nomuteBtn.addEventListener(MouseEvent.CLICK, onNoMute);

function onMute(evt:MouseEvent):void {
  xform = ns.soundTransform;
  xform.volume = 0;
  ns.soundTransform = xform;
}
function onNoMute(evt:MouseEvent):void {
  xform = ns.soundTransform;
  xform.volume = 1;
  ns.soundTransform = xform;
}&lt;/code&gt;&lt;/pre&gt;

As for AS2 ... check out &quot;&lt;a href=&quot;http://www.quip.net/blog/2007/flash/how-to-adjust-video-audio&quot; target=&quot;_blank&quot;&gt;How to Adjust the Audio Portion of Flash Video&lt;/a&gt;.&quot;  Horse of a different color!  :)</description>
		<content:encoded><![CDATA[<p>TJ3182,</p>
<p>The code you&#8217;re showing in your second post is all ActionScript 2.0, so it&#8217;s going to break 8,000 ways when you try to compile it in a file configured for AS3.</p>
<p>AS3 is significantly different from AS2 in regard to handling events.  AS3 doesn&#8217;t allow you to attach your code to the button (or to any object), so you&#8217;ll have to give your button an instance name, like you&#8217;re doing in that sample code.</p>
<p>But there&#8217;s another difference, and that&#8217;s that AS3 doesn&#8217;t use <code>onRelease</code>, etc., like you&#8217;re showing.  You&#8217;ve also got a problem in that you&#8217;re using <code>SoundTransform</code> as a method (no sign of that <code>volume</code> property) &#8230; here&#8217;s how it might look, in AS3:</p>
<pre><code>var xform:SoundTransform;
muteBtn.addEventListener(MouseEvent.CLICK, onMute);
nomuteBtn.addEventListener(MouseEvent.CLICK, onNoMute);

function onMute(evt:MouseEvent):void {
  xform = ns.soundTransform;
  xform.volume = 0;
  ns.soundTransform = xform;
}
function onNoMute(evt:MouseEvent):void {
  xform = ns.soundTransform;
  xform.volume = 1;
  ns.soundTransform = xform;
}</code></pre>
<p>As for AS2 &#8230; check out &#8220;<a href="http://www.quip.net/blog/2007/flash/how-to-adjust-video-audio" target="_blank">How to Adjust the Audio Portion of Flash Video</a>.&#8221;  Horse of a different color!  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: TJ3182</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275157</link>
		<pubDate>Thu, 18 Sep 2008 14:49:51 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275157</guid>
					<description>Here is my main AS..which is controlling everything.

var duration:Number = 0;
var ratio:Number = 0;
var id:Number = 0;

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
videoPlayer.attachVideo(ns);
ns.play(&quot;BTLMovie.flv&quot;);


ns.onMetaData = function(evt:Object):Void {
  duration = evt.duration;
  ratio = track._width / duration;
  id = setInterval(updateKnob, 50);
};

ns.onStatus = function(evt:Object):Void {
  if (this.time &amp;#62; 0 &amp;#38;&amp;#38; this.time &amp;#62;= (duration - 0.5)) {
		gotoAndPlay(6);
    trace(&quot;Video complete&quot;);
    clearInterval(id);
    delete this.onStatus;
  }
};

function updateKnob():Void {
  knob._x = track._x + ns.time * ratio;
}

knob.onPress = function():Void {
  clearInterval(id);
  ns.pause(true);
  var vertical:Number = track._y + (track._height / 2);
  this.startDrag(
    true,
    track._x,
    vertical,
    track._x + track._width,
    vertical
  );
}

knob.onRelease = function():Void {
  this.stopDrag();
  ns.seek((this._x - track._x) / ratio);
  ns.pause(false);
  id = setInterval(updateKnob, 50);
}
knob.onReleaseOutside = knob.onRelease;

btnPause.onRelease = function() {
  ns.pause(true);
}

btnPlay.onRelease = function() {
  ns.pause(false);
}</description>
		<content:encoded><![CDATA[<p>Here is my main AS..which is controlling everything.</p>
<p>var duration:Number = 0;<br />
var ratio:Number = 0;<br />
var id:Number = 0;</p>
<p>var nc:NetConnection = new NetConnection();<br />
nc.connect(null);<br />
var ns:NetStream = new NetStream(nc);<br />
videoPlayer.attachVideo(ns);<br />
ns.play(&#8221;BTLMovie.flv&#8221;);</p>
<p>ns.onMetaData = function(evt:Object):Void {<br />
  duration = evt.duration;<br />
  ratio = track._width / duration;<br />
  id = setInterval(updateKnob, 50);<br />
};</p>
<p>ns.onStatus = function(evt:Object):Void {<br />
  if (this.time &gt; 0 &amp;&amp; this.time &gt;= (duration - 0.5)) {<br />
		gotoAndPlay(6);<br />
    trace(&#8221;Video complete&#8221;);<br />
    clearInterval(id);<br />
    delete this.onStatus;<br />
  }<br />
};</p>
<p>function updateKnob():Void {<br />
  knob._x = track._x + ns.time * ratio;<br />
}</p>
<p>knob.onPress = function():Void {<br />
  clearInterval(id);<br />
  ns.pause(true);<br />
  var vertical:Number = track._y + (track._height / 2);<br />
  this.startDrag(<br />
    true,<br />
    track._x,<br />
    vertical,<br />
    track._x + track._width,<br />
    vertical<br />
  );<br />
}</p>
<p>knob.onRelease = function():Void {<br />
  this.stopDrag();<br />
  ns.seek((this._x - track._x) / ratio);<br />
  ns.pause(false);<br />
  id = setInterval(updateKnob, 50);<br />
}<br />
knob.onReleaseOutside = knob.onRelease;</p>
<p>btnPause.onRelease = function() {<br />
  ns.pause(true);<br />
}</p>
<p>btnPlay.onRelease = function() {<br />
  ns.pause(false);<br />
}
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: TJ3182</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275156</link>
		<pubDate>Thu, 18 Sep 2008 14:49:10 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275156</guid>
					<description>thanks,  im fairly new at AS3.

am i adding this script to the actual button or to the rest of my AS?

muteBtn.onRelease = function() {
  ns.SoundTransform(0);
}

nomuteBtn.onRelease = function() {
  ns.SoundTransform(100);
}</description>
		<content:encoded><![CDATA[<p>thanks,  im fairly new at AS3.</p>
<p>am i adding this script to the actual button or to the rest of my AS?</p>
<p>muteBtn.onRelease = function() {<br />
  ns.SoundTransform(0);<br />
}</p>
<p>nomuteBtn.onRelease = function() {<br />
  ns.SoundTransform(100);<br />
}
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275154</link>
		<pubDate>Thu, 18 Sep 2008 14:44:15 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275154</guid>
					<description>TJ3182,

In AS3, the &lt;code&gt;NetStream&lt;/code&gt; class features a &lt;code&gt;soundTransform&lt;/code&gt; property, which lets you hook into a &lt;code&gt;SoundTransform&lt;/code&gt; instance associated with your video content.

The &lt;code&gt;SoundTransform&lt;/code&gt; class features a &lt;code&gt;volume&lt;/code&gt; property.  So you can use your button to set that property to 0, then set it back to 1 (i.e., 100% volume) later.</description>
		<content:encoded><![CDATA[<p>TJ3182,</p>
<p>In AS3, the <code>NetStream</code> class features a <code>soundTransform</code> property, which lets you hook into a <code>SoundTransform</code> instance associated with your video content.</p>
<p>The <code>SoundTransform</code> class features a <code>volume</code> property.  So you can use your button to set that property to 0, then set it back to 1 (i.e., 100% volume) later.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: TJ3182</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275146</link>
		<pubDate>Thu, 18 Sep 2008 14:37:11 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-275146</guid>
					<description>how can i add a mute button...

I have 1 button for mute on/off</description>
		<content:encoded><![CDATA[<p>how can i add a mute button&#8230;</p>
<p>I have 1 button for mute on/off
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-245162</link>
		<pubDate>Sun, 10 Aug 2008 03:04:44 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-245162</guid>
					<description>nejck,

In my experience, the size if the video is determined by the parameters you pass into the &lt;code&gt;Video&lt;/code&gt; constructor.  When I do this, for example:

&lt;pre&gt;&lt;code&gt;var vid:Video = new Video(320, 240);&lt;/code&gt;&lt;/pre&gt;

... I get a video that's 320 x 240, even if the actual FLV is bigger.  It should be happening for you.  :)  Is your Video object somehow getting masked?</description>
		<content:encoded><![CDATA[<p>nejck,</p>
<p>In my experience, the size if the video is determined by the parameters you pass into the <code>Video</code> constructor.  When I do this, for example:</p>
<pre><code>var vid:Video = new Video(320, 240);</code></pre>
<p>&#8230; I get a video that&#8217;s 320 x 240, even if the actual FLV is bigger.  It should be happening for you.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Is your Video object somehow getting masked?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: nejck</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-243172</link>
		<pubDate>Thu, 07 Aug 2008 11:56:19 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-load-external-video-as3#comment-243172</guid>
					<description>Hello, this script helped me quite a lot, but I have a problem.... I need to display a video at a specific size (lets say 300x300), but the source video is 500x500... is there any way resizing the video?

In current configuration I ged only top left corner of a video :)

thanks,
nejck</description>
		<content:encoded><![CDATA[<p>Hello, this script helped me quite a lot, but I have a problem&#8230;. I need to display a video at a specific size (lets say 300&#215;300), but the source video is 500&#215;500&#8230; is there any way resizing the video?</p>
<p>In current configuration I ged only top left corner of a video <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>thanks,<br />
nejck
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
