What is going on here???

Subscribe to What is going on here??? 7 posts

avatar for DPbrad DPbrad 1197 posts
Flag Post
try {
	home = new Home();
	stage.addChild(home);
} catch (e:Error) {
	var t:TextField = new TextField();
	t.width = 640; text.height = 480; t.textColor = 0xFFFFFF;
	t.text = e.message;
	stage.addChild(text);
	text.appendText("\n" + home);
}

When testing locally, this works fine and everything goes as expected.
When I test on my private server, my public server and even testing an uploaded version to Kongregate, it fails at that point and states that home==null, error 1009. What is going on?

For added confusion, this is the Home class. The Page class is simply a class which extends a Sprite with a custom Event system (Which I have removed and it still doesn’t work).

package screens
{
	import dpbrad.Page;
	import dpbrad.PageEvent;
	/**
	 * ...
	 * @author DPbrad
	 */
	public class Home extends Page
	{
		public function Home() 
		{

		}
	}
}
 
avatar for DPbrad DPbrad 1197 posts
Flag Post

Ok, I seem to have found the source of the issue, namely rogue URLLoaders() returning garbage data, due to good old security issues I assume.

Using Vizzy, I found these issues. How do I resolve these errors (Never seen them before).

Error: Request for resource at HIDDEN_URL.json by requestor from SOURCE_URL is denied due to lack of policy file permissions.
*** Security Sandbox Violation ***
 
avatar for RTL_Shadow RTL_Shadow 1023 posts
Flag Post
Originally posted by DPbrad:

Ok, I seem to have found the source of the issue, namely rogue URLLoaders() returning garbage data, due to good old security issues I assume.

Using Vizzy, I found these issues. How do I resolve these errors (Never seen them before).

Error: Request for resource at HIDDEN_URL.json by requestor from SOURCE_URL is denied due to lack of policy file permissions.
*** Security Sandbox Violation ***

I have no idea about this type of stuff, but maybe this is what .allowDomain() does?

 
avatar for DPbrad DPbrad 1197 posts
Flag Post

I have tried .allowDomain() and .loadPolicyFile() to no effect.

 
avatar for DPbrad DPbrad 1197 posts
Flag Post

Finally figured it out. Needed to send my URL requests through a slightly different URL to avoid crossDomain issues. Everything loads alright now. phew!

 
avatar for NineFiveThree NineFiveThree 1370 posts
Flag Post

stage is also possibly null (depending on where your code is located), it’s not recommended to add childs to it anyway

 
avatar for DPbrad DPbrad 1197 posts
Flag Post
Originally posted by NineFiveThree:

stage is also possibly null (depending on where your code is located), it’s not recommended to add childs to it anyway

I already confirmed that stage was not null, and I was only adding to that as I knew that was the only DisplayObjectContainer that wasn’t null.