Note that there are some explanatory texts on larger screens.

plurals
  1. POas3 problem with parsing data from xml
    primarykey
    data
    text
    <p>I'm trying to make a banner which the user can edit his Preferences in a xml file. My xml file looks like below.</p> <pre><code>&lt;billBoard&gt; &lt;items&gt; &lt;item&gt; &lt;imageUrl&gt;images/plaatje_1.jpg&lt;/imageUrl&gt; &lt;imageShowTime&gt;5&lt;/imageShowTime&gt; &lt;imageClickLink&gt;http://www.google.nl&lt;/imageClickLink&gt; &lt;imageClickLinkTarget&gt;_blank&lt;/imageClickLinkTarget&gt; &lt;animatiePosition&gt;top&lt;/animatiePosition&gt; &lt;animatieEffectType&gt;Cubic&lt;/animatieEffectType&gt; &lt;textboxen&gt; &lt;textbox&gt; &lt;textFontSize&gt;14&lt;/textFontSize&gt; &lt;textFontColor&gt;0xFFFFFF&lt;/textFontColor&gt; &lt;textBgColor&gt;0xFF0000&lt;/textBgColor&gt; &lt;textBgOpicity&gt;0.8&lt;/textBgOpicity&gt; &lt;textPadding&gt;10&lt;/textPadding&gt; &lt;textAnimationDirection&gt;left&lt;/textAnimationDirection&gt; &lt;textAnimatieTime&gt;2&lt;/textAnimatieTime&gt; &lt;textAnimatieDelay&gt;0.07&lt;/textAnimatieDelay&gt; &lt;textXposition&gt;200&lt;/textXposition&gt; &lt;textYposition&gt;300&lt;/textYposition&gt; &lt;text&gt;hier komt de tekst&lt;/text&gt; &lt;/textbox&gt; &lt;textbox&gt; &lt;textFontSize&gt;18&lt;/textFontSize&gt; &lt;textFontColor&gt;#FF0080&lt;/textFontColor&gt; &lt;textBgColor&gt;0xFF0000&lt;/textBgColor&gt; &lt;textBgOpicity&gt;0.6&lt;/textBgOpicity&gt; &lt;textPadding&gt;12&lt;/textPadding&gt; &lt;textAnimationDirection&gt;right&lt;/textAnimationDirection&gt; &lt;textAnimatieTime&gt;3&lt;/textAnimatieTime&gt; &lt;textAnimatieDelay&gt;0.07&lt;/textAnimatieDelay&gt; &lt;textXposition&gt;200&lt;/textXposition&gt; &lt;textYposition&gt;300&lt;/textYposition&gt; &lt;text&gt;hier komt de tekst 2 van item 1&lt;/text&gt; &lt;/textbox&gt; </code></pre> <p>the goal is that i can parse the item associated with textboxes.</p> <p>to parse the data i use a for loop in a foor loop who looks like below:</p> <pre><code>_billboardData_array = new Array(); for (var i:int = 0; i &lt; xml.billBoard.items.item.length(); i++) { //hold the data of the billboardItems var billBoardData:Array = new Array(); billBoardData['billBoardID'] = i; billBoardData['imageUrl'] = xml.billBoard.items.item[i].imageUrl; billBoardData['imageShowTime'] = xml.billBoard.items.item[i].imageShowTime; billBoardData['imageClickLink'] = xml.billBoard.items.item[i].imageClickLink; billBoardData['imageClickLinkTarget'] = xml.billBoard.items.item[i].imageClickLinkTarget; billBoardData['animatiePosition'] = xml.billBoard.items.item[i].animatiePosition; trace("&lt;---" + billBoardData['imageUrl'] + "---&gt;"); for (var j:int = 0; j &lt; xml.billBoard.items.item[i].textboxen.textbox.length(); j++) { billBoardData['textFontSize'] = xml.billBoard.items.item[i].textboxen.textbox.textFontSize[j]; trace(billBoardData['textFontSize'] = xml.billBoard.items.item[i].textboxen.textbox.textFontSize[j]); } //trace(item.textboxen[i].textbox.length()); _billboardData_array[i] = billBoardData; } } public function get billboardData_array():Array { return _billboardData_array; } </code></pre> <p>when i parse this i get the right results like:</p> <p>&lt;---images/plaatje_1.jpg---> 14 18 30 &lt;---images/plaatje_2.jpg---> 20 26</p> <p>that means image 1 has three textboxes with fontsize: 14,18,30.</p> <p>now i've the following problem.</p> <p>as you can see i've get function from my billboardData_array i want to call this get function in other classes to get the correct data i need. </p> <p>for now i made a example function like:</p> <pre><code>public function showBla():void { trace("show bla functie"); trace(swisBillBoardData.billboardData_array[0]['textFontSize']); } </code></pre> <p>this function returns the last fontsize but i need to loop through it to display text on the stage. </p> <p>i hope someone can help me with this one. </p> <p>thanks a lot </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload