Setting the default image for Uize.Widget.Swap.Image

31 views
Skip to first unread message

KH

unread,
Jul 4, 2012, 1:20:43 AM7/4/12
to ui...@googlegroups.com
 This should be an easy problem but I'm not able to make it work.

 I am trying to set the default image for a Swap Image Widget. Working from the example, http://www.uize.com/examples/swap-image-png.html,  I tried setting the "src" property but it doesn't seem to be working. When I set the 'src' property the widget itself is getting messed up and it doesn't  trigger the event for the image1. If I click on "image2" and then click on "image1", the image1 appears. Please see below for the part of the code where I set the src.

I am obviously missing something. Please let me know if you have some ideas to try.

page.addChild (
        'imageSwap',
        Uize.Widget.Swap.Image,
        {
          background:'none',
          viewSeedSizeX:0,
          viewSeedSizeY:1,
          viewSeedAlignX:.5,
          viewSeedAlignY:.5,
          dissolve:false,
          viewContentAlignX:'none',
          viewContentAlignY:'none',
          crossFade:true,
          built:false,
  src: 'http://localhost/img1'

        }
      ).fade.set ({duration:0});

Thanks,

Reply all
Reply to author
Forward
0 new messages