After creating a work around, I discovered that the code generated by the expression (THREE.ImageUtils/loadTexture map-url) generates a warning that the compiler cannot find the THREE.ImageUtils namespace and then fails at run time. However, code generated by the expression (. THREE.ImageUtils loadTexture map-url) works.
I thought that these two expressions were identical. On Monday, March 31, 2014 4:00:37 PM UTC-5, Larry Jones wrote: > I am porting some of the code in "WebGL: Up and Running" to ClojureScript. > > The second JavaScript program the author presents is called "Welcome to > WebGL" (example 2-2 and following). > > To create a texture, I invoke the utility method > THREE.ImageUtils.loadTexture(url). When I run my code I see the error > message: "Uncaught TypeError: Cannot read property 'crossOrigin' of null." > When I examine the source code of loadTexture(), I see that the second line > is "loader.crossOrigin = this.crossOrigin;" In my environment, this is null > so this line files. > > Because the example code runs in an inline script, I tried moving the call to > THREE.ImageUtils.loadTexture() into an inline script. When I made this > change, to my surprise, the this pointer actually had a value. > > What must I do to set the value of the this pointer in my method > appropriately? > > Thanks. -- Note that posts from new members are moderated - please be patient with your first post. --- You received this message because you are subscribed to the Google Groups "ClojureScript" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/clojurescript.
