Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 3 of 3

Thread: Loader for site

  1. #1

    Loader for site

    Hey

    Im new to AS3 and have made this site: d41.dk

    My problem is I will make a loader for this site, but it doesn't work.

    Message: TypeError: Error #1009: Cannot access a property or method of a null object reference.at Main()

    The source: http://dl.dropbox.com/u/1018730/Portfolio_website.zip

    Someone who can help?

    Best regards Troels Bech Hansen

  2. #2
    Quote Originally Posted by tbhD41 View Post
    Hey

    Im new to AS3 and have made this site: d41.dk

    My problem is I will make a loader for this site, but it doesn't work.

    Message: TypeError: Error #1009: Cannot access a property or method of a null object reference.at Main()

    The source: http://dl.dropbox.com/u/1018730/Portfolio_website.zip

    Someone who can help?

    Best regards Troels Bech Hansen
    Can you just post your code?

  3. #3
    Here are the code.

    Container Fla code:
    HTML Code:
    //loading code
    var ld:Loader =  new Loader();
    var ct:MovieClip;
    ld.load(new URLRequest("App.swf"));
    ld.contentLoaderInfo.addEventListener(Event.INIT, loadingDone);
    
    function loadingDone(e:Event):void{
    	ct = e.target.content;
    	addChild(ct);
    }		
    The SWF's Main.as code:

    HTML Code:
    package  {
    	import flash.display.MovieClip;
    	import flash.events.Event;
    	import flash.display.StageScaleMode; 
    	import flash.display.StageAlign;
    	import flash.display.StageDisplayState;
    	import BackGround;
    	import Menu_;
    	import Boks;
    	import Cases;
    	
        public class Main extends MovieClip
        {
    		private var backGround:BackGround;
    		private var menu:Menu_;
    		private var boks:Boks;
    		private var cases:Cases;
    		
    		public function Main()
    		{
    			stage.scaleMode = StageScaleMode.NO_SCALE; 
    			stage.align = StageAlign.TOP_LEFT; 
    			stage.addEventListener(Event.RESIZE, resizeHandler); 
    			
    			backGround = new BackGround;
    			menu = new Menu_;
    			boks = new Boks;
    			addChild(backGround);
    			addChild(menu);
    			addChild(boks);
    			
    			boks.x = 10;	
    			
    			//resizeHandler(null);
    		}
    		
    		public function resizeHandler(event:Event):void 
    		{
    			backGround.resizePic(stage.stageWidth,stage.stageHeight);
    			//cases.resizePic(stage.stageWidth,stage.stageHeight);
    			boks.y = stage.stageHeight;
    		} 
    	}
    }
    Thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012