onloadcomplete => include xml...

  • hello there, i would like to know if it's possible to include and xml file only when the load is complete, cause sometimes the loading text keep in the middle of the pano...
    and i use some feature like GET "session" and GET "cookies" and they are not loaded in first... and i need to delayedcall all my action to get the right result but sometime 5sec is not enouth...
    that's why i want to include my xml only when the scene itself was full loaded...
    thx :)

  • yes but i really need to have the state load complete 'cause sometimes the (loading) text still appear...

    i've tried => <include url="my.xml" if="events.onloadcomplete == 'true'"/>

    but it's not good and no error...

  • that doesnt work this way...

    events.onloadcomplete is an action you can define like this:
    <events onloadcomplete="set(pano_loaded,true);" />

    <action "isready" autorun="onstart">
    callwhen(pano_loaded,
    ... your hide loading text code ... );
    </action>

    or simpler

    <events onloadcomplete="... your hide loading text code ... " />

    but this should work automatically
    maybe you mixed up something in the standard xmls
    or your server has a problem...

  • it's because i load lots of xml... in my tour i load 1 xml who load 6-7xml
    and all of them lots maybe 15-20 layers and they made some request on my server.
    all work but sometimes "loading" keep on the view and sometimes my Session is not get at time... depending the computer and the connection...
    that why i need to include my xml only when the loading is ended..
    i've try your solution


    <events onloadcomplete="set(_loaded, true); trace(get(_loaded));"/>


    <include url="my.xml" if="_loaded == true"/>


    but the if condition need to be declared before the xml is open...

    then i've tried

    tour.xml
    <events onloadcomplete="set(_loaded, true); trace(get(_loaded));"/>

    <include url="include.xml"/>



    include.xml
    <include url="my2.xml" if="_loaded == true"/>

    <include url="my3.xml" if="_loaded == true"/>

    <include url="my4.xml" if="_loaded == true"/>


    but they don't come... trace say = true...

  • i've tested another method... but not work :D

    <events onloadcomplete="loadpano(my.xml, MERGE|KEEPVIEW|KEEPSCENES|KEEPHOTSPOTS|KEEPPLUGINS|KEEPIMAGE|KEEPDISPLAY , NOBLEND)"/>


    it's good when my scene is loaded it's load my new xml but as pano... does can i do this things with loadxml ?

    like :

    <events onloadcomplete="loadxml('<krpano><include url="my.xml"/></krpano>')";/>



    *whistling* *whistling* *whistling* *whistling*


    XML parsing...

  • better dont think of loading your xmls when everything is ready

    load your xmls normally, but dont do anything until everything is loaded
    that needs waiting for one or more signals (with callwhen)
    and of course setting each signal if a thing is done/loaded

    events onloadcomplete only says the panorama is loaded
    for layers with images you must use the layers onloaded events

    if you have a lot of image layers you can use a counter
    <layer name="..." url="...jpg" onloaded="inc(image_counter);" />
    callwhen(.... AND image_counter == xx, .... );

    or.. just disable the loading text :)

  • finaly i've doing another way,
    onloadcompleted = set my layer visible true, check if session ok...


    action check session
    if session ok then set layer visible
    if not => delayedcall(0.4, check session)

    and with that, the loading desapear all the time and my session are found with 100% accuracy

    thx *thumbsup*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!