

































<?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: Trust Me, AS3, It&#8217;s a MovieClip</title>
	<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Tue, 07 Feb 2012 19:46:26 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: Tiemen</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-439477</link>
		<pubDate>Sat, 13 Feb 2010 23:12:44 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-439477</guid>
					<description>Hey David,

Though I believe you're super-busy again, I thought it'd never hurt to queue a blog request :) 

I vote for your thoughts on event handler organisation policy. The concept of event handlers is well documented, but I personally have trouble keeping my code organized. I'm at present working with the Zend framework, and have all kinds of event handlers and responders lying all over the place... it's an horrible sight. I saw someone use a switch statement inside a &quot;click handler&quot; function to let it encompass different behavior for different targets, which has some merit, but still feels a bit blunt...?

Please help. With my code in this state I can't possibly get a girl to come over :'(</description>
		<content:encoded><![CDATA[<p>Hey David,</p>
<p>Though I believe you&#8217;re super-busy again, I thought it&#8217;d never hurt to queue a blog request <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>I vote for your thoughts on event handler organisation policy. The concept of event handlers is well documented, but I personally have trouble keeping my code organized. I&#8217;m at present working with the Zend framework, and have all kinds of event handlers and responders lying all over the place&#8230; it&#8217;s an horrible sight. I saw someone use a switch statement inside a &#8220;click handler&#8221; function to let it encompass different behavior for different targets, which has some merit, but still feels a bit blunt&#8230;?</p>
<p>Please help. With my code in this state I can&#8217;t possibly get a girl to come over :&#8217;(
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex Wilson</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-371650</link>
		<pubDate>Thu, 26 Mar 2009 18:00:04 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-371650</guid>
					<description>Hi David, so sorry to bug you.  I know you are probably bombarded by tons of requests for help but I thought I would just give it a shot on this post.  I have been playing with some code that you gave a long time ago (two or three posts up) to scroll through content in a timeline based slide show.  It consists of a track and slider that the user can scrub to move the timeline back and forth.  I've used that code several times and it works great, but I'm still trying to figure out how to make the knob update with the progress as the content plays on the timeline.  I combined the code that you gave me on this post  with some that I got from your book &quot;Foundation Flash CS3 for Designers&quot;  on making a .mp3 player (the code to make the scrubber knob move as the audio progresses with on ENTER_FRAME handler).  I think I may be close to getting this worked out but after a could weeks of working with it and posting on forums I can't think of anything else.  If you could take a look this code and maybe point me in the right direction I would appreciate it!  This is for my graduate project so I can finally finish up and get that piece of paper that says I'm done!  If you can help me out that would be great, if you are to swamped then thats ok, keep on writing those book, can't wait to see on on CS4

code:
//////seek slider code\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
var pausetl:Boolean = false;
//when it is playing &quot;pausetl&quot; is false (the timelines initial state is playing)
var ratio:Number = track.width / this.totalFrames;
var vertical:Number;

knob.addEventListener(MouseEvent.MOUSE_DOWN, seekStartDrag);
knob.buttonMode = true;

playTl();

//custom functions 
function playTl():void {
	this.play();//sets the main timeline to play
	pausetl = false;//sets the variable pausetl to false
	knob.addEventListener(Event.ENTER_FRAME, seekKnobUpdate);
}

function pauseTl():void {
	this.stop();//sets the main timeline to stop
	pausetl = true;//sets the variable pausetl to true
	knob.removeEventListener(Event.ENTER_FRAME, seekKnobUpdate);
}


////seek slider functions
function seekStartDrag(evt:MouseEvent):void {
	pauseTl();
	vertical = track.y + (track.height / 2);
	knob.startDrag(
	    true, //sets the &quot;lockcenter&quot; parameter to true, center point of mc locks to mouse
	    new Rectangle(track.x, vertical, track.width, 0));
	//specifies the position of where the drargging should be constrained to &quot;track's&quot; width and to a height of 0
	stage.addEventListener(MouseEvent.MOUSE_UP, seekStopDrag);
	stage.addEventListener(MouseEvent.MOUSE_MOVE,seekKnobUpdate);//by changing &quot;knob&quot; to stage I was able to leave the know with my pointer.
}

function seekStopDrag(evt:MouseEvent):void {
	knob.stopDrag();
	playTl();
	stage.removeEventListener(MouseEvent.MOUSE_UP, seekStopDrag);
	stage.removeEventListener(MouseEvent.MOUSE_MOVE, seekKnobUpdate);
}

function seekKnobUpdate(evt:MouseEvent):void {

	this.gotoAndPlay(Math.floor((knob.x - track.x) / ratio));
	//go to and play the show from the number generated by this code
}


//////play/pause toggle button
pptoggle_btn.addEventListener(MouseEvent.CLICK, onClick);

function onClick(event:MouseEvent):void {

	if (pausetl) {
		//if &quot;pausetl&quot; is true then run this
		playTl();
		this.pptoggle_btn.gotoAndStop(&quot;pause&quot;);//sets the mc pptoggle to its &quot;pause&quot; frame.

	} else {
		//if &quot;pausetl&quot; is false then run this
		pauseTl();
		this.pptoggle_btn.gotoAndStop(&quot;play&quot;);//sets the mc pptoggle to its &quot;play&quot; frame
	}
}</description>
		<content:encoded><![CDATA[<p>Hi David, so sorry to bug you.  I know you are probably bombarded by tons of requests for help but I thought I would just give it a shot on this post.  I have been playing with some code that you gave a long time ago (two or three posts up) to scroll through content in a timeline based slide show.  It consists of a track and slider that the user can scrub to move the timeline back and forth.  I&#8217;ve used that code several times and it works great, but I&#8217;m still trying to figure out how to make the knob update with the progress as the content plays on the timeline.  I combined the code that you gave me on this post  with some that I got from your book &#8220;Foundation Flash CS3 for Designers&#8221;  on making a .mp3 player (the code to make the scrubber knob move as the audio progresses with on ENTER_FRAME handler).  I think I may be close to getting this worked out but after a could weeks of working with it and posting on forums I can&#8217;t think of anything else.  If you could take a look this code and maybe point me in the right direction I would appreciate it!  This is for my graduate project so I can finally finish up and get that piece of paper that says I&#8217;m done!  If you can help me out that would be great, if you are to swamped then thats ok, keep on writing those book, can&#8217;t wait to see on on CS4</p>
<p>code:<br />
//////seek slider code\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\<br />
var pausetl:Boolean = false;<br />
//when it is playing &#8220;pausetl&#8221; is false (the timelines initial state is playing)<br />
var ratio:Number = track.width / this.totalFrames;<br />
var vertical:Number;</p>
<p>knob.addEventListener(MouseEvent.MOUSE_DOWN, seekStartDrag);<br />
knob.buttonMode = true;</p>
<p>playTl();</p>
<p>//custom functions<br />
function playTl():void {<br />
	this.play();//sets the main timeline to play<br />
	pausetl = false;//sets the variable pausetl to false<br />
	knob.addEventListener(Event.ENTER_FRAME, seekKnobUpdate);<br />
}</p>
<p>function pauseTl():void {<br />
	this.stop();//sets the main timeline to stop<br />
	pausetl = true;//sets the variable pausetl to true<br />
	knob.removeEventListener(Event.ENTER_FRAME, seekKnobUpdate);<br />
}</p>
<p>////seek slider functions<br />
function seekStartDrag(evt:MouseEvent):void {<br />
	pauseTl();<br />
	vertical = track.y + (track.height / 2);<br />
	knob.startDrag(<br />
	    true, //sets the &#8220;lockcenter&#8221; parameter to true, center point of mc locks to mouse<br />
	    new Rectangle(track.x, vertical, track.width, 0));<br />
	//specifies the position of where the drargging should be constrained to &#8220;track&#8217;s&#8221; width and to a height of 0<br />
	stage.addEventListener(MouseEvent.MOUSE_UP, seekStopDrag);<br />
	stage.addEventListener(MouseEvent.MOUSE_MOVE,seekKnobUpdate);//by changing &#8220;knob&#8221; to stage I was able to leave the know with my pointer.<br />
}</p>
<p>function seekStopDrag(evt:MouseEvent):void {<br />
	knob.stopDrag();<br />
	playTl();<br />
	stage.removeEventListener(MouseEvent.MOUSE_UP, seekStopDrag);<br />
	stage.removeEventListener(MouseEvent.MOUSE_MOVE, seekKnobUpdate);<br />
}</p>
<p>function seekKnobUpdate(evt:MouseEvent):void {</p>
<p>	this.gotoAndPlay(Math.floor((knob.x - track.x) / ratio));<br />
	//go to and play the show from the number generated by this code<br />
}</p>
<p>//////play/pause toggle button<br />
pptoggle_btn.addEventListener(MouseEvent.CLICK, onClick);</p>
<p>function onClick(event:MouseEvent):void {</p>
<p>	if (pausetl) {<br />
		//if &#8220;pausetl&#8221; is true then run this<br />
		playTl();<br />
		this.pptoggle_btn.gotoAndStop(&#8221;pause&#8221;);//sets the mc pptoggle to its &#8220;pause&#8221; frame.</p>
<p>	} else {<br />
		//if &#8220;pausetl&#8221; is false then run this<br />
		pauseTl();<br />
		this.pptoggle_btn.gotoAndStop(&#8221;play&#8221;);//sets the mc pptoggle to its &#8220;play&#8221; frame<br />
	}<br />
}
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex Wilson</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-269954</link>
		<pubDate>Fri, 12 Sep 2008 21:07:08 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-269954</guid>
					<description>Hi David...I've been pulling out what little hair I have left trying to solve a little problem I'm having communicating between parents and children with AS3.  Thought you may be able to help.  Lets say that you have a master swf. that you load another .swf into via addChild and the URLRequest ect.. If I have a button in the loaded .swf and wanted to communicate back to the parent .swf I would do (and have done with great success) what you described above (MovieClip(this.parent).stop():).  My question is....what if I want to do the opposite.   What if you have a button on the master .swf and want to communicate up to the child swf?  I basically just want to stop the loaded .swf from playing with a button on the main timeline.  (MovieClip(??????).stop)   I've tried everything I can think of and nothing seem to work?  HELP</description>
		<content:encoded><![CDATA[<p>Hi David&#8230;I&#8217;ve been pulling out what little hair I have left trying to solve a little problem I&#8217;m having communicating between parents and children with AS3.  Thought you may be able to help.  Lets say that you have a master swf. that you load another .swf into via addChild and the URLRequest ect.. If I have a button in the loaded .swf and wanted to communicate back to the parent .swf I would do (and have done with great success) what you described above (MovieClip(this.parent).stop():).  My question is&#8230;.what if I want to do the opposite.   What if you have a button on the master .swf and want to communicate up to the child swf?  I basically just want to stop the loaded .swf from playing with a button on the main timeline.  (MovieClip(??????).stop)   I&#8217;ve tried everything I can think of and nothing seem to work?  HELP
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-183408</link>
		<pubDate>Thu, 15 May 2008 04:02:36 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-183408</guid>
					<description>Alex,

Thanks for picking up &lt;em&gt;Foundation&lt;/em&gt;!  I hope you enjoy it!  :)  Tom and I tried to make it fun as well as informative.

As for your non-FLV scrubber, it's definitely a good idea and would make a useful tutorial.  Hearing it as you've described it, two things come to my mind:  a) you'd like to scrub a loaded SWF/movie clip and/or b) you'd like to scrub a series of stills, which are being displayed on a &lt;code&gt;Timer&lt;/code&gt;-run basis.  To accomplish that first one, you could look at the &lt;code&gt;MovieClip.currentFrame&lt;/code&gt; and &lt;code&gt;MovieClip.totalFrames&lt;/code&gt; properties &amp;#8212; those would be comparable to the &lt;code&gt;time&lt;/code&gt; and &lt;code&gt;duration&lt;/code&gt; properties used in cahoots with FLVs in the &lt;a href=&quot;http://www.quip.net/blog/2007/flash/actionscript-20/how-to-build-flv-progress-bar-part2&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;draggable progress bar (AS2) article&lt;/a&gt; elsewhere on this blog.  If you construct knob and track movie clips as described in that other article, the following &amp;#8212; just a rough sketch &amp;#8212; will allow the knob/track combo to scrub the frames of a movie clip with the instance name &lt;code&gt;mc&lt;/code&gt;:

&lt;pre&gt;&lt;code&gt;mc.stop();

var ratio:Number = track.width / mc.totalFrames;
var vertical:Number;

knob.addEventListener(
  MouseEvent.MOUSE_DOWN,
  mouseDownHandler
);
knob.addEventListener(
  MouseEvent.MOUSE_UP,
  mouseUpHandler
);

function mouseDownHandler(evt:MouseEvent):void {
  vertical = track.y + (track.height / 2);
  knob.startDrag(
    true,
    new Rectangle(
      track.x,
      vertical,
      track.width,
      0
    )
  );
  knob.addEventListener(
    MouseEvent.MOUSE_MOVE,
    mouseMoveHandler
  );
}

function mouseUpHandler(evt:MouseEvent):void {
  knob.stopDrag();
  knob.removeEventListener(
    MouseEvent.MOUSE_MOVE,
    mouseMoveHandler
  );
}

function mouseMoveHandler(evt:MouseEvent):void {
  mc.gotoAndStop(
    Math.floor(
      (knob.x - track.x) / ratio
    )
  );
}&lt;/code&gt;&lt;/pre&gt;

Compare that against the AS2 code shown for the video scrubber, and you'll see considerable (almost complete) overlap &amp;#8212; though this version is only a scrubber, not a progress indicator.  A progress indicator would require an update of the knob clip on, say, an &lt;code&gt;ENTER_FRAME&lt;/code&gt; handler.

The trouble with scrubbing SWFs like this is that all it does (at least, as I've shown it) is scrub the SWF's (or movie clip's) main timeline.  Nested timelines &amp;#8212; or, more confoundingly, interior animation generated by ActionScript &amp;#8212; simply isn't something a scrubbing mechanism can accommodate.

If you're talking about the other approach (choice B above), then you could theoretically store your image/still references in an array and &quot;scrub&quot; through the array.  In which case your &lt;code&gt;currentFrame&lt;/code&gt;/&lt;code&gt;totalFrames&lt;/code&gt; equivalents would be a variable for counting (often &lt;code&gt;i&lt;/code&gt;, like you would use in a &lt;code&gt;for&lt;/code&gt; loop) and the &lt;code&gt;Array.length&lt;/code&gt; property.  To make the &quot;scrubbing&quot; actually &lt;em&gt;do&lt;/em&gt; something ... well, that would depend entirely on how the slideshow was programmed. It could definitely get complicated pretty quickly, especially if the scrubber needed to halt and resume a timer.

I do keep a lengthy to-do list for this blog, and your idea(s) are definitely worth writing about, so I've added them to the list.  The only thing iffy about the whole kaboodle is that lately I'm so incredibly behind on this blog!  I'm working on two books at the moment, and that has taken its toll on my Adobe forum presence and this blog.</description>
		<content:encoded><![CDATA[<p>Alex,</p>
<p>Thanks for picking up <em>Foundation</em>!  I hope you enjoy it!  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Tom and I tried to make it fun as well as informative.</p>
<p>As for your non-FLV scrubber, it&#8217;s definitely a good idea and would make a useful tutorial.  Hearing it as you&#8217;ve described it, two things come to my mind:  a) you&#8217;d like to scrub a loaded SWF/movie clip and/or b) you&#8217;d like to scrub a series of stills, which are being displayed on a <code>Timer</code>-run basis.  To accomplish that first one, you could look at the <code>MovieClip.currentFrame</code> and <code>MovieClip.totalFrames</code> properties &mdash; those would be comparable to the <code>time</code> and <code>duration</code> properties used in cahoots with FLVs in the <a href="http://www.quip.net/blog/2007/flash/actionscript-20/how-to-build-flv-progress-bar-part2" target="_blank" rel="nofollow">draggable progress bar (AS2) article</a> elsewhere on this blog.  If you construct knob and track movie clips as described in that other article, the following &mdash; just a rough sketch &mdash; will allow the knob/track combo to scrub the frames of a movie clip with the instance name <code>mc</code>:</p>
<pre><code>mc.stop();

var ratio:Number = track.width / mc.totalFrames;
var vertical:Number;

knob.addEventListener(
  MouseEvent.MOUSE_DOWN,
  mouseDownHandler
);
knob.addEventListener(
  MouseEvent.MOUSE_UP,
  mouseUpHandler
);

function mouseDownHandler(evt:MouseEvent):void {
  vertical = track.y + (track.height / 2);
  knob.startDrag(
    true,
    new Rectangle(
      track.x,
      vertical,
      track.width,
      0
    )
  );
  knob.addEventListener(
    MouseEvent.MOUSE_MOVE,
    mouseMoveHandler
  );
}

function mouseUpHandler(evt:MouseEvent):void {
  knob.stopDrag();
  knob.removeEventListener(
    MouseEvent.MOUSE_MOVE,
    mouseMoveHandler
  );
}

function mouseMoveHandler(evt:MouseEvent):void {
  mc.gotoAndStop(
    Math.floor(
      (knob.x - track.x) / ratio
    )
  );
}</code></pre>
<p>Compare that against the AS2 code shown for the video scrubber, and you&#8217;ll see considerable (almost complete) overlap &mdash; though this version is only a scrubber, not a progress indicator.  A progress indicator would require an update of the knob clip on, say, an <code>ENTER_FRAME</code> handler.</p>
<p>The trouble with scrubbing SWFs like this is that all it does (at least, as I&#8217;ve shown it) is scrub the SWF&#8217;s (or movie clip&#8217;s) main timeline.  Nested timelines &mdash; or, more confoundingly, interior animation generated by ActionScript &mdash; simply isn&#8217;t something a scrubbing mechanism can accommodate.</p>
<p>If you&#8217;re talking about the other approach (choice B above), then you could theoretically store your image/still references in an array and &#8220;scrub&#8221; through the array.  In which case your <code>currentFrame</code>/<code>totalFrames</code> equivalents would be a variable for counting (often <code>i</code>, like you would use in a <code>for</code> loop) and the <code>Array.length</code> property.  To make the &#8220;scrubbing&#8221; actually <em>do</em> something &#8230; well, that would depend entirely on how the slideshow was programmed. It could definitely get complicated pretty quickly, especially if the scrubber needed to halt and resume a timer.</p>
<p>I do keep a lengthy to-do list for this blog, and your idea(s) are definitely worth writing about, so I&#8217;ve added them to the list.  The only thing iffy about the whole kaboodle is that lately I&#8217;m so incredibly behind on this blog!  I&#8217;m working on two books at the moment, and that has taken its toll on my Adobe forum presence and this blog.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Alex Wilson</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-173682</link>
		<pubDate>Thu, 01 May 2008 15:37:34 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-173682</guid>
					<description>Hi David...I really enjoy your blog..you have saved me on more then one occasion.  I'm just getting into AS3 and just bought your Foundation book. 

I have a question and it might be more then you are willing to get into.  I know this may not be the right topic to post this in but I thought of it because you mentioned things like the Timer class and and totalFrames early in the posting.  

I do a lot of audio slide show-type projects where I put down an edited piece of audio down in a layer then a series of photos down under that and create fades (usually all in the main timeline but sometimes I used nested movie clips) and that sort of thing.  I have looked all over the internet, in books and have asked everyone I know about how to make a scrubber bar that could show the progress of the slide show.  The viewer would be able to grab a button on the bar and slide it to go to different points in the slide show.  There are a lot of tutorials on the web about how to build a seek slider bar for .flv files but I can't find any on how to build one for regular flash content.

Like I said, this may be to complex an issue to give a quick answer so I understand if you don't want to deal with it but if you do have a AS3 solution or if you have posted anything similar an another entry or something let me know.  Thanks!</description>
		<content:encoded><![CDATA[<p>Hi David&#8230;I really enjoy your blog..you have saved me on more then one occasion.  I&#8217;m just getting into AS3 and just bought your Foundation book. </p>
<p>I have a question and it might be more then you are willing to get into.  I know this may not be the right topic to post this in but I thought of it because you mentioned things like the Timer class and and totalFrames early in the posting.  </p>
<p>I do a lot of audio slide show-type projects where I put down an edited piece of audio down in a layer then a series of photos down under that and create fades (usually all in the main timeline but sometimes I used nested movie clips) and that sort of thing.  I have looked all over the internet, in books and have asked everyone I know about how to make a scrubber bar that could show the progress of the slide show.  The viewer would be able to grab a button on the bar and slide it to go to different points in the slide show.  There are a lot of tutorials on the web about how to build a seek slider bar for .flv files but I can&#8217;t find any on how to build one for regular flash content.</p>
<p>Like I said, this may be to complex an issue to give a quick answer so I understand if you don&#8217;t want to deal with it but if you do have a AS3 solution or if you have posted anything similar an another entry or something let me know.  Thanks!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-138460</link>
		<pubDate>Sat, 23 Feb 2008 02:16:37 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-138460</guid>
					<description>alan,

For that, you could program a button in the subclip to instruct the main timeline to stop, while instructing the subclip's timeline to play.  Assuming a button instance name of &lt;code&gt;myButton&lt;/code&gt;:

&lt;pre&gt;&lt;code&gt;myButton.addEventListener(
  MouseEvent.MOUSE_UP,
  function(evt:MouseEvent):void {
    MovieClip(this.parent).stop();
    play()
  }
);&lt;/code&gt;&lt;/pre&gt;

Is that what you mean?</description>
		<content:encoded><![CDATA[<p>alan,</p>
<p>For that, you could program a button in the subclip to instruct the main timeline to stop, while instructing the subclip&#8217;s timeline to play.  Assuming a button instance name of <code>myButton</code>:</p>
<pre><code>myButton.addEventListener(
  MouseEvent.MOUSE_UP,
  function(evt:MouseEvent):void {
    MovieClip(this.parent).stop();
    play()
  }
);</code></pre>
<p>Is that what you mean?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: alan</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-132930</link>
		<pubDate>Tue, 12 Feb 2008 15:51:18 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-132930</guid>
					<description>Regarding the pausing action at the top, what if you want more interactivity and continue to play the main timeline whilst paused sub movies appear in the window? I need the user to be able to click on the sub clip whenever they like, (only then would i like the main timeline movie to stop) then once the submovie has played, the main shall resume exactly where it left off.
any ideas please???

Thanks</description>
		<content:encoded><![CDATA[<p>Regarding the pausing action at the top, what if you want more interactivity and continue to play the main timeline whilst paused sub movies appear in the window? I need the user to be able to click on the sub clip whenever they like, (only then would i like the main timeline movie to stop) then once the submovie has played, the main shall resume exactly where it left off.<br />
any ideas please???</p>
<p>Thanks
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-127116</link>
		<pubDate>Fri, 01 Feb 2008 15:11:11 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-127116</guid>
					<description>tunghoy,

Sounds good!  Flash usually provides numerous ways to reach a given goal.</description>
		<content:encoded><![CDATA[<p>tunghoy,</p>
<p>Sounds good!  Flash usually provides numerous ways to reach a given goal.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: tunghoy</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-126759</link>
		<pubDate>Thu, 31 Jan 2008 23:00:58 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-126759</guid>
					<description>OK, what I did was create Pause and Play buttons on a layer in the first MC, then copied and pasted the layer to the other MCs. Using your code for the video and code that I learned for the external sound, I got it working (copying and pasting the code to each MC, also) -- the buttons pause &amp;#38; play the timeline and the sound.

I suppose one day I'll try looping through an array of child MCs so I can have just 1 set of buttons on the main timeline. But that isn't today!

My next part of the project is a mute button. That shouldn't be too hard. I'll get the volume, set it to zero on one click, then set it back to where it was on the next click.</description>
		<content:encoded><![CDATA[<p>OK, what I did was create Pause and Play buttons on a layer in the first MC, then copied and pasted the layer to the other MCs. Using your code for the video and code that I learned for the external sound, I got it working (copying and pasting the code to each MC, also) &#8212; the buttons pause &amp; play the timeline and the sound.</p>
<p>I suppose one day I&#8217;ll try looping through an array of child MCs so I can have just 1 set of buttons on the main timeline. But that isn&#8217;t today!</p>
<p>My next part of the project is a mute button. That shouldn&#8217;t be too hard. I&#8217;ll get the volume, set it to zero on one click, then set it back to where it was on the next click.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-126671</link>
		<pubDate>Thu, 31 Jan 2008 18:10:43 +0000</pubDate>
		<guid>http://www.quip.net/blog/2007/flash/trust-me-as3-its-a-movie-clip#comment-126671</guid>
					<description>tunghoy,

Each of those child MCs has a timeline of its own.  For every timeline you want to stop, you have to invoke a &lt;code&gt;MovieClip.stop()&lt;/code&gt; on it.  The simple pause mechanism on this blog (AS2 and AS3 versions) only pauses the timeline it's in, so to pause the main timeline, you use the code as is; to pause the main timeline and a bunch of movie clips ... well, you'd have to loop through the properties of the main timeline in AS2 (use a &lt;code&gt;for..in&lt;/code&gt; loop), then, using &lt;code&gt;instanceof&lt;/code&gt; to weed out the movie clips, invoke &lt;code&gt;stop()&lt;/code&gt; on the others.  In AS3, you could use a similar approach by checking the children of the display list.

It gets even more complicated for your sounds, if they're ActionScript based.  You'd have to invoke &lt;code&gt;Sound.stop()&lt;/code&gt; (AS2) or &lt;code&gt;SoundChannel.stop()&lt;/code&gt; (AS3) on each of those, or use a global volume toggle.</description>
		<content:encoded><![CDATA[<p>tunghoy,</p>
<p>Each of those child MCs has a timeline of its own.  For every timeline you want to stop, you have to invoke a <code>MovieClip.stop()</code> on it.  The simple pause mechanism on this blog (AS2 and AS3 versions) only pauses the timeline it&#8217;s in, so to pause the main timeline, you use the code as is; to pause the main timeline and a bunch of movie clips &#8230; well, you&#8217;d have to loop through the properties of the main timeline in AS2 (use a <code>for..in</code> loop), then, using <code>instanceof</code> to weed out the movie clips, invoke <code>stop()</code> on the others.  In AS3, you could use a similar approach by checking the children of the display list.</p>
<p>It gets even more complicated for your sounds, if they&#8217;re ActionScript based.  You&#8217;d have to invoke <code>Sound.stop()</code> (AS2) or <code>SoundChannel.stop()</code> (AS3) on each of those, or use a global volume toggle.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

