making photos pop up from a button

  • I spent several hours reading different ways to make a photo pop out when I click on a hotspot and this one seems simple and does all I need.

    Code
    <plugin name="spot4" style="mapspot-photo" x="396" y="98" onclick="closemap(); wait(0.5); tween(plugin[bedroom].alpha,1);tween(plugin[bedroom].scale,1); "/>
    	<plugin name="bedroom" url="hotspots/bed.jpg" keep="true" handcursor="false" align="center" edge="center" alpha="0" scale="0"  onclick="tween(plugin[bedroom].alpha,0);tween(plugin[bedroom].scale,0);"/>

    It simply tweens from alpha and scale = 0 to 1.

    That's all works ok but then I wanted to improve the startup action so that it moves to a viewpoint on loading the initial tour, as follows:

    Code
    <action name="startup">
    		<!-- load the first scene  -->
    		loadscene(get(scene[0].name), null, MERGE);
    		set(view.architectural,1.0);
    		lookat(-5, 14); 
    		wait(BLEND); 
    		lookto(-76,3,100,smooth(100,100,30));
    
    
    	</action>

    When I add these lookat and lookto instructions the photos no longer pop out.

    Can anyone see what I'm doing wrong?


    The tour and xml are here:
    http://www.opticalfx.co.uk/ipadtest/index.html
    http://www.opticalfx.co.uk/ipadtest/tour.xml
    http://www.opticalfx.co.uk/ipadtest/buttons.xml

    The hotspots are the 3 camera icons on the floorplan. They currently work until you add the code above to startup.

    Any help greatly appreciated.

    Thanks,

    Adrian

  • Don't worry, I seem to have fixed it myself *smile*

    I came across another tour that did what I wanted and I spotted that they put the instructions in the onstart call:

    onstart="startup();
    set(view.architectural,1.0);
    lookat(-5, 14);
    wait(BLEND);
    lookto(-76,3,100,smooth(100,100,30));">

    That seems to work fine.

  • Hallo Adrian
    Can you post the example with the photo popping- up and the xml file. Sounds interesting. Ik spend a week to find a way to pop-up a text. Still cannot find it.
    Thanks for posting so far.


    Oh I see the photo's popup already in the first file, thanks

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!