<?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 Build a Basic Slider Widget (AS2)</title>
	<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Wed, 19 Nov 2008 04:15:29 +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-build-basic-slider-as2#comment-138468</link>
		<pubDate>Sat, 23 Feb 2008 02:35:13 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-138468</guid>
					<description>shrikant,

Someone else recently asked me the same question, and it's a good one.  I told the other reader I would add this question to my to-do list (and I have!), but I don't know when I'll get the chance to write about that particular one.  I'm in the middle of a new book for O'Reilly (as of Feb 2008) and have been falling behind on everything else!</description>
		<content:encoded><![CDATA[<p>shrikant,</p>
<p>Someone else recently asked me the same question, and it&#8217;s a good one.  I told the other reader I would add this question to my to-do list (and I have!), but I don&#8217;t know when I&#8217;ll get the chance to write about that particular one.  I&#8217;m in the middle of a new book for O&#8217;Reilly (as of Feb 2008) and have been falling behind on everything else!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: shrikant</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-135875</link>
		<pubDate>Mon, 18 Feb 2008 11:10:37 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-135875</guid>
					<description>Hi David,

I am beginner in flash, i am working on one flash video player. In that i want to run 10 flv on one same seek bar continually like one FLV. Is there any solution?

can i join the 10 flv to produce one flv as a result, if yes please help me</description>
		<content:encoded><![CDATA[<p>Hi David,</p>
<p>I am beginner in flash, i am working on one flash video player. In that i want to run 10 flv on one same seek bar continually like one FLV. Is there any solution?</p>
<p>can i join the 10 flv to produce one flv as a result, if yes please help me
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-120720</link>
		<pubDate>Tue, 15 Jan 2008 02:10:24 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-120720</guid>
					<description>Chris,

The &lt;code&gt;SharedObject&lt;/code&gt; class is exactly the solution I was going to suggest!  :)  Have you made a few small tests first, just to make sure you've got the hang of how it works?  You can use &lt;code&gt;SharedObject&lt;/code&gt; to carry over whatever data you want, but because you're also dealing with FLVPlayback and other ActionScript, there might simply be too much going on for you to see clearly what you're dealing with.  (I do this all the time!  Then I have to remind myself to slow down, isolate the new idea in a completely new FLA [or set of FLAs] and take small steps until I understand exactly what the new code does.)

You might very well be carrying over the volume, but not retrieving it correctly from the next page &amp;#8212; or maybe you're not carrying it over, and the 100% winds up occurring because it's default.

For every page that has this slider, you're going to want to:  a) use &lt;code&gt;ShareObject.getLocal()&lt;/code&gt; to check for the existence of your &quot;Flash cookie&quot;; b) &lt;em&gt;if&lt;/em&gt; a cookie exists, use the volume setting from that or an arbitrary default; and c) in addition, use the same &lt;code&gt;getLocal()&lt;/code&gt; method whenever the slider &lt;em&gt;sets&lt;/em&gt; the volume, then follow that with &lt;code&gt;flush()&lt;/code&gt;, to make sure the cookie does get created and set immediately.</description>
		<content:encoded><![CDATA[<p>Chris,</p>
<p>The <code>SharedObject</code> class is exactly the solution I was going to suggest!  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Have you made a few small tests first, just to make sure you&#8217;ve got the hang of how it works?  You can use <code>SharedObject</code> to carry over whatever data you want, but because you&#8217;re also dealing with FLVPlayback and other ActionScript, there might simply be too much going on for you to see clearly what you&#8217;re dealing with.  (I do this all the time!  Then I have to remind myself to slow down, isolate the new idea in a completely new FLA [or set of FLAs] and take small steps until I understand exactly what the new code does.)</p>
<p>You might very well be carrying over the volume, but not retrieving it correctly from the next page &mdash; or maybe you&#8217;re not carrying it over, and the 100% winds up occurring because it&#8217;s default.</p>
<p>For every page that has this slider, you&#8217;re going to want to:  a) use <code>ShareObject.getLocal()</code> to check for the existence of your &#8220;Flash cookie&#8221;; b) <em>if</em> a cookie exists, use the volume setting from that or an arbitrary default; and c) in addition, use the same <code>getLocal()</code> method whenever the slider <em>sets</em> the volume, then follow that with <code>flush()</code>, to make sure the cookie does get created and set immediately.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Chris</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-119721</link>
		<pubDate>Fri, 11 Jan 2008 18:05:37 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-119721</guid>
					<description>Hi again Dave-

I have successfully implemented the volume slider on my page with your suggestions, thanks again!  Works great on a single HTML page.

I've encountered a situation in my application where my SWF needs to be loaded into a sequence of HTML pages, and the volume slider value is getting reset to 100% with each new load.  I currently have a single SWF that has an FLV component (plus the slider code), the FLV file name itself is set via a variable so the name of the file is called inside the HTML page.

I need to find a way to have the slider value carry from page to page as the SWF is loaded and show the slider in that &quot;variable&quot; position.

I've looked into using a shared object but I am unable to have it affect the volume slider.  It keeps setting the volume to 100% when it's loaded.  Any suggestions, or is the shared object not the way to go?

Thanks!!  Chris

I will need to carry over the current volume setting and slider position</description>
		<content:encoded><![CDATA[<p>Hi again Dave-</p>
<p>I have successfully implemented the volume slider on my page with your suggestions, thanks again!  Works great on a single HTML page.</p>
<p>I&#8217;ve encountered a situation in my application where my SWF needs to be loaded into a sequence of HTML pages, and the volume slider value is getting reset to 100% with each new load.  I currently have a single SWF that has an FLV component (plus the slider code), the FLV file name itself is set via a variable so the name of the file is called inside the HTML page.</p>
<p>I need to find a way to have the slider value carry from page to page as the SWF is loaded and show the slider in that &#8220;variable&#8221; position.</p>
<p>I&#8217;ve looked into using a shared object but I am unable to have it affect the volume slider.  It keeps setting the volume to 100% when it&#8217;s loaded.  Any suggestions, or is the shared object not the way to go?</p>
<p>Thanks!!  Chris</p>
<p>I will need to carry over the current volume setting and slider position
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-113078</link>
		<pubDate>Tue, 18 Dec 2007 19:48:05 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-113078</guid>
					<description>Melissa,

If you're seeing something about the &lt;code&gt;on&lt;/code&gt; event handler, my guess is that you've placed your code on the buttons themselves, rather than in a timeline keyframe.  The Actions panel updates its focus depending on what you've selected when you start typing.  In pre-AS3 documents, you can select objects (buttons, movie clips, components) and add code directly to the object &amp;#8212; in which case you don't need instance names because Flash already knows which object(s) you mean.

Because you're using instance names (the more modern, and Adobe-recommended, approach), you'll need to remove that code from the buttons.  See if my &lt;a href=&quot;http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;museum pieces&lt;/a&gt; article helps you out.  Chin up!</description>
		<content:encoded><![CDATA[<p>Melissa,</p>
<p>If you&#8217;re seeing something about the <code>on</code> event handler, my guess is that you&#8217;ve placed your code on the buttons themselves, rather than in a timeline keyframe.  The Actions panel updates its focus depending on what you&#8217;ve selected when you start typing.  In pre-AS3 documents, you can select objects (buttons, movie clips, components) and add code directly to the object &mdash; in which case you don&#8217;t need instance names because Flash already knows which object(s) you mean.</p>
<p>Because you&#8217;re using instance names (the more modern, and Adobe-recommended, approach), you&#8217;ll need to remove that code from the buttons.  See if my <a href="http://www.quip.net/blog/2006/flash/museum-pieces-on-and-onclipevent" target="_blank" rel="nofollow">museum pieces</a> article helps you out.  Chin up!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Melissa</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-112817</link>
		<pubDate>Tue, 18 Dec 2007 00:15:23 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-112817</guid>
					<description>David,
Thank you for all of this detailed information, it all certainly helps!
Unfortunately I did not get my buttons to work yet.
I used the script you posted for me above for each button (substituting of course the correct instance names for the button and the clip), but I keep getting a compiler error msg about 'expecting the on event handler'.
I think I will try creating a brand new project and brand new buttons and going from there with what you have given me.
It may just come down to something I am overlooking in my current project. I will come back crying to you if I can't get it to work in a brand new one! :)  Thanks again....we are so fortunate to have access to brilliant people miles away....</description>
		<content:encoded><![CDATA[<p>David,<br />
Thank you for all of this detailed information, it all certainly helps!<br />
Unfortunately I did not get my buttons to work yet.<br />
I used the script you posted for me above for each button (substituting of course the correct instance names for the button and the clip), but I keep getting a compiler error msg about &#8216;expecting the on event handler&#8217;.<br />
I think I will try creating a brand new project and brand new buttons and going from there with what you have given me.<br />
It may just come down to something I am overlooking in my current project. I will come back crying to you if I can&#8217;t get it to work in a brand new one! <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Thanks again&#8230;.we are so fortunate to have access to brilliant people miles away&#8230;.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111956</link>
		<pubDate>Sat, 15 Dec 2007 03:41:29 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111956</guid>
					<description>Melissa,

&lt;blockquote&gt;Where do I drag the buttons in from the library?&lt;/blockquote&gt;

Flash is very flexible about this.  The key is to give each button an instance name (again, see the Property inspector while you have a button selected), then use that instance name in a valid object reference in order to tell it what to do.  Think of object references like folders on your hard drive.  If you were in the root of your computer (usually &lt;code&gt;C:\&lt;/code&gt; on Windows machines), how would you have to travel in order to get to a particular file?

If your code is in a keyframe of the main timeline and your buttons are also in the main timeline, the object reference would simply be the instance name of a given button.  If those buttons were inside a movie clip symbol, that movie clip would also have to be given an instance name &amp;#8212; and the your object reference would be the movie clip's instance name, then a dot, then the button's instance name.  Make sense?

&lt;blockquote&gt;Do I double click the movie clip and drag them in during its edit mode? Or do I need to add them to the main stage of my scene?&lt;/blockquote&gt;

Wherever you decide to put them, just make sure you use the correct object reference from the point of view of the ActionScript that speaks to them.  I personally tend to put 99% of my ActionScript in a layer of its own (named &quot;scripts&quot;) in the main timeline.

&lt;blockquote&gt;What action script needs to be within the movie clip?&lt;/blockquote&gt;

None.  You &lt;em&gt;could&lt;/em&gt; put your code in the movie clip, but that would the &quot;point of view&quot; of that code and might affect your object references.

&lt;blockquote&gt;Does the action script for the buttons need to be in the first and last keyframes of that layer so that they are available throughout the movie playing?&lt;/blockquote&gt;

Think of your timeline like a grid with rows (horizontal) and columns (vertical).  Keyframe ActionScript needs to be in the same column as the object(s) it's trying to talk to.  If your buttons span from frame 5 to frame 50, you would put your button event handlers into a keyframe of your scripts layer on frame 5 (the first frame that &quot;meets&quot; the buttons on a vertical column).

&lt;blockquote&gt;Can a seek bar work the same way?&lt;/blockquote&gt;

The slider widget described in the blog entry works by the same principles of code &quot;point of view&quot; (that is, object references and where each object is in relation to other objects it needs).

Does that help?  :)</description>
		<content:encoded><![CDATA[<p>Melissa,</p>
<blockquote><p>Where do I drag the buttons in from the library?</p></blockquote>
<p>Flash is very flexible about this.  The key is to give each button an instance name (again, see the Property inspector while you have a button selected), then use that instance name in a valid object reference in order to tell it what to do.  Think of object references like folders on your hard drive.  If you were in the root of your computer (usually <code>C:\</code> on Windows machines), how would you have to travel in order to get to a particular file?</p>
<p>If your code is in a keyframe of the main timeline and your buttons are also in the main timeline, the object reference would simply be the instance name of a given button.  If those buttons were inside a movie clip symbol, that movie clip would also have to be given an instance name &mdash; and the your object reference would be the movie clip&#8217;s instance name, then a dot, then the button&#8217;s instance name.  Make sense?</p>
<blockquote><p>Do I double click the movie clip and drag them in during its edit mode? Or do I need to add them to the main stage of my scene?</p></blockquote>
<p>Wherever you decide to put them, just make sure you use the correct object reference from the point of view of the ActionScript that speaks to them.  I personally tend to put 99% of my ActionScript in a layer of its own (named &#8220;scripts&#8221;) in the main timeline.</p>
<blockquote><p>What action script needs to be within the movie clip?</p></blockquote>
<p>None.  You <em>could</em> put your code in the movie clip, but that would the &#8220;point of view&#8221; of that code and might affect your object references.</p>
<blockquote><p>Does the action script for the buttons need to be in the first and last keyframes of that layer so that they are available throughout the movie playing?</p></blockquote>
<p>Think of your timeline like a grid with rows (horizontal) and columns (vertical).  Keyframe ActionScript needs to be in the same column as the object(s) it&#8217;s trying to talk to.  If your buttons span from frame 5 to frame 50, you would put your button event handlers into a keyframe of your scripts layer on frame 5 (the first frame that &#8220;meets&#8221; the buttons on a vertical column).</p>
<blockquote><p>Can a seek bar work the same way?</p></blockquote>
<p>The slider widget described in the blog entry works by the same principles of code &#8220;point of view&#8221; (that is, object references and where each object is in relation to other objects it needs).</p>
<p>Does that help?  <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: Melissa</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111819</link>
		<pubDate>Fri, 14 Dec 2007 18:14:41 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111819</guid>
					<description>Thank you, David, for the quick response!

Great information.
I had attempted something like this before to no avail, thanks for clarifying I was on the right track;  I think I may just be adding the buttons in the wrong area.
My movie clip instsance name is everydayMovie, and my stop and play button instances are named playEveryday and stopEveryday.

Where do I drag the buttons in from the library? Do I double click the movie clip and drag them in during its edit mode? Or do I need to add them to the main stage of my scene?
What action script needs to be within the movie clip? 
Does the action script for the buttons need to be in the first and last keyframes of that layer so that they are available throughout the movie playing? 
Can a seek bar work the same way?

Sorry for the barrage, I've just been working on this for 6 days straight and feel like I am so close.  

Thank you a million times over for your time and your expert advice!
:)</description>
		<content:encoded><![CDATA[<p>Thank you, David, for the quick response!</p>
<p>Great information.<br />
I had attempted something like this before to no avail, thanks for clarifying I was on the right track;  I think I may just be adding the buttons in the wrong area.<br />
My movie clip instsance name is everydayMovie, and my stop and play button instances are named playEveryday and stopEveryday.</p>
<p>Where do I drag the buttons in from the library? Do I double click the movie clip and drag them in during its edit mode? Or do I need to add them to the main stage of my scene?<br />
What action script needs to be within the movie clip?<br />
Does the action script for the buttons need to be in the first and last keyframes of that layer so that they are available throughout the movie playing?<br />
Can a seek bar work the same way?</p>
<p>Sorry for the barrage, I&#8217;ve just been working on this for 6 days straight and feel like I am so close.  </p>
<p>Thank you a million times over for your time and your expert advice!<br />
:)
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111770</link>
		<pubDate>Fri, 14 Dec 2007 14:30:55 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111770</guid>
					<description>Melissa,

For videos of any substantial length (for example, longer than a few seconds), I definitely recommend that you use either the FLVPlayback component or the Video object/&lt;code&gt;NetConnection&lt;/code&gt;/&lt;code&gt;NetStream&lt;/code&gt; approach suggested &lt;a href=&quot;http://www.quip.net/blog/2006/flash/how-to-load-external-video&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;elsewhere on this blog&lt;/a&gt;.

That said, there's certainly nothing wrong with importing WMVs and putting them in movie clip timelines.  It's just that you may run into timing issues between the framerate of the video and the framerate of your FLA &amp;#8212; and videos displayed in this way fall completely under the auspices of the &lt;code&gt;MovieClip&lt;/code&gt; class.  In a sense, that makes things easier, because movie clip timelines are less complicated than the &lt;code&gt;NetStream&lt;/code&gt; class.

The movie clip that holds your video will need an instance name.  Select the movie clip on the Stage and look to the Property inspector to do that.  This allows that movie clip to be addressed by name and told what to do.  The available instructions are listed in the &lt;code&gt;MovieClip&lt;/code&gt; class entry of the ActionScript 2.0 Language Reference.  The &lt;code&gt;MovieClip.play()&lt;/code&gt; method, for example, tells a movie clip to play.

&lt;code&gt;myVideoHolderClip.play();&lt;/code&gt;

You'll see other methods that allow you to stop and jump around.  The trick is, classes define objects, so class entries are a kind of Owner's Manual for the object at hand (in this case, movie clips).  Characteristics of the object are called properties, things it can do are called methods, and things it can react to are called events.

Give you buttons instance names as well, and they can also be programmed.  Your code will go in a keyframe, and you'll look to the &lt;code&gt;Button&lt;/code&gt; class to see what events are available for button symbols.

&lt;pre&gt;&lt;code&gt;playButton.onRelease = function():Void {
  myVideoHolderClip.play();
}
stopButton.onRelease = function():Void {
  myVideoHolderClip.stop();
}&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Melissa,</p>
<p>For videos of any substantial length (for example, longer than a few seconds), I definitely recommend that you use either the FLVPlayback component or the Video object/<code>NetConnection</code>/<code>NetStream</code> approach suggested <a href="http://www.quip.net/blog/2006/flash/how-to-load-external-video" target="_blank" rel="nofollow">elsewhere on this blog</a>.</p>
<p>That said, there&#8217;s certainly nothing wrong with importing WMVs and putting them in movie clip timelines.  It&#8217;s just that you may run into timing issues between the framerate of the video and the framerate of your FLA &mdash; and videos displayed in this way fall completely under the auspices of the <code>MovieClip</code> class.  In a sense, that makes things easier, because movie clip timelines are less complicated than the <code>NetStream</code> class.</p>
<p>The movie clip that holds your video will need an instance name.  Select the movie clip on the Stage and look to the Property inspector to do that.  This allows that movie clip to be addressed by name and told what to do.  The available instructions are listed in the <code>MovieClip</code> class entry of the ActionScript 2.0 Language Reference.  The <code>MovieClip.play()</code> method, for example, tells a movie clip to play.</p>
<p><code>myVideoHolderClip.play();</code></p>
<p>You&#8217;ll see other methods that allow you to stop and jump around.  The trick is, classes define objects, so class entries are a kind of Owner&#8217;s Manual for the object at hand (in this case, movie clips).  Characteristics of the object are called properties, things it can do are called methods, and things it can react to are called events.</p>
<p>Give you buttons instance names as well, and they can also be programmed.  Your code will go in a keyframe, and you&#8217;ll look to the <code>Button</code> class to see what events are available for button symbols.</p>
<pre><code>playButton.onRelease = function():Void {
  myVideoHolderClip.play();
}
stopButton.onRelease = function():Void {
  myVideoHolderClip.stop();
}</code></pre>
]]></content:encoded>
				</item>
	<item>
		<title>by: Melissa</title>
		<link>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111680</link>
		<pubDate>Fri, 14 Dec 2007 06:58:29 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/how-to-build-basic-slider-as2#comment-111680</guid>
					<description>Hi there Dave,
Awesome site!
I am a total beginner in Flash and have just about completed my first project...My problem is that I just can't seem to figure out how to make play and stop buttons control a movie clip symbol. 
What is the best way to bring in wmv files and be able to control them (with like play and stop buttons,etc.)? [AS2/CS3]
What action script should be applied to the play/stop buttons and the video itself (I currently have my imported/embedded video created as a movie clip symbol, and for the moment have it playing when the scene starts).
Thanks for your time!</description>
		<content:encoded><![CDATA[<p>Hi there Dave,<br />
Awesome site!<br />
I am a total beginner in Flash and have just about completed my first project&#8230;My problem is that I just can&#8217;t seem to figure out how to make play and stop buttons control a movie clip symbol.<br />
What is the best way to bring in wmv files and be able to control them (with like play and stop buttons,etc.)? [AS2/CS3]<br />
What action script should be applied to the play/stop buttons and the video itself (I currently have my imported/embedded video created as a movie clip symbol, and for the moment have it playing when the scene starts).<br />
Thanks for your time!
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
