/ Published in: ActionScript 3
1067: Implicit coercion of a value of type __AS3__.vec:Vector. to an unrelated type __AS3__.vec:Vector.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
public function getMainItems():Vector.<VOItem> { //Length of Main items MainItemLn = xml.item.length(); //Vector class of MainItems var MainVO:Vector = new Vector.<VOItem>(MainItemLn,true); for(var i:int = 0; i < MainItemLn; ++i) { MainVO[i] = new VOItem(); MainVO[i].id = i; MainVO[i].title = xml.item[i].@title; MainVO[i].img = xml.item[i].@img; } return MainVO } trace(getMainItems()[0].title); //or trace(getMainItems()[1].title); //and so on.. . . .
URL: http://blog.alptugan.com/?p=380