tag/style/controller doesn't support setting the images property of an imageview to an array of image files to create a flipbook animation.
Adapting the example from the old kitchen sink:
View (index.xml)
<Alloy>
<Window class="container">
<ImageView id='animImage'/>
</Window>
</Alloy>
TSS
".container": {
backgroundColor:"white"
},
"#animImage": {
width: 300,
height: 300,
}
Controller (index.js)
var imageArray = [];
for(var i=1; i<18; i++) {
imageArray.push('campFire'+i+'.gif');
}
$.animImage.images = imageArray;
//$.animImage.image = 'campFire1.gif'; // uncomment & static image visible
$.index.open();
I grabbed the images from KitchenSink/Resources/images/campFire*.gif. I renamed all the 01, 02, etc. images to campFire1.gif, etc. so my loop could be simpler.
Comments
- Bart Seaman 2013-02-08
The code provided is missing the function call to play the animation. Add the following line to the end of your controller:
$.animImage.start()
JSON Source