problem with arrays
hi
how are you guys ? i hope you all fine ..
i have little problem with the arrays contents ..
the problem is , when i try to trace the array items it shows the arrays items as objects like this
[object Object],[object Object],[object Object]
here is the source code (i lighted the trace message and the arrays )
package {
import flash.display.MovieClip;
import flash.events.MouseEvent
import flash.events.Event;
public class MAIN extends MovieClip {
var additemsvar:String
var addpricevar:int
var removeitemvar:int
var itemsnp:Array = new Array (1000000)
var za:int = 0
public function MAIN () {
addbutton.addEventListener(MouseEvent.CLICK ,addbutton1)
removebutton.addEventListener(MouseEvent.CLICK ,removebutton1)
addEventListener(Event.ENTER_FRAME , onEnterFrame)
}
public function onEnterFrame (event:Event){
if(listbox1.selectedIndex != -1){
itemname11.text = String({label:listbox1.getItemAt(listbox1.selectedIndex)})
}
}
public function addbutton1 (event:MouseEvent){
additemsvar = additems.text
addpricevar = int (addprice.text)
listbox1.addItem ({label:itemsnp[za]})
listbox2.addItem ({label:itemsnp[za]})
itemsnp.push({additemsvar:addpricevar});
za += 1
trace (itemsnp.toString())
}
public function removebutton1 (event:MouseEvent){
trace (listbox1.selectedIndex)
listbox1.removeItemAt(listbox1.selectedIndex)
}
}
}
thank you