Printing from flash
- Started
- Last post
- 18 Responses
- pushme
OK. I tried this earlier today w/o much success. I've loaded a bunch of xml into flash but the xml data won't print. Any idea how to do this?
- unformatted0
it helps if you post your code sometimes.
but....
textfieldname.html = true;
textfieldname.htmlText = yourxmldata;
- pushme0
Missed that there was a response last night. Well I don't have the code right now but its very basic xml parsing.
Load the XML
if successfull take the nodeValue and put it in my dynamic text box. If this still isn't enough (which is likely i know). I'll post again later.
- unformatted0
you don't have the code right now?
that mean it's at home/work?
or
you haven't done it yet?
- pushme0
it was at home here it is:
program1_1XML= new XML()
program1_1XML.ignoreWhite = true
program1_1XML.load("program1_1.x...
program1_1XML.ref = thisprogram1_1XML.onLoad = function(success){
if(success){var root = this.firstChild
nodes = root.childNodes/******************************/
/*Parse Content For Headers*/
/******************************/
for(var i=0; i
- unformatted0
well for one you need to load your file after the onLoad function
so
whatever.onLoad = function(){};
whatever.load("xml.xml");and you should read your post again cuz obviously you're missing some code.
- pushme0
if i load it after the onload statement then it doesn't show in my project. Here the full code(lets hope it takes it):
program1_1XML= new XML()
program1_1XML.ignoreWhite = true
program1_1XML.load("program1_1.x...
program1_1XML.ref = this
program1_1XML.onLoad = function(success){
if(success){
var root = this.firstChild
nodes = root.childNodesfor(var i=0; i
- pushme0
for(var i=0; i (less than) 15; i++) {
header_subnodes = nodes[1].childNodes
content_subnodes = nodes[2].childNodes
this.ref["thumb"+i].htmlText = content_subnodes[i].firstChild.n...
this.ref["gallery"+i].htmlText = content_subnodes[i].attributes.g... + "\n" + content_subnodes[i].firstChild.n...}
} else trace("Error loading XML document")
}stop()
- unformatted0
what does your xml look like?
you should check some your syntax, cuz you had missing brackets.
- pushme0
i tried the code you pasted in (thx!) but it didn't load the xml. whats the thought behind having the doc load after the onload statement? how will that differ the printing outcome (other than make it print...whats the logic)
- pushme0
bump
- unfittoprint0
you'll have to load your xml ONLY after you create your onLoad event. it may work while testing your scene/locally but not online.
xmlcontent.load("some.xml") is usuallly my last linee of code.
- pushme0
ok. I'm still unclear as to the logic behind that. It doesn't work locally(with the load statement last). Why do tutorials tell you to load it before? I'm really lost on this. thx.
- unfittoprint0
coul u link to .txt file with the actions?
- pushme0
yeup. here it is:
- unformatted0
because you want to define your onLoad event listener before you actually load the file, rather then load the file then define the listener.
- pushme0
ok. the load statement after the onload now works but still doesn't print.
- Anarchitect0
but it does construct the your content? It is visible, right?
- pushme0
Yeah. The project works great on screen but the clients wants the ability to print all pages.