make swiffy load/play when page does

  • Started
  • Last post
  • 1 Response
  • wwfc

    hi all... off to a mare of a start to the week!

    does anyone know how i can make a swiffy conversion play only when the div it is in gets swiped to. or a workaround for it...

    i am using jquery mobile swipe example for all of the pages and the user swipes through the pages in turn etc...

    on the one page there is a simple animation that writes out some text - it does this only once and then stops. the animation begins straight away - and i can't realistically just add some blank frames to the start as there is no way of knowing how long it will take the user to get to said page/animation.

    i have read about different ways of restarting a swiffy animation - or making it wait until the page/div is called - but i have no idea of how to implement this...

    the code itself is very simplistic...
    it calls the runtime file at the start of the doc... and then has this in the relevant place for the swiffy movie itself:

    <li class="page">
    <div id="apDiv2"></div>
    <div id="swiffycontainer1" style="width: 1024px; height: 768px">
    </div>
    <script>

    var stage = new swiffy.Stage(document.getElement...
    swiffyobject1);

    stage.start();
    </script>

    anyone know how i can refresh/restart or simply start the animation as it is swiped to?

    :-(

  • wwfc0

    ...so - i'm hoping that someone can pout me right on this now...

    using this script:

    <script type="text/javascript">
    $(function() {
    $("#apDiv2").click(function() {
    $("#swiffycontainer2").load("#sw...

    });
    });
    </script>

    when i click on apdiv2 it does load a new version of the swiffycontainer and swiffyobject...

    but...

    it duplicates the div with both swiffy elelments in.

    is there any other variation on that script above that will simply replacing the existing swiffy stuff, in other words making it play from the start again?

    doing my fruit in !!!! :-(