# AS2 - Count Impressions using an external counting link?

**URL:** <https://forum.kirupa.com/t/as2-count-impressions-using-an-external-counting-link/287922>\
**Category:** flash\
**Created:** [May 7, 2009, 9:04pm UTC](https://forum.kirupa.com/t/as2-count-impressions-using-an-external-counting-link/287922 "2009-05-07T21:04:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CEOofAEP](https://avatars.discourse-cdn.com/v4/letter/c/7cd45c/32.png) [@CEOofAEP](https://forum.kirupa.com/u/CEOofAEP)\
**Post date:** [May 7, 2009, 9:04pm UTC](https://forum.kirupa.com/t/as2-count-impressions-using-an-external-counting-link/287922/1 "2009-05-07T21:04:18Z")

</div>

Hello all 🙂

It’s been a while but I am once again desperate enough to post on here =)

I made a flash video player for a customer and it’s all working well- but there is one problem:

They want to count impressions (how many times a video was played).

I managed to achieve this before, using loadVars to call the link.

It works when I run the SWF on my PC (the link to call being on an external server) but it doesn’t work anymore, once the SWF is on the server.

I don’t want to make any assumptions what might cause this- because I don’t want to “taint” the possible answers coming from you experts out there =)

This is the code excerpt (the link is just an example):

```auto
var counting_pixel = "http://www.theserver.com/reporting/count.php";
newURL = new LoadVars();
newURL.onLoad = function (success)
{
    if (!success) 
    {
        trace("FAILED TO LOAD");
        return;
    }
    trace("SUCCESS");
}
newURL.load(counting_pixel);

```

When the file runs locally, it traces “SUCCESS” but now that it’s on the customer’s server, it fails.

The problem (as I see it) might be, that the data that is “loaded” is on a different server, while the scope is limited to local access…

But I need the local access because the SWF loads an XML from the customer’s server (the XML contains the path to the FLV)… so I can’t just set the SWF’s scope from local to external… or can I? Am I misunderstanding this? ^^;

Thanks in advance for your help (and your tolerance for my stupid questions ^^)
