I have an accordion component that contains 3 list components and 2 tree components…there are all the components from the flash library of components…and I need to print the contents of these 5 “lists”
For now I’m concentrating on the lists…then I will worry about how to print the trees with all the nodes expanded…but I can’t seem to figure out how to determine how many items are in a list…for the lists I am not using dataProvider so I’m kinda lost here…any ideas?
listInstance.length to read how many instances
for(var i=0;i<listInstance.length;i++)
{
trace(listInstance.getItemAt(i).label);
}
Ok, I’m an idiot…I didn’t notice the List.length statement in the help files…bah…so I have the list printing figured out…but how the hell do I print the tree component? Ideally it would print the Branch Label…then all the subnodes of the branch would print under it slightly indented…and then so on and so forth for the rest of the nodes…I just do not know how to target the right nodes…cause if any branches are expanded…the Tree.length property returns a different number than if they were all collapsed…whats the best way to do this?
Quick question…say I have these lists in an external listCrap.txt file…is there a way of printing this file using PHP or something from flash without importing it to a dynamic text field? The reason I don’t want to put the lists in a dynamic text field inside an MC to be printed is because some of my lists come out to be longer than a page…and whatever doesn’t fit on the first page gets cut off…It would be much easier for me to format the list printouts in a txt file…and then have flash call a function to print the appropriate text file…is this at all possible?
exactly where do you want to print the list to…
printer or just the screen inside flash
I’m sure a server-side printing approach is an option - but I’ve never heard of that - seems like a lot of work unless you know php or asp or perl well.
I don’t know of a way to print the visuals within an actual tree component… the way many of the components work is that they only have create graphics that are necessary within your viewable aperature - so I don’t believe is possible to take a bitmap “screenshot” of the entire tree - not to mention you’d have to run math to “chop” that bitmap to fit on different pages.
Using the PrintJob class in flash - you can create multipage prints - its not super easy in AS2 to distribute a lot of text across multiple textFields - but it is possible. One technique that may work in your case is to set a character length maximum for a textField on a single page, then you can chop away at the tree text using substr method. The text does have to get loaded into flash in order for it to print. But, the best way imo would be to set up your page clip with a linkage in the library. When print tree is clicked, load your text and chop away at it - all the while attaching new printpage clips to the stage and populating them with the chopped text. You can populate and style with css or textFormat. After a dynamically generated page is completed, you can simplet add that page to an instance of your print job class and then send all pages to the printer.
Hope this helps
[quote=sparkdemon;2332669]exactly where do you want to print the list to…
printer or just the screen inside flash[/quote]
I want to print to the printer…so the user has a page in their hand with all the list items on it…
http://www.phpclasses.org/browse/package/2540.html see this for php
however the best thing i can say is that … printing is basically a browser based command if printing a web document.
you cannot print directly from server i think…you have to bring it to the client machine first…
you can also trigger the print command on windows using vbscript .