how to WAIT (for secondary assets to LOAD)?

  • I've got some secondary assets (photos, plans, etc.) that are loaded each time a new pano scene is loaded.
    A regular Wait(Load) works 95+% of the time but every once in a while, the new pano loads before the secondary assets are loaded and creates and bugs out (the window doesn't resize per the asset). Is there a way to halt xml execution until a particular layer is loaded?

    Basic code flow is:
    New pano scene is clicked
    layers containing secondary assets are faded out
    Wait (load)
    URLs for the secondary assets are stored as custom scene attributes.
    Replace layer URLS with those from new scene
    >>>Can I wait here until new URLS are retrieved and we have new image heights and widths <<<
    Resize overlay window based on layer[xxx].imagewidth and layer[xxx].imageheight
    Fade new assets in.

  • So I've got something that seems to be working although it doesn't seem like a very elegant solution. If anyone has a better idea, I'm all ears!

    New code flow is:
    New pano scene is clicked
    >>> Set(layer[xxx].imagewidth, 0); <<<
    layers containing secondary assets are faded out

    Replace layer URLS with those from new scene
    >>> callwhen(layer[xxx].imagewidth != 0, assetsLoaded(); ); <<<


    Everything afterwards, is moved to the assetsLoaded action.
    Resize overlay window based on layer[xxx].imagewidth and layer[xxx].imageheight
    Fade new assets in.

Jetzt mitmachen!

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