• hello,
    I want flyout hotspots to fly out, wait a litle bit and then merge to another scene depending on which hotspot was clicked.
    I'm not sure where to do that ( to check is the flyout image out )
    I guess there is a wait instruction so I could do it in the onclick, wait a bit so the image would have probably flown out and then check the state of it.
    does that seem right or how else would you do that ?
    cheers

    mick

  • Hi mick,

    Quote

    I want flyout hotspots to fly out, wait a litle bit and then merge to another scene depending on which hotspot was clicked.

    Perhaps this code will do:

    SAlut.

  • Hi,

    does that wait 2 seconds.
    I think that is similar
    <action name="teststate" >
    wait(2);
    loadscene(scene2, null, MERGE, BLEND(1)))
    </action>
    but I thought properly I should check that the flystate was out. I don't know how to do that. *unsure*
    cheers

    mick

  • Hi mick,

    Quote

    but I thought properly I should check that the flystate was out. I don't know how to do that.

    So, it seems your are using the code from the flyout more hotspots example....
    Then, you can check the flystate variable... for example:

    Code
    if(flystate == 2, dosomething()  );


    But, I think there is no need to check for the flystate... Doing so, the code could be really difficult to achieve...
    Try this modified flyout more hotspots example:

    The lines added are:


    in line 43 --- because all the flying hotspots use a <style> to share the same attributes for all hotspots, we set the onclick to our new needs (call a new action: truc() )....
    lines 46 to 51 --- the new action...

    • first we wait 2 seconds
    • then we set the hotspot to be kept....This way the hotspot can merge with the new scene....
    • then, we loads the new scene...
    • and finally, we set the onclick of the hotspot to fly back and remove it...


    Hope this can help... let me know...

    SAlut

  • hi,
    yes that is helping, I will try to improve the behaviour I have.
    ideally,
    a panorama with various hotspots (pictures on walls). when clicked picture flysout and merges with a new scene( same image), when something clicked scene merges back with flownout hotspot and first scene, hotspot flysback.
    cheers

    mick

  • I leave it for a bit, go back and I have forgotten everything *cry*
    can somebody remind me when to use commas and semi colons ?
    as above

    Code
    onloaded="set(onclick,if(flystate == 0, flyout_by_name(get(name)); truc(get(name)), flyback_by_name(get(name))) );"


    does the if statement have an else because of the ;

    cheers

    mick

  • Hi mick,

    if( condition , trueaction , falseaction);

    it is like :
    if ( condition is true (first coma) then do trueaction else (second coma) do falseaction);

    The semi colons is the separator from each action:
    onclick="action(dosomething); action(dosomethingmore); action(etc);"
    or:
    <action name="aname">
    action(dosomething);
    action(dosomethingmore)
    ;
    action(etc)
    ;
    </action>

    Hope this help...

    SAlut.

  • hi,
    thanks, that's clear.
    I haven't got clear what is the mechanism that the name in your first example

    truc(get(name)) );"

    is passed to the hotspot in the action.

    <action name="truc">
    delayedcall(2, set(hotspot[%1].keep,true);

    cheers

    mick

  • Hi mick,

    Code
    <hotspot name="spot1"
    ....
    onloaded="truc(get(name));" 
    />

    Because it is called inside the hotspot, get(name) retrieves the value of the name of that hotspot (name="spot1")....


    Code
    <hotspot name="spot1"
     ....
     onloaded="dothis();" 
     />
    <action name="dothis">
    trace(get(name));
    </action>

    The same apply in this code because the call of dothis() is from the hotspot....

    Hope it is clear and help in a way *smile* ...

    SAlut.

  • hi , thanks.


    I understood the first example, the second is new.
    So %1 represents the name of the hotspot and is the first parameter of the action truc ?

    so it can be applied to anything inside the action truc ?
    I'm a bit unclear about this.

    cheers

    mick

  • Hi,
    How did you find the value of rx,ry and rz,

    I am also working on the hotspot but confused with these values.

    If any one have any idea how to find the value of rx, ry, rz please help me.

    Thanks in advance.

Participate now!

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