开发者

update array then update stage

开发者 https://www.devze.com 2023-01-15 08:32 出处:网络
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

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

精彩评论

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