dcsimg
A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Preloader Error

  1. #1
    Senior Member
    Join Date
    Jun 2001
    Posts
    343

    Preloader Error

    I used the code below to make a preloader and it works fine when I try it locally, but gives me the following error when I try to use it in a website: "Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found." The preloader is a swf that pulls in another swf after it loads. Also when I use the swf that the preloader is pulling in, it also works. Any suggestions?


    Code:
    var l:Loader = new Loader();
    l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
    l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
    l.load(new URLRequest("myswf.swf"));
    
    function loop(e:ProgressEvent):void {
    	var perc:Number = e.bytesLoaded / e.bytesTotal;
    	percent.text = Math.ceil(perc*100).toString();
    }
    
    function done(e:Event):void {
    	removeChildAt(0);
    	percent = null;
    	addChild(l);
    }

  2. #2
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    maybe your myswf.swf file isn't located directly next to your preloader swf, because that where you are linking to right now.

    If you've put it inside of a folder, try using:
    l.load(new URLRequest("folderName/myswf.swf"));

    If it's on a higher level, try:
    l.load(new URLRequest("../myswf.swf"));
    in which each ../ takes you up one level
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

  3. #3
    Senior Member
    Join Date
    Jun 2001
    Posts
    343
    It was a path issue. Thank you!

  4. #4
    lemon juice hurts your eyes florianvanthuyn's Avatar
    Join Date
    Jul 2005
    Location
    Merelbeke, Belgium
    Posts
    546
    no problem
    Florian Vanthuyne

    WAR AGAINST SOLVED THREADS
    mark yours as Resolved under Thread Tools!

Tags for this Thread

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