

<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: How to Trigger ActionScript with Text Field Hyperlinks (AS2)</title>
	<atom:link href="http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks/feed" rel="self" type="application/rss+xml" />
	<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks</link>
	<description>Luck is the residue of good design.</description>
	<lastBuildDate>Tue, 20 Mar 2012 15:33:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-104045</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Wed, 21 Nov 2007 02:57:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-104045</guid>
		<description>mike,

I have toyed with that tag idea a bit, actually.  It&#039;s been tough so far, because the &lt;code&gt;&lt;img&gt;&lt;/code&gt; tag in Flash seems to force a line break after itself.  Not sure this is a usable approach, after all ... but if I do figure something out, I&#039;ll be sure to blog about it!</description>
		<content:encoded><![CDATA[<p>mike,</p>
<p>I have toyed with that tag idea a bit, actually.  It&#8217;s been tough so far, because the <code>&lt;img&gt;</code> tag in Flash seems to force a line break after itself.  Not sure this is a usable approach, after all &#8230; but if I do figure something out, I&#8217;ll be sure to blog about it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mike</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-85750</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Wed, 26 Sep 2007 15:21:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-85750</guid>
		<description>have you toyed with that  tag solution yet? i&#039;m lacking a little knowledge on that techinique and could use some insight into how to do it.</description>
		<content:encoded><![CDATA[<p>have you toyed with that  tag solution yet? i&#8217;m lacking a little knowledge on that techinique and could use some insight into how to do it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-65446</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Wed, 18 Jul 2007 14:54:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-65446</guid>
		<description>Jase,

For better or worse, hyperlinks in Flash&#039;s version of HTML only respond to the equivalent of a &lt;code&gt;Button.onRelease&lt;/code&gt; event.  It&#039;s possible to &lt;em&gt;style&lt;/em&gt; hyperlinks with CSS, so that they visually respond to rollovers, but those &quot;quasi-event handlers&quot; can&#039;t be tasked with actually doing anything.

Several months ago, I read an entry in the Adobe ActionScript forum (by kglad, I think) that suggested using movie clips in place of the hyperlinked words.  That is, when you would normally have entered an &lt;code&gt;&lt;a&gt;&lt;/code&gt; tag, use an &lt;code&gt;&lt;img&gt;&lt;/code&gt; tag instead, and set the &lt;code&gt;src&lt;/code&gt; attribute of that tag to the Linkage identifier of a movie clip in your Library.  That movie clip would simply be a symbol that wraps a very small text field with the desired word.  An &lt;code&gt;id&lt;/code&gt; attribute in the same &lt;code&gt;&lt;img&gt;&lt;/code&gt; tag will allow you to assign an instance name to the movie clip in question.

I haven&#039;t toyed with the concept myself, but it&#039;s probably worth a shot.</description>
		<content:encoded><![CDATA[<p>Jase,</p>
<p>For better or worse, hyperlinks in Flash&#8217;s version of HTML only respond to the equivalent of a <code>Button.onRelease</code> event.  It&#8217;s possible to <em>style</em> hyperlinks with CSS, so that they visually respond to rollovers, but those &#8220;quasi-event handlers&#8221; can&#8217;t be tasked with actually doing anything.</p>
<p>Several months ago, I read an entry in the Adobe ActionScript forum (by kglad, I think) that suggested using movie clips in place of the hyperlinked words.  That is, when you would normally have entered an <code>&lt;a&gt;</code> tag, use an <code>&lt;img&gt;</code> tag instead, and set the <code>src</code> attribute of that tag to the Linkage identifier of a movie clip in your Library.  That movie clip would simply be a symbol that wraps a very small text field with the desired word.  An <code>id</code> attribute in the same <code>&lt;img&gt;</code> tag will allow you to assign an instance name to the movie clip in question.</p>
<p>I haven&#8217;t toyed with the concept myself, but it&#8217;s probably worth a shot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jase</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-63044</link>
		<dc:creator>Jase</dc:creator>
		<pubDate>Wed, 11 Jul 2007 14:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-63044</guid>
		<description>Any idea about how this could be used with rollover events in text. I would like to be able to dynamically size my textfield which contains a bunch of words that when moused over should pop-up a MovieClip. Right now I place invisible buttons behind the text, but there has got a be a better way.

Any advice would be great. Thanks.

jase</description>
		<content:encoded><![CDATA[<p>Any idea about how this could be used with rollover events in text. I would like to be able to dynamically size my textfield which contains a bunch of words that when moused over should pop-up a MovieClip. Right now I place invisible buttons behind the text, but there has got a be a better way.</p>
<p>Any advice would be great. Thanks.</p>
<p>jase</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-1352</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Thu, 27 Jul 2006 14:03:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-1352</guid>
		<description>Glad to hear it, Toby!  :)</description>
		<content:encoded><![CDATA[<p>Glad to hear it, Toby!  <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: Toby Miller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-1348</link>
		<dc:creator>Toby Miller</dc:creator>
		<pubDate>Thu, 27 Jul 2006 13:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-1348</guid>
		<description>This is great, I really appreciate the article ... it saved my ass this morning. =)</description>
		<content:encoded><![CDATA[<p>This is great, I really appreciate the article &#8230; it saved my ass this morning. =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Stiller</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-584</link>
		<dc:creator>David Stiller</dc:creator>
		<pubDate>Sun, 25 Jun 2006 17:46:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-584</guid>
		<description>Good thinking, NSurveyor!  It&#039;s funny, as soon as I published that one, the &lt;code&gt;String.split()&lt;/code&gt; method occurred to me.  But I didn&#039;t log back in to update the article.  Glad you posted your thoughts.  :)  Some of my best insights come to me when I finally stop thinking about it.</description>
		<content:encoded><![CDATA[<p>Good thinking, NSurveyor!  It&#8217;s funny, as soon as I published that one, the <code>String.split()</code> method occurred to me.  But I didn&#8217;t log back in to update the article.  Glad you posted your thoughts.  <img src='http://www.quip.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   Some of my best insights come to me when I finally stop thinking about it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NSurveyor</title>
		<link>http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-567</link>
		<dc:creator>NSurveyor</dc:creator>
		<pubDate>Sat, 24 Jun 2006 23:12:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.quip.net/blog/2006/flash/how-to-trigger-actionscript-with-hyperlinks#comment-567</guid>
		<description>When I use it and I need multiple parameters, I would define a custom function that would split the only parameter on commas, giving me essentially my arguments in an array. For example:

&lt;pre&gt;&lt;code&gt;function makeSomethingHappen(info:String) {
  var args = info.split(&#039;,&#039;);
  var what:String = args[0];
  var when:Date = new Date(Number(args[1]));
  var where:MovieClip = eval(args[2]);
  if (new Date()&gt;when) {
    where[what]();
  }	
}
stop();&lt;/code&gt;&lt;/pre&gt;


&lt;pre&gt;&lt;code&gt;&quot;asfunction:makeSomethingHappen,play,234,_root&quot;&lt;/code&gt;&lt;/pre&gt;
will make the root play when you click on it, because 234 represents Dec 31, 1969, which has alrady passed. 

&lt;pre&gt;&lt;code&gt;&quot;asfunction:makeSomethingHappen,play,2151190071921,_root&quot;&lt;/code&gt;&lt;/pre&gt;
will NOT make the root play when you click on it, because 2151190071921 represents Mar 2, 2038 which has not occurred yet.

Though this doesn&#039;t work well when one of your &quot;parameters&quot; is a string with commas in it... I guess you could choose another character for the delimeter.

Also, you can use asfunction in a textfile, and then load it into a html enabled textfield. Something like:

&lt;pre&gt;&lt;code&gt;&lt;a href=&quot;_root.unloadMovie&quot; rel=&quot;nofollow&quot;&gt;Bye bye!&lt;/a&gt;&lt;/code&gt;&lt;/pre&gt;

inside the text doc, myText.txt

Then in flash, something like:

&lt;pre&gt;&lt;code&gt;my_lv = new LoadVars();
my_lv.onData = function(r){
my_txt.html = true;
my_txt.htmlText = r;
}
my_lv.load(&quot;myText.txt&quot;);&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>When I use it and I need multiple parameters, I would define a custom function that would split the only parameter on commas, giving me essentially my arguments in an array. For example:</p>
<pre><code>function makeSomethingHappen(info:String) {
  var args = info.split(',');
  var what:String = args[0];
  var when:Date = new Date(Number(args[1]));
  var where:MovieClip = eval(args[2]);
  if (new Date()&gt;when) {
    where[what]();
  }
}
stop();</code></pre>
<pre><code>"asfunction:makeSomethingHappen,play,234,_root"</code></pre>
<p>will make the root play when you click on it, because 234 represents Dec 31, 1969, which has alrady passed. </p>
<pre><code>"asfunction:makeSomethingHappen,play,2151190071921,_root"</code></pre>
<p>will NOT make the root play when you click on it, because 2151190071921 represents Mar 2, 2038 which has not occurred yet.</p>
<p>Though this doesn&#8217;t work well when one of your &#8220;parameters&#8221; is a string with commas in it&#8230; I guess you could choose another character for the delimeter.</p>
<p>Also, you can use asfunction in a textfile, and then load it into a html enabled textfield. Something like:</p>
<pre><code>&lt;a href="_root.unloadMovie" rel="nofollow"&gt;Bye bye!&lt;/a&gt;</code></pre>
<p>inside the text doc, myText.txt</p>
<p>Then in flash, something like:</p>
<pre><code>my_lv = new LoadVars();
my_lv.onData = function(r){
my_txt.html = true;
my_txt.htmlText = r;
}
my_lv.load("myText.txt");</code></pre>
]]></content:encoded>
	</item>
</channel>
</rss>

