The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


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