Simple code questions

  • Hi,

    I'm just working methodically through examples. Currently working on the action "hotspot_animate".

    I've managed to figure out all the steps in this action except for the inclusion of an if action within the delayedcall.


    inc(frame,1,get(lastframe),0);
    mul(ypos,frame,frameheight);
    txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));

    delayedcall(0.03, if(loaded, hotspot_animate() ) );

    </action>

    I've amended the delayed call to read as follows :-

    delayedcall(0.03, hotspot_animate() );


    This appears to work just fine on all devices. I can't see any reason why there should be an if function with conditions on the load status of the spot, the action is only called when loaded.

    Does it have something to do with transitioning to new scenes? I mean will the animation of an unloaded spot continue in the background slowing things down if this condition is not applied?

    Thanks
    Y.S

    Einmal editiert, zuletzt von pan2view (17. Juni 2012 um 12:35)

  • Loosely connected to the above problem I was looking into the if actions and founds this note:

    because of the xml format limitation of the usage of the '<' and '>' characters is not possible every time


    ">" or "GT" - greater than *

    Will it always work when using GT/ GE / ect.. - Should I just stick to those? Or are there situations where I would need to use "<" and ">" ?

    Thanks

    • updatecall (optionally)
      These action will be called every time when the value will be updated / changed!


    Could someone please explain the above. What does it mean that the value is changed? For example if I tween the alpha of a plugin onhover, how would an updatecall respond? Are there any examples of this function in use?


    Thanks
    Y.S

  • Hi,

    Will it always work when using GT/ GE / ect.. - Should I just stick to those? Or are there situations where I would need to use "<" and ">" ?

    the GT/GE/... operators will always work. The usage of '<' and '>' is optionally and of course only possible when not affecting the xml structure (e.g. inside CDATA tags or inside attributes).


    • updatecall (optionally)
      These action will be called every time when the value will be updated / changed!

    Could someone please explain the above. What does it mean that the value is changed? For example if I tween the alpha of a plugin onhover, how would an updatecall respond? Are there any examples of this function in use?

    When a variable will be 'tweened', it's value will be changed step by step (one step each frame), and the 'updatecall' can be used to call a custom action after each step.

    This callback should be used every carefully, because it can affect the performance when the called action would do something complex.

    Best regards,
    Klaus

Jetzt mitmachen!

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