• Hi guys,
    Can anyone advise me as to what I have done wrong in this xml?: http://www.projectsolutions.es/demos/yomec/tour.xml
    The tour ( http://www.projectsolutions.es/demos/yomec/tour.html ) does everything I want it to do but takes forever to load.
    The xml does contain quite a few hotspots, plugins and actions, but I've seen other examples with just as many, and more, and they don't take as long to load.

    As always, any advice will be gratefully recieved.

  • it actually loaded quite fast for me in the US. that tour is not that large at all. to reduce loading times you could use only 1 picture plugin and 1 text plugin. then create an action that sets the appropriate image and text based on whatever hotspot was clicked. craete an action and set it to each hotspot. you have a ton of replicated code for actions, plugins and hotspots. use some varaibles like below. also you could set a 'style' on the of the hotspot or plugin code so you do not have to replicate the same code taht way also.

    <action name=showstuff>
    set(plugin[photo].url, %1);
    set(plugin[text].url, %2);
    set(plugin[photo].visible, true);
    set(plugin[text]/visible, true);
    <action/>

    hotspot1
    onclick="showstuff(pathtoimageurl, pathtotexturl);"

    hotspot2
    onclick="showstuff(pathtoimageurl2, pathtotexturl2);"


    right now you are loading every jped and text image even when they are not needed.

  • Ok.... I knew it couldn't be that simple!

    Here's what I did:

    <action name="showImage">
    set(plugin[photo].url, %1);
    set(plugin[text].url, %2);
    set(plugin[photo].visible, true);
    set(plugin[text]/visible, true);
    </action>

    <plugin name="photo" url=""
    align="center"
    visible="false"/>

    <plugin name="text" url=""
    align="center"
    y="250"
    zorder="10"
    visible="false"/>

    <hotspot name="spot1" style="cog_hotspot" ath="6.3" atv="-1.4" onhover="showtext(Clique para más info, buttonstyle);" onclick="showImage(url=graphics/car_lift.png,url=graphics/text_area.png)" />

    When I click on spot1 in the tour I get an error message:

    WARNING: not local trusted - ExternalInterface disabled!
    ERROR: download of "url=graphics/car_lift.png" failed
    ERROR: download of "url=graphics/text_area.png" failed

    Where did I go wrong?

  • Hi,

    see the red marked parts here - they are wrong:

    hotspot name="spot1" style="cog_hotspot" ath="6.3" atv="-1.4" onhover="showtext(Clique para más info, buttonstyle);" onclick="showImage(url=graphics/car_lift.png,url=graphics/text_area.png)" />

    When I click on spot1 in the tour I get an error message:

    WARNING: not local trusted - ExternalInterface disabled!
    ERROR: download of "url=graphics/car_lift.png" failed
    ERROR: download of "url=graphics/text_area.png" failed

    best regards,
    klaus

  • Thanks guys, you've got me out of another hole.

    Another question;
    How do I scale the plugin images to screen size?
    I've tried using % & prop but then the image scales on both x & y at the same time.
    What I like to use is, first expand width followed by height using this action:
    tween(plugin[photo].width, 1074,0.2,easyOut,
    tween(plugin[photo].height, 725,0.3,easyOut);

  • here a solution:

    Code
    tween(width,get(stagewidth),0.2,easeOutQuad, set(width,100%); tween(height,get(stageheight),0.2,easeOutQuad, set(height,100%) ) );

    first the width will get tweened to the current stagewidth,
    and then will it be set to 100% to keep the full screemwidth also on resizing,
    then the the same will be done with the height,

  • Thanks Klaus,
    I've entered the code you suggested as follows:

    <action name="showImage">
    set(plugin[photo].url, %1);
    set(plugin[text].url, %2);
    tween(view.fov, 120,0.7,,
    tween(plugin[photo].width,get(stagewidth),0.2,easeOutQuad, set(width,70%);
    tween(plugin[photo].height,get(stageheight),0.2,easeOutQuad, set(height,prop);
    tween(plugin[text].scale, 0.56,0.2,,
    tween(plugin[text].scale, 0.52,0.05,,
    tween(plugin[text].scale, 0.55,0.1,,
    loadscene('scene_2',null,KEEPALL,BLEND(1.2))))))));
    </action>

    However, no matter what percentage I put for the width, the image still opens full screen and is in propotion to the screen size rather than in proportion with itself.
    What have I done wrong? *confused*

  • I've sorted it out and feel a bit foolish as it is so obvious *wacko*

    <action name="showImage">
    set(plugin[photo].url, %1);
    set(plugin[text].url, %2);
    tween(view.fov, 120,0.7,,
    tween(plugin[photo].width,get(stagewidth),0.2,, set(plugin[photo].width,70%);
    tween(plugin[photo].height,get(stageheight),0.2,, set(plugin[photo].height,prop);
    tween(plugin[text].scale, 0.56,0.2,,
    tween(plugin[text].scale, 0.52,0.05,,
    tween(plugin[text].scale, 0.55,0.1,,
    loadscene('scene_2',null,KEEPALL,BLEND(1.2))))))));
    </action>

    Next issue:
    On the good advice of VN2011, I'm using the following action to show an image which changes the colour of a car:
    <action name="changeTruck">
    set(hotspot[truck].url,%1);
    tween(hotspot[truck].alpha,1,1.2);
    </action>
    This works perfectly for one colour change but when another colour is selected, the first colour disappears immediately. as the url is replaced with the onClick command.
    What I would liketo happen is for the selected colour to fade out as the new one fades in.
    Possible?

  • Hi Klaus,
    Here's an example of what I would like to happen: http://www.projectsolutions.es/demos/yomec/tour.html but I would like to use a different method (see the quote) as the way I have done it takes too long to load the tour.

  • Hi,

    okay, I think I understand,
    but in this case you would need several hotspots - a hotspot for each color,
    and then instead of changing the url fade all other hotspots out and only the selected in,
    (note - when you're tweening a value once (e.g. when fadeing all out), and then tween
    that value again with an other value, then the first tween will automatically stop,
    so you can do that - fade out all + fade in only one)

    e.g. do this with some actions:

    one more note - the visible=true/false in the fadein/fadeout actions is
    done for better rendering performance, all hotspots with visible=true (even with alpha=0) can be slow,

    best regards,
    Klaus

  • That's pretty much the way I have it at the moment.
    The problem is, all the hotspots load at the start of the tour which slows dow the loading time.
    What I wanted to use was something like:
    <hotspot name="truck"
    url=""
    ath="83.47264086546944" atv="4.018223006068532" distorted="true"
    width="740" height="215"
    scale="0.6220326732917445" rx="1.5" ry="6.5" rz="0.23177069875548434"
    handcursor="false" alpha="0.00" />

    and use the action to call the url:
    <action name="changeTruck">
    set(hotspot[truck].url,%1);
    tween(hotspot[truck].alpha,1,1.2);
    </action>

    This works perfectly for one colour change but when another colour is selected, the first colour disappears immediately. as the url is replaced with the onClick command.
    What I would liketo happen is for the selected colour to fade out as the new one fades in.

  • Hi,

    in this case you would need at least two hotspots - a current one - and one for loading the next,
    when the loading of the next one was done - fade out the old one + fade in the new one,
    and then in the next call both hotspots must be swapped,
    implementing that should be possible but can be tricky of course,

    best regards,
    Klaus

  • Thanks Klause, I think I've sorted it out. As you said 'tricky'!

    Going back to the issue of stagewidth/height earlier in this thread, I'm using the following action (as you suggested) to reveal a plugin image.
    The relevent part is in red font:

    <action name="showImage">
    set(plugin[photo].url, %1);

    set(plugin[text].url, %2);
    tween(view.fov, 120,0.7,,
    tween(plugin[photo].width,get(stagewidth),0.5,, set(plugin[photo].width,prop);
    tween(plugin[photo].height,get(stageheight),0.5,, set(plugin[photo].height,70%);

    tween(plugin[text].scale, 0.56,0.2,,
    tween(plugin[text].scale, 0.52,0.05,,
    tween(plugin[text].scale, 0.55,0.1,,
    loadscene('scene_2',null,KEEPALL,BLEND(1.2))))))));
    </action>

    It works, and the image opens to scale and proportion but not before first opening to full screen and then shrinking down to the correct size in proportion to the screen.
    I've tried several things to try to rectify it myself but, due to my inexperience, without success.
    Any idea where I've gone wrong?

Participate now!

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