Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

display .png that is created by two var in osweb

hi

I’m converting my experiments to OSWeb and I am currently facing

a problem,

when using:

draw image center=1 file="[letter_arb1].png" scale=1 show_if=always x=323 y=-175

z_index=0

everything works fine

but when using

draw image center=1file="[[cond]_arb1].png" scale=1 show_if=always x=323 y=-175

z_index=0

and cond = letter the experimant crash with:

Uncaught TypeError: Cannot read property 'data' of undefined

and in the console: "[letter_arb1].png" does notexist"

any suggestions?

Dror

Comments

  • Hi Dror,

    Thanks for pointing this out. Nested variable definitions indeed they don't work in OSWeb. Until that's fixed, as a workaround, you can define an intermediate variable in the Prepare phase of an inline_javascript item:

    vars.my_image = vars[vars.cond + 'arb1']
    

    And then use this in the sketchpad like so:

    draw image center=1file="[my_image].png" scale=1 show_if=always x=323 y=-175 z_index=0
    

    Hope this helps!

    Sebastiaan

Sign In or Register to comment.