flashing polygonals hotspots ?

  • Hi,

    I'd like to add a flashy behave on my polygonals hotspots. For example, the border is on and off each second.
    I've tried a delayedcall action called from the onloaded setting of my hotspot :

    Code
    <action name="showborder">
    
    
    		delayedcall(1.0, set(hotspot[pic_tableau].borderalpha, 1.0)); 
    		delayedcall(2.0, set(hotspot[pic_tableau].borderalpha, 0.0)); 
    		delayedcall(3.0, showborder() );
    		
    			
    	</action>


    I'vve also tried this, just to try to change at least a setting on this hotspot, via onloaded :


    It's not working. *cry* The border still visible.
    Is it impossible to switch, tween or set a function in polygonal hotspot ?

    Any suggestion ?

    Thanks. *smile*

    Steph

  • Hi,

    changing the polygonal hotspot styles attributes should work,
    but changing them will not automatically force a redraw,

    there is an internal flag that you can use to force the redraw,
    add that code:

    Code
    set(hotspot[pic_tableau].needredraw, true);

    and note - there is no "onloaded" event for polygonal hotspots!
    the onloaded event will be only called when an image hotspots was loaded,

    best regards,
    Klaus

  • Thanks Klaus. One more time. *wink*

    It works when i move into the pano (one flashing)! My action is not a loop ?! But it doesn't work when you don't move.
    I call the action from the "events onxmlcomplete" of my scene. And the action is written out of the scene (bottom of the xml).

    Code
    <action name="showborder">
    
    
    		set(hotspot[pic_tableau].needredraw, true);
    		delayedcall(1.0, set(hotspot[pic_tableau].borderalpha, 1.0)); 
    		delayedcall(2.0, set(hotspot[pic_tableau].borderalpha, 0.0)); 
    		delayedcall(3.0, showborder() );
    		
    			
    	</action>


    What's wrong ?

    Thanks. *smile*
    Steph

    Steph

    2 Mal editiert, zuletzt von esys (22. März 2011 um 16:52)

  • Hi Steph,

    Try this:

    Code
    <action name="showborder">
    		showlog();
    		delayedcall(1.0, set(hotspot[pic_tableau].needredraw, true);set(hotspot[pic_tableau].borderalpha, 1.0);); 
    		trace('hotspot[pic_tableau].needredraw = ',hotspot[pic_tableau].needredraw); <!-- Note the result --- FALSE !!! -->
    		delayedcall(2.0, set(hotspot[pic_tableau].needredraw, true);set(hotspot[pic_tableau].borderalpha, 0.2);); 
    		trace('hotspot[pic_tableau].needredraw = ',hotspot[pic_tableau].needredraw); <!-- Note the result --- FALSE !!! -->
    		delayedcall(3.0, showborder() );
    	</action>

    This other also works:

    Code
    <action name="showborder">
    		delayedcall(1.0, set(hotspot[pic_tableau].borderalpha, 1.0);updatescreen();); 
    		delayedcall(2.0, set(hotspot[pic_tableau].borderalpha, 0.2);updatescreen();); 
    		delayedcall(3.0, showborder() );
    	</action>

    Klaus... How many other undocumented things like this one *question* *squint*

    SAlut.

  • Here's an example of flashing hotspots that uses a variant of the 2nd method detailed in the above post by Michel.

    Goodyear Blimp

    Once the intro screen completes, click on the "learning center" button in the upper left corner (it looks like a graduation cap--mortar board). Click on INSTRUMENTS. After the page loads, mouse over any of the items in the menu and you should see the appropriate instrument flash.

    There are still a few bugs to work out, but you should get the idea.

    steve

  • Hi Steve,

    It's nice to see you back *smile* ...
    I have played a little with your learning center menu and after changing from an item to another and selecting quickly to the inside items I got those warnings:


    This seems to be because the loadpano() is not ready yet, No?
    So I have thought that using an wait(load) could avoid the problem perhaps...
    I have taken a look on your code (Pufff... SO complex *g* *squint* so if I am on mistake, excuse me please *whistling* ) and perhaps this can do:
    menu.xml:

    Code
    onclick="if (xml.url != interior_high_res.xml,ld_pano(interior_high_res.xml,null,null,null,null,wait(load)););"
    .......
    	    	onclick="if (xml.url != under_nose.xml,ld_pano(under_nose.xml,null,null,null,null,wait(load)););"
    .......
    	    	onclick="if (xml.url != rear_quarter.xml,ld_pano(rear_quarter.xml,null,null,null,null,wait(load)););"


    local.xml:

    Hope it's correct *smile* ...
    SAlut

    edited: I forgot, perhaps it should be better to set the selectable parameter to false inside each textfield of the menu items...

    Einmal editiert, zuletzt von michel (26. März 2011 um 05:08)

  • Zitat
    Code
    <action name="showborder">
    		delayedcall(1.0, set(hotspot[pic_tableau].borderalpha, 1.0);updatescreen();); 
    		delayedcall(2.0, set(hotspot[pic_tableau].borderalpha, 0.2);updatescreen();); 
    		delayedcall(3.0, showborder() );
    	</action>

    Thanks Michel and Steve. Works great *wink*
    Steph

  • Hi,

    The delayed call works great. However, i had a problem with fluidity in one pano. Do you think it could come from the "updatescreen" call ? Or because i have six hotspots like this ?
    In this case, is it the only way to have this lightning effect ?

    Thank you very much.
    Steph

Jetzt mitmachen!

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