Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Use Embed Tag to embed XML-File in Flash Professional Project in Flash Builder

New Here ,
Aug 12, 2011 Aug 12, 2011

Dear Folks,

trying hardly to use embed tag to implement an XML-File.

Followed these instructions and tried it nummerous times on different places in the code:

http://dispatchevent.org/roger/embed-almost-anything-in-your-swf/

Code:

###

[Embed(source="test.xml", mimeType="text/xml")]
protected const EmbeddedXML:Class;

var x:XML = XML(new EmbeddedXML());
trace(x.toXMLString()); //it should work!

###

  • Using CS 5.5 Flash Professional Project in Flash Builder (also tried as Actionscript Project)
  • Found some hints about paths have to be ralative to the invoking .AS-File
  • Receive different errors about not allowed at this and that place

Can somebody confirm that this should work in Flash Professional project / AS3 (no Flex)

Best,

Cedric

TOPICS
ActionScript
3.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 12, 2011 Aug 12, 2011
LATEST

This works for me:

...

[Embed(source="test.xml", mimeType="application/octet-stream")]
private const EmbeddedXML:Class;

...

trace(XML(new EmbeddedXML()));

(Note the mimeType is not text/xml but application/octet-stream)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines