<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

      <title>Comments on: When Flash invokes a Javascript function via GETURL which refers to THIS, what object is THIS pointing to?</title>
      <link>http://ask.metafilter.com/13754/When-Flash-invokes-a-Javascript-function-via-GETURL-which-refers-to-THIS-what-object-is-THIS-pointing-to/</link>
      <description>Comments on Ask MetaFilter post When Flash invokes a Javascript function via GETURL which refers to THIS, what object is THIS pointing to?</description>
	  	  <pubDate>Fri, 07 Jan 2005 12:24:37 -0800</pubDate>
      <lastBuildDate>Fri, 07 Jan 2005 12:24:37 -0800</lastBuildDate>
      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>

<item>
  	<title>Question: When Flash invokes a Javascript function via GETURL which refers to THIS, what object is THIS pointing to?</title>
  	<link>http://ask.metafilter.com/13754/When-Flash-invokes-a-Javascript-function-via-GETURL-which-refers-to-THIS-what-object-is-THIS-pointing-to</link>	
  	<description>When Flash invokes a Javascript function via &lt;tt&gt;&lt;b&gt;getURL&lt;/b&gt;&lt;/tt&gt; which refers to &lt;tt&gt;&lt;b&gt;this&lt;/b&gt;&lt;/tt&gt;, what object is &lt;tt&gt;&lt;b&gt;this&lt;/b&gt;&lt;/tt&gt; pointing to? [More&amp;#0187;] &lt;br /&gt;&lt;br /&gt; I&apos;m looking for a means by which a Flash object can affect its own presentation without requiring external code, and &lt;tt&gt;&lt;b&gt;this&lt;/b&gt;&lt;/tt&gt; doesn&apos;t seem to map to a standard DOM object.  For example, this bit of ActionScript:&lt;br&gt;
&lt;br&gt;
&lt;tt&gt;getURL(&quot;javascript:this.style.border=&apos;4px solid red&apos;;&quot;);&lt;/tt&gt;&lt;br&gt;
&lt;br&gt;
&lt;i&gt;should&lt;/i&gt; produce the intended effect, but simply throws an error claiming &lt;tt&gt;&lt;b&gt;this.style&lt;/b&gt;&lt;/tt&gt; is undefined.  I am perplexed.</description>
  	<guid isPermaLink="false">post:ask.metafilter.com,2005:site.13754</guid>
  	<pubDate>Fri, 07 Jan 2005 11:49:30 -0800</pubDate>
  	<dc:creator>Danelope</dc:creator>
	
	<category>flash</category>
	
	<category>javascript</category>
	
</item>
<item>
  	<title>By: kindall</title>
  	<link>http://ask.metafilter.com/13754/When-Flash-invokes-a-Javascript-function-via-GETURL-which-refers-to-THIS-what-object-is-THIS-pointing-to#237478</link>	
  	<description>&amp;quot;this&amp;quot; refers to whatever DOM object the script is attached to via a handler (e.g. onClick, onMouseOver, onLoad, etc.). As a URL, that script isn&apos;t attached to a DOM object.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.13754-237478</guid>
  	<pubDate>Fri, 07 Jan 2005 12:24:37 -0800</pubDate>
  	<dc:creator>kindall</dc:creator>
</item>
<item>
  	<title>By: yerfatma</title>
  	<link>http://ask.metafilter.com/13754/When-Flash-invokes-a-Javascript-function-via-GETURL-which-refers-to-THIS-what-object-is-THIS-pointing-to#237623</link>	
  	<description>kindall knows (apparently) more about it than I do, but I can back what he&apos;s saying: you can&apos;t pass &lt;code&gt;this&lt;/code&gt; from an anchor tag for some reason that&apos;s probably clearly (and sensibly) delineated in the specs. Well, you can pass it, but it doesn&apos;t work the way it does with every other element. In my experience.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.13754-237623</guid>
  	<pubDate>Fri, 07 Jan 2005 15:14:28 -0800</pubDate>
  	<dc:creator>yerfatma</dc:creator>
</item>
<item>
  	<title>By: Khalad</title>
  	<link>http://ask.metafilter.com/13754/When-Flash-invokes-a-Javascript-function-via-GETURL-which-refers-to-THIS-what-object-is-THIS-pointing-to#237676</link>	
  	<description>You could assign the Flash object an ID, and then use something like&lt;br&gt;
&lt;br&gt;
&lt;c&gt;document.getElementId(&apos;flash&apos;).style.border = &apos;4px solid red&apos;&lt;/c&gt;&lt;br&gt;
&lt;br&gt;
(Caveat: I have not testing this...)</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.13754-237676</guid>
  	<pubDate>Fri, 07 Jan 2005 16:45:25 -0800</pubDate>
  	<dc:creator>Khalad</dc:creator>
</item>
<item>
  	<title>By: BobInce</title>
  	<link>http://ask.metafilter.com/13754/When-Flash-invokes-a-Javascript-function-via-GETURL-which-refers-to-THIS-what-object-is-THIS-pointing-to#237708</link>	
  	<description>window.&lt;br&gt;
&lt;br&gt;
When a method is called, &apos;this&apos; points to the object the method was grabbed from. This is somewhat odd as it means that unlike in many programming languages:&lt;br&gt;
&lt;br&gt;
  object.foo();&lt;br&gt;
&lt;br&gt;
behaves differently to:&lt;br&gt;
&lt;br&gt;
  var boing= object.foo;&lt;br&gt;
  boing();&lt;br&gt;
&lt;br&gt;
If the case like this where &apos;boing&apos; is called as a function instead of a method, &apos;this&apos; doesn&apos;t get assigned to any object, so it&apos;s the global object which for a web browser is &apos;window&apos;.&lt;br&gt;
&lt;br&gt;
So, yeah, forget &apos;this&apos; and use something along the lines of getElementById.</description>
  	<guid isPermaLink="false">comment:ask.metafilter.com,2005:site.13754-237708</guid>
  	<pubDate>Fri, 07 Jan 2005 17:56:06 -0800</pubDate>
  	<dc:creator>BobInce</dc:creator>
</item>

    </channel>
</rss>
