Skip to main content
Participant
June 12, 2014
Question

Doesnt show up the Image, Action Script 3.

  • June 12, 2014
  • 2 replies
  • 391 views

This is my code :

package

{

  import flash.display.Sprite;

  import flash.display.Loader;

  import flash.display.Sprite;

  import flash.net.URLRequest;

  import flash.net.URLLoader;

  import flash.events.MouseEvent;

  public class Prueba extends Sprite

  {

  public var playGameButton:Sprite;

  public var playGameButtonURL:URLRequest;

  public var playGameButtonLoader:Loader;

  public function Prueba()

  {

  playGameButton = new Sprite();

  playGameButtonURL = new URLRequest();

  playGameButtonLoader = new Loader();

  playGameButtonURL = "../images/ReplayButton.png";  //Error 1067 Implicit coercion of value of type String to an unrealated type flash.net:URLRequest.

  playGameButtonLoader(playGameButtonURL);     //Error 1180

  playGameButton.addChild(playGameButtonLoader);

  stage.addChild(playGameButton);

  playGameButton.y = 0;

  playGameButton.x = 0;

  }

  }

}

Thanks, Michael.

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
June 12, 2014

Try changing that to be:

playGameButtonURL = new URLRequest("../images/ReplayButton.png");

  playGameButtonLoader = new Loader();


  playGameButtonURL = "../images/ReplayButton.png";

If it still is not loading then you probably have a path issue as far as targeting the file.

MirormiAuthor
Participant
June 12, 2014

Thanks, you have solved the Error 1067 but the other Error doesnt go away (Error 1180 Call to a posiblyundefined method "playGameButtonLoader")

Ned Murphy
Legend
June 12, 2014

If the intention for that 1180 error line is to load the file identified by the URL, you forgot to include the load command...

playGameButtonLoader.load(playGameButtonURL)

MirormiAuthor
Participant
June 12, 2014

(On Flash Builder)