Plugin creation : How to ask krpano to wait to play the animation until i click on a hotspot.

  • Hello,

    Could you help me : I would like to understand how did you make textfield plugin ?

    I've tried to understand the textfiel.as but it says i have the wrong krpano version (i've tried with 10.0.7 & 10.0.8 beta).

    What i would like to do : Create an animation like a backgroud which slowly appears (like textfiel plugin).

    I know how to make this animation in flash.

    But i need krpano wait to play the animation until i click on a hotspot.

    Because now, my animation starts playing since the begining, even if it is not visible in krpano.

    thank for your help

    /V

  • Hi,

    I've tried to understand the textfiel.as but it says i have the wrong krpano version (i've tried with 10.0.7 & 10.0.8 beta).

    only the version checking must be changed/adopted:

    e.g. just change this line:

    Code
    if ( krpano.get("version") != "1.0.7")

    to this:

    Code
    if ( krpano.get("version") >= "1.0.7")

    to get the plugin working in 1.0.7 and 1.0.8 and newer versions

    Quote

    my animation starts playing since the begining, even if it is not visible in krpano.

    do you wait/listen for the ADDED_TO_STAGE event?
    before it's not visible,

    best regards,
    Klaus

  • Hi and thanx again !

    Code
    if ( krpano.get("version") >= "1.0.7")

    Yes, it works now.
    Sorry, when i i've tried to modify this line before posting here, my problem was a syntax problem. It's ok now.

    I'll work on that exemple.

    Basicly, what i want to do is a plugin which for example has a backgroud which slowly appears (i know how to do that in pure as3 or on the timeline).

    I want this animation play only one time and starts when the hotspot show the plugin (as in textfield plugin).

    So, i click on a hotspot, the action is :

    Code
    onclick="set(plugin[myplugin].visible,true);"

    And now the plugin appears and i want the animation in it starts playing...


    For now, my animations play since the beginning, when the pano is loaded, even if the plugin is hyde.
    I know why (action is just "show plugin", but i don't know how to do...

    Quote

    do you wait/listen for the ADDED_TO_STAGE event?

    I'll think about that *wink* It sounds like a solution.

  • Hi,

    I think the solution might be :

    Code
    if (stage == null)
    {
        // lance le plugin
        addEventListener(Event.ADDED_TO_STAGE, lancerplugin);
        function lancerplugin(evt:Event):void 
    }


    But i've tried many things and still don't know how to finish this code. Can you help me ?

    Thanx

Participate now!

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