# Problems with External swfs

**URL:** https://forum.kirupa.com/t/problems-with-external-swfs/268836
**Category:** flash
**Created:** [August 19, 2008, 4:01pm UTC](https://forum.kirupa.com/t/problems-with-external-swfs/268836 "2008-08-19T16:01:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Kirbyprime](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@Kirbyprime](https://forum.kirupa.com/u/Kirbyprime)
#### Post date: [August 19, 2008, 4:01pm UTC](https://forum.kirupa.com/t/problems-with-external-swfs/268836/1 "2008-08-19T16:01:01Z")

</div>

I really have no clue what’s wrong with this =( I’m sure it worked a few weeks ago, and I don’t even remember changing the code after it worked, but now it keeps popping up a 1009 error: Cannot access a property or method of a null object reference. This is driving me nuts \>\< Please help.

```auto

import gs.TweenLite;
import gs.easing.*;

var section:Loader = new Loader();

section.load(new URLRequest("Ripple Actions.swf"));
section.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loadingContent);
section.contentLoaderInfo.addEventListener(Event.COMPLETE, loadComplete);

function loadingContent(event:ProgressEvent):void {
    var loaded:Number = event.bytesLoaded / event.bytesTotal;
    var bytesLoad:String = event.bytesLoaded.toString();
    var bytesT:String = event.bytesTotal.toString();

    //preloader.SetProgress(loaded);
}
function loadComplete(event:Event):void {
    content_mc.addChild(section);
}

```

The code for the swf being called is pretty simple, not sure why it won’t work.

```auto

var mouseXPos:uint = 0;
var mouseYPos:uint = 0;

Main();

function Main():void {
    stage.addEventListener(MouseEvent.CLICK, mousePos);
    stage.addEventListener(MouseEvent.CLICK, scaleCircle);
    stage.addEventListener(MouseEvent.CLICK, ripple);
}

function mousePos (event:MouseEvent):void {
    mouseXPos = mouseX;
    mouseYPos = mouseY;
    
    trace (mouseXPos);
    trace (mouseYPos);
}
function ripple (event:MouseEvent):void {
    var rippleDelay:Timer = new Timer(450, 6);
    rippleDelay.addEventListener(TimerEvent.TIMER, scaleCircle);
    rippleDelay.start();
}

function scaleCircle (event:Event):void {
    var newCircle:Ripple = new Ripple();
    this.addChild(newCircle);
    newCircle.x = mouseXPos;
    newCircle.y = mouseYPos;
    newCircle.scaleX = 0.01;
    newCircle.scaleY = 0.01;
    newCircle.alpha = .8;
    newCircle.addEventListener(Event.ENTER_FRAME,ZoomCircle);
}

function ZoomCircle(event:Event):void {
    var circleMc:MovieClip = MovieClip(event.target);
    circleMc.scaleX += .05;
    circleMc.scaleY += .05;
    
    if (circleMc.scaleX <= 0.5) {
        circleMc.alpha += .03;
    }
    else {
        circleMc.alpha -= .01;
    }
    if (circleMc.alpha <= 0) {
        circleMc.removeEventListener(Event.ENTER_FRAME, ZoomCircle);
    }
}

```
