dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Error loading local image

  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90

    Question Error loading local image

    I am try to load a local image, but are constantly getting :

    Code:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
    although i am 100% sure the path is correct, infact there is no path, image is in current directory. I am using the following code:

    Code:
    var pictLdr:Loader = new Loader();
    var pictURL:String = "background.jpg";
    var pictURLReq:URLRequest = new URLRequest(pictURL);
    pictLdr.load(pictURLReq);
    this.addChild(pictLdr);
    Does anyone know what could be the problem?

    thanks

  2. #2
    Ө_ө sleepy mod
    Join Date
    Mar 2003
    Location
    Oregon, USA
    Posts
    2,441

  3. #3
    Member
    Join Date
    Jun 2006
    Location
    Croatia
    Posts
    90
    Thanks neznein9 for link. The problem was i was loading my pictures from dir relative to my class i used for loading and displaying pictures. Instead, path to image should be relative to swf or html file, i totally overlooked that.

    best regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center