Hi,

Your alert showed null since the timeline had not yet processed the
xml events (you had not yet called eventSource.loadXML).
The incoming xml (from your server) is in variable xml.

Remember your goal (from your first message). You want to "manipulate
the EventSource prior to it loading into timeline."
==>> I figured that what you meant by that was you wanted to change
some of the values of the events as they come in from the xml file on
your server.

Set a breakpoint inside the function and look at the xml object.
Use firebug with firefox to debug

Look at 
http://simile-widgets.googlecode.com/svn/timeline/trunk/src/webapp/api/scripts/sources.js
for an example of parsing the xml

          tl = Timeline.create(document.getElementById("tl"),
bandInfos, Timeline.HORIZONTAL);
          tl.loadXML("jfk.xml", function(xml, url) {
                       // look at or manipulate the xml variable here
                       // set a breakpoint here
                       eventSource.loadXML(xml, url);  // loads the
xml into the timeline
                       });


Good luck,

Larry


On Oct 3, 10:44 am, "g f" <[EMAIL PROTECTED]> wrote:
> Thanks for the reply Larry,
> So from your example it looks like I can get a handle on the xml prior
> to actually loading the xml into the timeline?
> If this is true then how?
>
> I tried:
>           tl = Timeline.create(document.getElementById("tl"),
> bandInfos, Timeline.HORIZONTAL);
>           tl.loadXML("jfk.xml", function(xml, url) {
>                        alert(eventSource.getEarliestDate());
>                        eventSource.loadXML(xml, url);
>                        });
>
> But It still returns null.
>
> Thanks for your help so far!
>
> On Wed, Oct 1, 2008 at 10:24 PM, LarryK <[EMAIL PROTECTED]> wrote:
>
> > Hi gf,
>
> > My understanding is that you can manipulate the xml in the callback
> > function before calling eventSource.loadXML
>
> > example:
> >          tl = Timeline.create(document.getElementById("tl"),
> > bandInfos, Timeline.HORIZONTAL);
> >            tl.loadXML("jfk.xml", function(xml, url) {
> >                       // manipulate xml object here
>
> >                       // then call
> >                       eventSource.loadXML(xml, url);
> >                       });
>
> > Hope this helped,
>
> > Larry
>
> > On Oct 1, 8:13 pm, g f <[EMAIL PROTECTED]> wrote:
> >> Hello all,
> >> I have a need to manipulate the EventSource prior to it loading into
> >> timeline.
> >> Seems like this is not possible until the EventSource is actually
> >> already loaded into timeline.
> >> I tried alert(eventSource.getEarliestDate()) and received a null.
>
> >> My idea was to create a javascript XML DOM object from the XML String
> >> and then do my manipulation and then call:
> >> Timeline.loadXML(JAVASCRIPT_DOM_OBJECT, function(xml, url)
> >> { eventSource.loadXML(xml, url); });
>
> >> Is this possible or perhaps is it possible to pass a String instead of
> >> a JS_DOM_OBJ?
>
> >> I had seen a post a year or so ago and David had shown someone how to
> >> pass the string but I cannot find that post.
>
> >> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SIMILE Widgets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to