

































<?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 Trigger Event Handlers of Other Objects</title>
	<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers</link>
	<description>Luck is the residue of good design.</description>
	<pubDate>Wed, 08 Feb 2012 15:33:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.2</generator>

	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-123088</link>
		<pubDate>Tue, 22 Jan 2008 15:20:43 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-123088</guid>
					<description>kasim,

In order to trigger actions or responses on someone else's computer, Flash needs the sort of complex infrastructure provided by something like Flash Media Server.  On its own, Flash Play cannot do what you're hoping for.</description>
		<content:encoded><![CDATA[<p>kasim,</p>
<p>In order to trigger actions or responses on someone else&#8217;s computer, Flash needs the sort of complex infrastructure provided by something like Flash Media Server.  On its own, Flash Play cannot do what you&#8217;re hoping for.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: kasim</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-123027</link>
		<pubDate>Tue, 22 Jan 2008 10:51:06 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-123027</guid>
					<description>Dear sir, 
i want to make one application in flash, i want if i click one button in my department, it should triger one swf file to other department and thre will be one sound, 

hope u will help me, 

regards

kasim</description>
		<content:encoded><![CDATA[<p>Dear sir,<br />
i want to make one application in flash, i want if i click one button in my department, it should triger one swf file to other department and thre will be one sound, </p>
<p>hope u will help me, </p>
<p>regards</p>
<p>kasim
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-98018</link>
		<pubDate>Wed, 07 Nov 2007 04:32:52 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-98018</guid>
					<description>Broc,

Sure thing.  Based on your description, you might try something like this:

&lt;pre&gt;&lt;code&gt;myButton.onRollOut = function():Void {
  if (this._currentframe == 1) {
    // do whatever ...
  }
}&lt;/code&gt;&lt;/pre&gt;

That movie clip symbol with the instance name &lt;code&gt;myButton&lt;/code&gt;.  The &lt;code&gt;if&lt;/code&gt; statement checks if the current frame of that button is 1 &amp;#8212; if so, it performs whatever you tell it to; if not (because, for example, a previous &lt;code&gt;onPress&lt;/code&gt; event has sent it to frame 2), it won't do anything.  Or you could add an &lt;code&gt;else&lt;/code&gt; clause for additional instructions.

Pretty straightforward, as you imagined.  :)

P.S.  Because this particular blog entry is entitled &quot;How to Trigger Event Handlers of Other Objects,&quot; I feel I should add that I don't see (so far) where you might need to trigger event handlers of other objects, but maybe you've already got that part solid.</description>
		<content:encoded><![CDATA[<p>Broc,</p>
<p>Sure thing.  Based on your description, you might try something like this:</p>
<pre><code>myButton.onRollOut = function():Void {
  if (this._currentframe == 1) {
    // do whatever ...
  }
}</code></pre>
<p>That movie clip symbol with the instance name <code>myButton</code>.  The <code>if</code> statement checks if the current frame of that button is 1 &mdash; if so, it performs whatever you tell it to; if not (because, for example, a previous <code>onPress</code> event has sent it to frame 2), it won&#8217;t do anything.  Or you could add an <code>else</code> clause for additional instructions.</p>
<p>Pretty straightforward, as you imagined.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>P.S.  Because this particular blog entry is entitled &#8220;How to Trigger Event Handlers of Other Objects,&#8221; I feel I should add that I don&#8217;t see (so far) where you might need to trigger event handlers of other objects, but maybe you&#8217;ve already got that part solid.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Broc</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-97955</link>
		<pubDate>Tue, 06 Nov 2007 23:49:14 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-97955</guid>
					<description>Hello David,
I'd like to thank you for facilitating this complex procedure!

I'm using this tutorial to build a project, but I'm having trouble altering it to fit my needs. I want to be able to click on a button and have it go to frame 2, also. The problem is that everytime I rollOut, it goes back to frame 1. 

I have a feeling I need a function and conditional in my rollOut event handler. I've tried it, but I'm not having much luck.

I figured you might have some answers.

Thanks.</description>
		<content:encoded><![CDATA[<p>Hello David,<br />
I&#8217;d like to thank you for facilitating this complex procedure!</p>
<p>I&#8217;m using this tutorial to build a project, but I&#8217;m having trouble altering it to fit my needs. I want to be able to click on a button and have it go to frame 2, also. The problem is that everytime I rollOut, it goes back to frame 1. </p>
<p>I have a feeling I need a function and conditional in my rollOut event handler. I&#8217;ve tried it, but I&#8217;m not having much luck.</p>
<p>I figured you might have some answers.</p>
<p>Thanks.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-49101</link>
		<pubDate>Fri, 01 Jun 2007 21:22:27 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-49101</guid>
					<description>&lt;strong&gt;To Bill ...&lt;/strong&gt;

I'm not clear from your comments if you managed to get Flash to &quot;understand&quot; when an answer has been dragged correctly vs. incorrectly.  You said you got the dragging part figured out.  I imagine you're using &lt;code&gt;MovieClip.hitTest()&lt;/code&gt;, and then comparing the values of things with an &lt;code&gt;if&lt;/code&gt; statement.  If so, then triggering movie clips is a matter of referencing the clip in question and invoking its &lt;code&gt;MovieClip.play()&lt;/code&gt; method (or &lt;code&gt;gotoAndPlay()&lt;/code&gt; or whatever makes sense).  To test against scores you might use another &lt;code&gt;if&lt;/code&gt; and reference a variety of clips in your &lt;code&gt;else&lt;/code&gt; clauses (or a variety of frame labels in a single movie clip).

There are virtually countless possibilities, of course, but based on your description I'm afraid I can't envision the particulars of your scenario in my mind.

&lt;strong&gt;To Riff ...&lt;/strong&gt;

This might sound awful, but here, too, I'm afraid I can't &quot;see&quot; the mechanics of what's going on beneath your question.  Bill's scenario and yours may benefit from the topic of this blog entry (triggering events handlers of other objects), but then again, you might both benefit from &lt;a href=&quot;http://www.quip.net/blog/2006/flash/actionscript-20/how-to-raise-events-eventdispatcher/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;handling custom dispatched events&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p><strong>To Bill &#8230;</strong></p>
<p>I&#8217;m not clear from your comments if you managed to get Flash to &#8220;understand&#8221; when an answer has been dragged correctly vs. incorrectly.  You said you got the dragging part figured out.  I imagine you&#8217;re using <code>MovieClip.hitTest()</code>, and then comparing the values of things with an <code>if</code> statement.  If so, then triggering movie clips is a matter of referencing the clip in question and invoking its <code>MovieClip.play()</code> method (or <code>gotoAndPlay()</code> or whatever makes sense).  To test against scores you might use another <code>if</code> and reference a variety of clips in your <code>else</code> clauses (or a variety of frame labels in a single movie clip).</p>
<p>There are virtually countless possibilities, of course, but based on your description I&#8217;m afraid I can&#8217;t envision the particulars of your scenario in my mind.</p>
<p><strong>To Riff &#8230;</strong></p>
<p>This might sound awful, but here, too, I&#8217;m afraid I can&#8217;t &#8220;see&#8221; the mechanics of what&#8217;s going on beneath your question.  Bill&#8217;s scenario and yours may benefit from the topic of this blog entry (triggering events handlers of other objects), but then again, you might both benefit from <a href="http://www.quip.net/blog/2006/flash/actionscript-20/how-to-raise-events-eventdispatcher/" target="_blank" rel="nofollow">handling custom dispatched events</a>.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Riff</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-47461</link>
		<pubDate>Sat, 26 May 2007 17:17:53 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-47461</guid>
					<description>Hi Dave,

Excellent tutoring!. My problem is I need to control 1 mc with two sets of buttons using arrays. Its an interactive map by which users can rollover 1.country map and/or 2.country name for an interaction. 
The country map increases in size with a rollover and reverts on rollout.  The country name buttons also does this.

I managed to get the rollover country map array to work but cant figure out how to attach the country name to the same interaction. I'm losing sleep over this!

Appreciate if you could help. Thanks in advance.</description>
		<content:encoded><![CDATA[<p>Hi Dave,</p>
<p>Excellent tutoring!. My problem is I need to control 1 mc with two sets of buttons using arrays. Its an interactive map by which users can rollover 1.country map and/or 2.country name for an interaction.<br />
The country map increases in size with a rollover and reverts on rollout.  The country name buttons also does this.</p>
<p>I managed to get the rollover country map array to work but cant figure out how to attach the country name to the same interaction. I&#8217;m losing sleep over this!</p>
<p>Appreciate if you could help. Thanks in advance.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Bill Bond</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-46789</link>
		<pubDate>Tue, 22 May 2007 17:19:59 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-46789</guid>
					<description>Hi Dave,  As a newcomer to ActionScript, I'm trying to create a drag and drop quiz,  and so far have managed to drag &quot;answers&quot; into &quot;question&quot; targets using variable text to give right or wrong comments.  I've also got a final score sorted out. What is evading me though, and not for want of experimenting, is the script to have a right or wrong answer trigger a movieClip or animation, and similarly an animation trigger to launch various animations depending on final scores... Sounds like you might be a man who knows...  Any help here would be greatly appreciated.

All the best

Bill</description>
		<content:encoded><![CDATA[<p>Hi Dave,  As a newcomer to ActionScript, I&#8217;m trying to create a drag and drop quiz,  and so far have managed to drag &#8220;answers&#8221; into &#8220;question&#8221; targets using variable text to give right or wrong comments.  I&#8217;ve also got a final score sorted out. What is evading me though, and not for want of experimenting, is the script to have a right or wrong answer trigger a movieClip or animation, and similarly an animation trigger to launch various animations depending on final scores&#8230; Sounds like you might be a man who knows&#8230;  Any help here would be greatly appreciated.</p>
<p>All the best</p>
<p>Bill
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-45105</link>
		<pubDate>Mon, 14 May 2007 02:28:30 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-45105</guid>
					<description>David,

Glad to help!  :)</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>Glad to 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: David</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-44003</link>
		<pubDate>Wed, 09 May 2007 19:48:27 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-44003</guid>
					<description>Thanks, your explanation of dynamic referencing was a godsend. I just wish I had read it sooner!</description>
		<content:encoded><![CDATA[<p>Thanks, your explanation of dynamic referencing was a godsend. I just wish I had read it sooner!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-42044</link>
		<pubDate>Tue, 01 May 2007 08:06:04 +0000</pubDate>
		<guid>http://www.quip.net/blog/2006/flash/actionscript-20/how-to-trigger-other-object-event-handlers#comment-42044</guid>
					<description>eddie,

It looks like your &lt;code&gt;button1_mc&lt;/code&gt; is actually a movie clip that is programmed to respond like a button.  If that's so, and if you want both clip &quot;buttons&quot; to go to frame 2 of their own timelines and stop, you could do this:

&lt;pre&gt;&lt;code&gt;button1_mc.onRollOver = function () {
  this.gotoAndStop(2);
  button1_mc2.gotoAndStop(2);
}

button1_mc2.onRollOver = function () {
  this.gotoAndStop(2);
  button1_mc.gotoAndStop(2);
}&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>eddie,</p>
<p>It looks like your <code>button1_mc</code> is actually a movie clip that is programmed to respond like a button.  If that&#8217;s so, and if you want both clip &#8220;buttons&#8221; to go to frame 2 of their own timelines and stop, you could do this:</p>
<pre><code>button1_mc.onRollOver = function () {
  this.gotoAndStop(2);
  button1_mc2.gotoAndStop(2);
}

button1_mc2.onRollOver = function () {
  this.gotoAndStop(2);
  button1_mc.gotoAndStop(2);
}</code></pre>
]]></content:encoded>
				</item>
</channel>
</rss>

