Be a Supporter!
Moniquer
Moniquer
  • Member since: Dec. 23, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Embedding XML Jan. 28th, 2013 @ 04:21 PM Reply

This is the code that's supposed to embed my 2 XMLs:

public class VLink extends MovieClip
	{
		//XML
		//Groups
		[Embed(source = "schools.xml", mimeType = "application/octet-stream")]
     	var schoolsClass:Class;
		var schoolsObj:Object = new schoolsClass();
		var groupsXML:XML = new XML(schoolsObj);
		//Acts
		[Embed(source = "acts.xml", mimeType = "application/octet-stream")]
		var actsClass:Class;
		var actsObj:Object = new actsClass();
		var actsXML:XML = new XML(actsObj);

I get 3 errors.
#1014. "mx.core::ByteArrayAsset" could not be found.
#1065. "Variabeln VLink__Preloader__" is undefined.
#1065. "Variabeln VLink__LoadingAnimation__" is undefined.

I noticed that in the Properties of my .fla the SWF History there are a yellow "!" triangle by my latest tests.
Is the .as too big?

MSGhero
MSGhero
  • Member since: Dec. 15, 2010
  • Online!
Forum Stats
Supporter
Level 16
Game Developer
Response to Embedding XML Jan. 28th, 2013 @ 04:40 PM Reply

At 1/28/13 04:21 PM, Moniquer wrote: This is the code that's supposed to embed my 2 XMLs:

public class VLink extends MovieClip
{
//XML
//Groups
[Embed(source = "schools.xml", mimeType = "application/octet-stream")]
var schoolsClass:Class;
var schoolsObj:Object = new schoolsClass();
var groupsXML:XML = new XML(schoolsObj);
//Acts
[Embed(source = "acts.xml", mimeType = "application/octet-stream")]
var actsClass:Class;
var actsObj:Object = new actsClass();
var actsXML:XML = new XML(actsObj);

I get 3 errors.
#1014. "mx.core::ByteArrayAsset" could not be found.
#1065. "Variabeln VLink__Preloader__" is undefined.
#1065. "Variabeln VLink__LoadingAnimation__" is undefined.

I noticed that in the Properties of my .fla the SWF History there are a yellow "!" triangle by my latest tests.
Is the .as too big?

I feel like you can't use the embed tags in Flash Pro, but I'm not entirely sure. A URLLoader would work, but then you'd have to host the XML somewhere if you publish your game online.

Moniquer
Moniquer
  • Member since: Dec. 23, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Embedding XML Jan. 28th, 2013 @ 05:15 PM Reply

At 1/28/13 04:40 PM, MSGhero wrote: I feel like you can't use the embed tags in Flash Pro, but I'm not entirely sure. A URLLoader would work, but then you'd have to host the XML somewhere if you publish your game online.

The same code works fine when in a project of it's own.
It's when I have all the other stuff that it doesn't work.

MintPaw
MintPaw
  • Member since: Jun. 11, 2006
  • Online!
Forum Stats
Member
Level 10
Programmer
Response to Embedding XML Jan. 28th, 2013 @ 11:10 PM Reply

I don't think you're allowed to access the embedded files before the constructor in the initiated vars, you shouldn't be doing that anyways.


If ya have something to say, PM me. I have a lot of time to spare.
Also never PM egg82.

BBS Signature
Moniquer
Moniquer
  • Member since: Dec. 23, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Embedding XML Jan. 29th, 2013 @ 01:32 AM Reply

At 1/28/13 11:10 PM, MintPaw wrote: I don't think you're allowed to access the embedded files before the constructor in the initiated vars,

I moved the code to after the constructor. I still get the same errors.

Moniquer
Moniquer
  • Member since: Dec. 23, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Embedding XML Jan. 30th, 2013 @ 01:41 PM Reply

After testrunning, there's a yellow triangle with a "!" in the SWF History that says: "SWF size increased over 50%".
Anybody heard about this before? (Google hasn't.)
Is this the reason the errors say something about a preloader?

Moniquer
Moniquer
  • Member since: Dec. 23, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Embedding XML Jan. 31st, 2013 @ 02:14 PM Reply

I've tried to put the SWF in a preloader, but of course it just shows me white because the errors are still there.

Moniquer
Moniquer
  • Member since: Dec. 23, 2012
  • Offline.
Forum Stats
Member
Level 01
Blank Slate
Response to Embedding XML Feb. 1st, 2013 @ 07:20 AM Reply

On searching the error #1014 i found this page: http://stackoverflow.com/questions/3169961/external-config-f ile-in-actionscript-3

I'm not using Flex, so I don't have a configuration file to edit.
Can I make a standalone SWF with Flash that uses XML?