Skip to content

spirit posteets tagged flash

 

  • 7 years ago
    1. // Track 404 pages. Replace your GA tracking code (http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=86927):
    2. <script type=“text/javascript”>
    3. var gaJsHost = ((“https:” == document.location.protocol) ? ” https://ssl .” : “http://www.”);
    4. document.write(unescape(“%3Cscript src='” + gaJsHost + ” google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
    5. </script>
    6. <script type=“text/javascript”>
    7. var pageTracker = _gat._getTracker(“UA-xxxxx-x”);
    8. pageTracker._trackPageview(“/404.html?page=” + document.location.pathname + document.location.search + “&from=” + document.referrer);
    9. </script>
    10. //————————————————————————-
    11. // Classify your site visitors (http://www.google.com/support/analytics/bin/answer.py?answer=57045&ctx=sibling)
    12. <script type=“text/javascript”>pageTracker._setVar(‘Marketing’);</script>
    13. //————————————————————————-
    14. // Track your (outgoing) links/ads banner or downloads (http://www.google.com/support/analytics/bin/answer.py?answer=55526)
    15. <a href=“http://www.example.com” onClick=“javascript: pageTracker._trackPageview(‘/outgoing/example.com’);”>
    16. // For flash ads for example:
    17. on(release) {
    18. getURL(“javascript: pageTracker._trackPageview
    19. (‘/bannerads/advertisername/bannername’);”);
    20. getURL(“http://www.advertisersite.com”);
    21. }
  • 7 years ago
    This little trick allows a Flash movie (swf) to find out the URL of the page in which it’s embedded. Javascript must be enabled for this to work. if the window.location.href.toString method doesn’t return a value then ExternalInterface.call will return null. Same thing happens when Javascript is disabled.
    1. // This little trick allows a Flash movie (swf) to find out the URL of the page in which it’s embedded.
    2. import flash.external.ExternalInterface;
    3. var pageURL:String =
    4.         ExternalInterface.call(‘window.location.href.toString’);
  • 8 years ago
    1. function replace(str:String,find:String,replace:String):String
    2. {
    3.         var index:Number;
    4.         while(str.indexOf(find)!=-1)
    5.         {
    6.                 index= str.indexOf(find);
    7.                 str = str.substr(0,index) + replace + str.substr(index + find.length);
    8.         }
    9.         return str;
    10. }

    “flash” related tags

    spirit’s tags