开发者

update array then update stage

I'm trying to write some code for a simple product scroller. I have an array of product items and when the user clicks the next button I want to remove the item at the last index of the array add add it to the start index and then update开发者_高级运维 the stage with the results.


//create a new Array
var item:Array = [];

//add the last element of your Array
item[0] = myArray.pop();

//merge both arrays with the last element as the first element
myArray = item.concat(myArray );

//update the stage with the new value of myArray

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜