flash data integration:
I have a problem with XML data not displaying when the flash playhead goes backward in the timeline. Is this a bug or is there something that needs to be set or scripted to make sure this works correctly? Either way, can anyone suggest a workaround? Here is the situation, for the most part it is very simple: -The flash file is one scene with different sections, the user clicks a button to go to a specific frame in the timeline to see different info, etc. -There is one static XML file with all data, all Flash has to do is receive the data and display it. -Flash uses the XML component and all data is diplayed by using a text area component. -There are multiple text areas to each display a certain node from the XML file, the user navigates to whatever area to view whichever block of text. -(Since it seems that XML components need to start at the first frame, I experimented with different approaches and finally settled on using layer masks to hide all text areas except for the desired one for each area of the timeline) -I doublechecked all of the settings for each object, and the first frame has the this.main.trigger(); script It seems to work fine, but only if you navigate in order of where each section appears on the timeline. (If you click on a button to view a section at frame 10, then navigate to the section at frame 20, etc. everything shows up fine. If you click on the button to go back to the section at frame 10, then the field is empty and everywhere else you go from that point is empty as well.) It seems like somehow going backwards makes flash forget all of the XML data. I tried making the data reload at each desired frame by inserting this.main.trigger(); but that had no effect. Other notes: This is using Flash Pro and the current version of flash player. I tried doing test movies as well as publishing full projectors. I have tried publishing for different versions of flash, actionscript, etc. all with same results. Does anyone have any ideas? Thanks.
Well, without seeing any code, it's difficult to say where the error is. But using layer masks is probably not the best way to go since the components offer options to do this more efficiently. How did you bind the data? Code or visually? Do the text area components all have unique instance names? If you can post your fla or attach code I might be able to help you.
There isn't any special code, it is all done using the built-in xml components, with different text areas on different layers. The tutorial for the Bike Trips here served as a model, except without the pull down options menu: http://www.macromedia.com/devnet/mx/flash/articles/xmlconnector.html Like I said, everything works fine with the masks, etc. as long as you don't go backwards. If there is a better way to do it I would be open to suggestions.
A follow up: Should there be more than 1 XML compnent in the Timeline? Just a thought but it seems unnecessary since there is only 1 XML source.
Once you load the xml the data is available throughout the movie by accessing the created xml-object (moving forward works as expected). My guess is that the layer masks are the problem. Unfortunately I didn't use layer masks that much so I can't identify the problem (if any). I recently finished a company presentation which required going backwards too. I used the XML class. Basically, I used a text field and attached it dynamically and filled it by running a function and passing it the correct node in the XML-file. Moving backward involved 'clearing memory' by removing the text field and setting the content to empty and running the function again - meaning, to Flash you are not returning to a previous frame but you're there for the first time. How to identify the problem or an alternative approach: Well, since this involves 'visibility' I would try to achieve the same effect by using the visible property of the text area component. Copy your fla and save it with a new name. Initialize all Text Area Components as invisible: myTextAreaA.visible=false; on frame 1 of the fla in your layer 'code'. Remove the layer masks and attach actions on the frames where you need the changes in visibility: myTextAreaB.visible=true; And let's see what happens then.
Damn, that seems to work fine now. I wasn't aware of the visibility option and that did make things much simpler. Before using masks I had also tried just covering up text areas with the layers above it but that had the same problem. Thanks for your help!
Don't see what you're looking for? Try a search.
|