Skip navigation
DarkRue97
Currently Being Moderated

Flash Builder 4.6 Problem

Apr 4, 2013 2:19 PM

I am getting an error (TypeError: Error #2007: Parameter url must be non-null.

at flash.display::Loader/_load()

at flash.display::Loader/load()

at GameWorld()[C:\Users\Conner\Adobe Flash Builder 4.6\GameWorld\src\GameWorld.as:93])

 

 

and i have no idea how to fix it here is my code:

 

 

package

{

import flash.display.Loader;

import flash.display.Sprite;

import flash.events.MouseEvent;

import flash.net.URLRequest;

 

 

[SWF(width="550", height="400",

backgroundColor="#FFFFFF", frameRate="60")]

 

 

public class GameWorld extends Sprite

{

//Declare the variables we need

public var backgroundURL:URLRequest;

public var backgroundLoader:Loader;

public var background:Sprite;

 

 

//Character

public var characterURL:URLRequest;

public var characterLoader:Loader;

public var character:Sprite;

 

 

//downbutton

public var downButtonURL:URLRequest;

public var downButtonLoader:Loader;

public var downButton:Sprite;

 

 

//growButton

public var growButtonURL:URLRequest;

public var growButtonLoader:Loader;

public var growButton:Sprite;

 

 

//shrinkButton

public var shrinkButtonURL:URLRequest;

public var shrinkButtonLoader:Loader;

public var shrinkButton:Sprite;

 

 

 

 

public function GameWorld()

{

//Add the background to the stage

backgroundURL = new URLRequest();

backgroundLoader = new Loader();

background = new Sprite;

 

 

backgroundURL.url = "../images/background.png";

backgroundLoader.load(backgroundURL)

background.addChild(backgroundLoader);

stage.addChild(background);

 

 

//Add the character to the stage

characterURL = new URLRequest();

characterLoader = new Loader();

character = new Sprite;

 

 

characterURL.url = "../images/character.png";

characterLoader.load(characterURL)

character.addChild(characterLoader)

stage.addChild(character);

character.x = 275;

character.y = 200;

 

 

//Add the downButton to the stage

downButtonURL = new URLRequest();

downButtonLoader = new Loader();

downButton = new Sprite;

 

 

downButtonURL.url = "../images/downButton.png";

downButtonLoader.load(downButtonURL)

downButton.addChild(downButtonLoader);

stage.addChild(downButton)

downButton.x = 5;

downButton.y = 5;

 

 

//Add the growButton to the stage

growButtonURL = new URLRequest();

growButtonLoader = new Loader();

growButton = new Sprite;

 

 

growButtonURL.url = "../images/growButton.png";

growButtonLoader.load(growButtonURL)

growButton.addChild(growButtonLoader)

stage.addChild(growButton)

growButton.x = 5;

growButton.y = 55;

 

 

//Add the shrinkButton to the stage

shrinkButtonURL = new URLRequest();

shrinkButtonLoader = new Loader();

shrinkButton = new Sprite;

 

 

shrinkButtonURL.url "../images/shrinkButton.png";

shrinkButtonLoader.load(shrinkButtonURL)

shrinkButton.addChild(shrinkButtonLoader)

stage.addChild(shrinkButton)

shrinkButton.x = 5;

shrinkButton.y = 85;

}

}

}

 

 

Please can someone tell me what to do. I am a beginner with this stuff.

 

 

Thanks,

DarkRue97

 
Replies
  • Currently Being Moderated
    Apr 8, 2013 11:52 AM   in reply to DarkRue97

    Hi,

     

    It says it is a problem on line 93 of file World.as.

     

    A quick look made me check that this line is not ok shrinkButtonURL.url "../images/shrinkButton.png"; it should have an attribution symbol shrinkButtonURL.url = "../images/shrinkButton.png";

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points