• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

Community Beginner ,
May 20, 2016 May 20, 2016

Copy link to clipboard

Copied

Hello,

I have just recently started using the Flash platform and working with ActionScript. I have started a small project and attempting to load a PNG file onto the stage. I have an image directory within the project folder and have the following code which is generating the error.

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 Kitties extends Sprite

    {

        //Declare the variables for the background.

        public var backgroundURL: URLRequest;

        public var backgroundLoader: Loader;

        public var background: Sprite;

      

        public function Kitties()

        {

            backgroundURL = new URLRequest();

            backgroundLoader = new Loader();

            background = new Sprite();

          

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

            backgroundLoader.load(backgroundURL);

            background.addChild(backgroundLoader);

            stage.addChild(background);

        }

    }

}

Unfortunately I was unable to locate a code block to contain this and there is no syntax highlighting for ActionScript within the forum?

Thanks.

Views

607

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 20, 2016 May 20, 2016

Copy link to clipboard

Copied

LATEST

So I have since realized the backspace '\' is used for escape characters in string literals so I have since doubled them up '\\'.

Typing the full directory resolves the issue but if my project was used on another computer the directory path will be different so I need to know the default path it runs the application from. I thought this would be the bin-debug folder. So moving up the directory to the main project folder then into my images folder should work but it isn't.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines