brendanb
02-08-2008, 07:34 PM
Hi, I'm wondering if you can run an external js file by clicking on a button in flash. Previously, I used code like this when the js file was embedded in the html page:
import flash.external.*;
ExternalInterface.call("urchinTracker('/main/scene01');");
But since I have to call the js from an external file, how would I do that? This seems wrong, but I have no idea how to do it(this isn't my code, I'm just trying to finish a project someone else started):
on (release) {
import flash.external.*;
getURL(_root.clickTag, "_blank");
ExternalInterface.call("http://ad.doubleclick.net/adj/N2335.howstuffworks/B2608319.11;sz=1x1;ord=%%REALRAND%%?");
}
the js from the external file is here:
document.write('<!-- Template Id = 2460 Template Name = Image Banner with Insight Express AdInsights Flex Tag -->\n<!-- Copyright 2002 DoubleClick Inc., All rights reserved. --><a href=\"http://ad.doubleclick.net/click%3Bh=v8/3660/3/0/%2a/g%3B168072640%3B0-0%3B0%3B23345489%3B31-1/1%3B24638822/24656675/1%3B%3B%7Esscs%3D%3fhttp://www.radioshack.com/home/index.jsp?Source=OLM:Q1GenMkt_Q1GenMkt:1:801010803 31:NA:A\" target=\"_top\"><img src=\"http://m1.2mdn.net/961941/default_1x1.gif\" border=\"0\"></a><script language=\"javascript\" src=\"http://core.insightexpressai.com/adServer/adServerESI.aspx?bannerID=26632&siteID=N2335.howstuffworks&creativeID=24638822\"><\/script>');document.write('');
Thanks for all the help! I'm a huge noob when it comes to javascript
import flash.external.*;
ExternalInterface.call("urchinTracker('/main/scene01');");
But since I have to call the js from an external file, how would I do that? This seems wrong, but I have no idea how to do it(this isn't my code, I'm just trying to finish a project someone else started):
on (release) {
import flash.external.*;
getURL(_root.clickTag, "_blank");
ExternalInterface.call("http://ad.doubleclick.net/adj/N2335.howstuffworks/B2608319.11;sz=1x1;ord=%%REALRAND%%?");
}
the js from the external file is here:
document.write('<!-- Template Id = 2460 Template Name = Image Banner with Insight Express AdInsights Flex Tag -->\n<!-- Copyright 2002 DoubleClick Inc., All rights reserved. --><a href=\"http://ad.doubleclick.net/click%3Bh=v8/3660/3/0/%2a/g%3B168072640%3B0-0%3B0%3B23345489%3B31-1/1%3B24638822/24656675/1%3B%3B%7Esscs%3D%3fhttp://www.radioshack.com/home/index.jsp?Source=OLM:Q1GenMkt_Q1GenMkt:1:801010803 31:NA:A\" target=\"_top\"><img src=\"http://m1.2mdn.net/961941/default_1x1.gif\" border=\"0\"></a><script language=\"javascript\" src=\"http://core.insightexpressai.com/adServer/adServerESI.aspx?bannerID=26632&siteID=N2335.howstuffworks&creativeID=24638822\"><\/script>');document.write('');
Thanks for all the help! I'm a huge noob when it comes to javascript