Go Back   CodingForums.com > :: Client side development > Flash & ActionScript

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-10-2012, 01:48 PM   PM User | #1
scriptseeker
New to the CF scene

 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
scriptseeker is an unknown quantity at this point
not able to load the swf with this script

I am getting the following error when i load the File

Find the link of swf in the zip file ldr.as

http://www.actionscript.org/forums/a...6&d=1348774291

Code:
Game has started
TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at jaludo::JaludoGameAPI$/adjustScale()
	at jaludo::JaludoGameAPI$/create()
	at King()
WARNING: the API method 'initialize' has been already called
TypeError: Error #1009: Cannot access a property or method of a null object reference.
	at jaludo::JaludoGameAPI$/adjustScale()
	at jaludo::JaludoGameAPI$/create()
	at King/frame1()


[AS]package {
import flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.display.LoaderInfo;
import flash.display.Sprite;
import flash.system.ApplicationDomain;
import flash.events.KeyboardEvent;

public class ldr extends Sprite {

public function ldr():void {
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete);
loader.load(new URLRequest('kingoftherocks.swf'));
}
private function onLoadComplete(e:Event):void {
var loaderInfo:LoaderInfo = e.target as LoaderInfo;
addChild(e.target.content);
var swf:Object = loaderInfo.content;

stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyPress);

function onKeyPress(e:KeyboardEvent):void
{
if(e.keyCode == 49)
{
trace("1 Pressed");
}
if(e.keyCode == 50)
{
trace("2 Pressed");
}
if(e.keyCode == 51)
{
trace("3 Pressed");
}
}
}
}
}[/AS]
scriptseeker is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:07 AM.


Advertisement
Log in to turn off these ads.