I'm looping trough XML defining message board posts and inserting them into a
SQLLite database. My problem is I need to insert replies to posts and don't
know an ID to create the parent-child relationship. Code example:
<post>
<content>Good morning!</content> <replys> <reply>
<content>Er, good afternoon I mean.</content> </reply> </replys>
</post>
for each (var post:XML in _xml.day.(@day == _day).post) {
var postVO:PostVO = new PostVO();
postVO.content = post.content.text();
var postEvent:FDataEvent = new FDataEvent(FDataEvent.NEW_POST);
postEvent.param = postVO;
dispatchEvent(postEvent);
for each (var reply:XML in post.replys.*) {
trace('who is my parent?', reply.content.text());
}
}
The class this happens in is unaware of the class listening for the FDataEvent.
Would it be a hassle to maintain and understand if I made the class aware and
inserted the child replies with a listener for a custom event which would
return the ID? The way I'm inclined to do it now if to create a UUID for each
post which I'd know when looping through the replies.
Thoughts?
_ _ _
Erik Mattheis | Weber Shandwick
P: (952) 346.6610
M: (612) 377.2272
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders