Skip to main content
Inspiring
May 25, 2007
Question

OReilly and DataFormat

  • May 25, 2007
  • 3 replies
  • 737 views
I have the OReilly AS 3.0 cookbook...and it has basically a code snippet similar to this one:

private function loadMenuData(){
var loader:URLLoader = new URLLoader();
loader.dataFormat = DataFormat.TEXT;
loader.addEventListener(Event.COMPLETE, loadComplete);
loader.load(new URLRequest("xml/menubar.xml"));
}

I'm getting a complier error on DataFormat: "1120: Access of undefined property DataFormat."

Any ideas why? I don't even know what package DataFormat is coming from...I guess from the net package...

Any advice would be great! Thanks in advance!
This topic has been closed for replies.

3 replies

kglad
Community Expert
Community Expert
May 25, 2007
that's really in oreilly??? that's not good.
hciguyAuthor
Inspiring
May 25, 2007
Yep. Page 475 in AS 3.0 Cookbook has this code:

public function LoadXMLExample() {
kglad
Community Expert
Community Expert
May 25, 2007
and that's supposed to be:

URLLoaderDataFormat.TEXT
hciguyAuthor
Inspiring
May 25, 2007
Thanks kglad, the genuis :)

OReilly has tons of errors and typos in it. Guess they rished it to the printer.
Inspiring
May 25, 2007
I think it supposed to be dataFormat?