hold value node at event handler

  • taufiq
  • Newbie
  • Newbie
  • taufiq
  • Posts: 7

Post 3+ Months Ago

hi all, thanks for read my thread, im having problems to hold value node, in event handler when i load movie.
here's my xml
Code: [ Select ]
<?xml version="1.0" encoding="UTF-8"?>
<movies total_count="517" data_count="16" current_page="0" >
    <movie id="5">
        <id>5</id>
<title><![CDATA[The Matrix]]></title>
<code><![CDATA[085391773726]]></code>
<genre>1</genre>
<multigenre>1,0,0,0,0,0</multigenre>
<description><![CDATA[Mind-bending action/thriller about a programmer who discovers that his world isn't what it seems. The plot is a little convoluted, but it's filled with dazzling effects and blistering action.]]></description>
<starring><![CDATA[Keanu Reeves,Lawrence Fishburne]]></starring>
<director><![CDATA[Andy Wachowski, Larry Wachowski]]></director>

<producer></producer>
<sinematographer></sinematographer>
<studio></studio>
<year_produced>1999</year_produced>
<country></country>
<rating>9</rating>
<rating_user>0</rating_user>
<rating_imdbcom>8</rating_imdbcom>
<types>1</types>
<category>R</category>
<language>1</language>

<subtitle>1</subtitle>
<duration>60</duration>
<picture>5_cover.gif</picture>
<icon>5_icon.gif</icon>
<entry_date>2008-05-29 13:35:48</entry_date>
<update_time>2008-05-29 13:35:48</update_time>
    </movie>
    
    <movie id="7">
        <id>7</id>

<title><![CDATA[The Corruptor]]></title>
<code><![CDATA[794043477621]]></code>
<genre>1</genre>
<multigenre>1,0,0,0,0,0</multigenre>
<description><![CDATA[A rookie cop teams up with another NYPD detective in an effort to clean up the streets of mob-ruled Chinatown, but he soon realizes that the ties of the Chinese mafia go deeper than he suspected.]]></description>
<starring><![CDATA[Chow Yun-Fat,Mark Wahlberg]]></starring>
<director><![CDATA[James Foley]]></director>
<producer></producer>
<sinematographer><![CDATA[Juan Ruiz Anchía]]></sinematographer>
<studio></studio>
<year_produced>1999</year_produced>
<country></country>
<rating>0</rating>

<rating_user>0</rating_user>
<rating_imdbcom>6</rating_imdbcom>
<types>1</types>
<category>R</category>
<language>1</language>
<subtitle>1</subtitle>
<duration>60</duration>
<picture>7_cover.gif</picture>
<icon>7_icon.gif</icon>

<entry_date>2008-05-29 13:35:48</entry_date>
<update_time>2008-05-29 13:35:48</update_time>
    </movie>
    
    <movie id="13">
        <id>13</id>
<title><![CDATA[The Mummy]]></title>
<code><![CDATA[025192063626]]></code>
<genre>1</genre>
<multigenre>1,0,0,0,0,0</multigenre>

<description><![CDATA[Spoofy remake of 1930s horror classic about Egyptian expedition disturbing mummy's tomb. Boasting spectacular effects, appealing hero, Indiana Jones-style action, and corny, good-natured humor, this amply entertains fun-loving adventure buffs.
]]></description>
<starring><![CDATA[Brendan Fraser,Rachel Weisz]]></starring>
<director><![CDATA[Stephen Sommers]]></director>
<producer></producer>
<sinematographer></sinematographer>
<studio></studio>
<year_produced>1999</year_produced>
<country></country>
<rating>0</rating>
<rating_user>0</rating_user>
<rating_imdbcom>0</rating_imdbcom>
<types>1</types>

<category>R</category>
<language>1</language>
<subtitle>1</subtitle>
<duration>60</duration>
<picture>13_cover.gif</picture>
<icon>13_icon.gif</icon>
<entry_date>2008-05-29 13:35:48</entry_date>
<update_time>2008-05-29 13:35:48</update_time>
    </movie>
    
</movies>
<data_total>
<total_count>517</total_count>

<data_count>16</data_count>
<current_page>0</current_page>
</data_total>

</xml>
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <movies total_count="517" data_count="16" current_page="0" >
  3.     <movie id="5">
  4.         <id>5</id>
  5. <title><![CDATA[The Matrix]]></title>
  6. <code><![CDATA[085391773726]]></code>
  7. <genre>1</genre>
  8. <multigenre>1,0,0,0,0,0</multigenre>
  9. <description><![CDATA[Mind-bending action/thriller about a programmer who discovers that his world isn't what it seems. The plot is a little convoluted, but it's filled with dazzling effects and blistering action.]]></description>
  10. <starring><![CDATA[Keanu Reeves,Lawrence Fishburne]]></starring>
  11. <director><![CDATA[Andy Wachowski, Larry Wachowski]]></director>
  12. <producer></producer>
  13. <sinematographer></sinematographer>
  14. <studio></studio>
  15. <year_produced>1999</year_produced>
  16. <country></country>
  17. <rating>9</rating>
  18. <rating_user>0</rating_user>
  19. <rating_imdbcom>8</rating_imdbcom>
  20. <types>1</types>
  21. <category>R</category>
  22. <language>1</language>
  23. <subtitle>1</subtitle>
  24. <duration>60</duration>
  25. <picture>5_cover.gif</picture>
  26. <icon>5_icon.gif</icon>
  27. <entry_date>2008-05-29 13:35:48</entry_date>
  28. <update_time>2008-05-29 13:35:48</update_time>
  29.     </movie>
  30.     
  31.     <movie id="7">
  32.         <id>7</id>
  33. <title><![CDATA[The Corruptor]]></title>
  34. <code><![CDATA[794043477621]]></code>
  35. <genre>1</genre>
  36. <multigenre>1,0,0,0,0,0</multigenre>
  37. <description><![CDATA[A rookie cop teams up with another NYPD detective in an effort to clean up the streets of mob-ruled Chinatown, but he soon realizes that the ties of the Chinese mafia go deeper than he suspected.]]></description>
  38. <starring><![CDATA[Chow Yun-Fat,Mark Wahlberg]]></starring>
  39. <director><![CDATA[James Foley]]></director>
  40. <producer></producer>
  41. <sinematographer><![CDATA[Juan Ruiz Anchía]]></sinematographer>
  42. <studio></studio>
  43. <year_produced>1999</year_produced>
  44. <country></country>
  45. <rating>0</rating>
  46. <rating_user>0</rating_user>
  47. <rating_imdbcom>6</rating_imdbcom>
  48. <types>1</types>
  49. <category>R</category>
  50. <language>1</language>
  51. <subtitle>1</subtitle>
  52. <duration>60</duration>
  53. <picture>7_cover.gif</picture>
  54. <icon>7_icon.gif</icon>
  55. <entry_date>2008-05-29 13:35:48</entry_date>
  56. <update_time>2008-05-29 13:35:48</update_time>
  57.     </movie>
  58.     
  59.     <movie id="13">
  60.         <id>13</id>
  61. <title><![CDATA[The Mummy]]></title>
  62. <code><![CDATA[025192063626]]></code>
  63. <genre>1</genre>
  64. <multigenre>1,0,0,0,0,0</multigenre>
  65. <description><![CDATA[Spoofy remake of 1930s horror classic about Egyptian expedition disturbing mummy's tomb. Boasting spectacular effects, appealing hero, Indiana Jones-style action, and corny, good-natured humor, this amply entertains fun-loving adventure buffs.
  66. ]]></description>
  67. <starring><![CDATA[Brendan Fraser,Rachel Weisz]]></starring>
  68. <director><![CDATA[Stephen Sommers]]></director>
  69. <producer></producer>
  70. <sinematographer></sinematographer>
  71. <studio></studio>
  72. <year_produced>1999</year_produced>
  73. <country></country>
  74. <rating>0</rating>
  75. <rating_user>0</rating_user>
  76. <rating_imdbcom>0</rating_imdbcom>
  77. <types>1</types>
  78. <category>R</category>
  79. <language>1</language>
  80. <subtitle>1</subtitle>
  81. <duration>60</duration>
  82. <picture>13_cover.gif</picture>
  83. <icon>13_icon.gif</icon>
  84. <entry_date>2008-05-29 13:35:48</entry_date>
  85. <update_time>2008-05-29 13:35:48</update_time>
  86.     </movie>
  87.     
  88. </movies>
  89. <data_total>
  90. <total_count>517</total_count>
  91. <data_count>16</data_count>
  92. <current_page>0</current_page>
  93. </data_total>
  94. </xml>

as you can see i have id at my parent movie, now i want to load movie and title, also save idea which load_film mc[i]//invoked i is value node,here my script
Code: [ Select ]
myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("http://www.subtitlesgroup.com/subcat/index.php/movie/list/1/1");
myXML.ref = this;
myXML.onLoad = function(succes) {
    if (succes) {
        var root = this.firstChild;
        var nodes = root.childNodes;
        for (var i = 0; i<nodes.length; i++) {
            subnodes = nodes[i].childNodes;
            var duplicate_movie:MovieClip=_root.genre["load_film"+i];//
            var mclis:Object = new Object();
            mclis.onLoadInit = function(target_mc:MovieClip) {//Invoked when the actions on the first frame of the loaded clip have been executed
                target_mc._width = 60;//applying new width
                target_mc._height = 100;//applying new height
                target_mc.onRelease = function() {
                    _root.genre.attachMovie("description_bg", "instance", _root.genre.getNextHighestDepth());//attach description bg on library to stage to display details
                    target_mc.movie_idsaves = movieid ;//hold value "id"
                    var path_movieid = this.movie_idsaves;//display id which suitable with load_film in our click
                    trace(path_movieid)
                    detailXML.load("http://www.subtitlesgroup.com/subcat/index.php/movie/detail/"+path_movieid+"/1");//load new xml when get id
                    detailXML.ref = this;
                    detailXML.onLoad = function(succes){
                        if(succes){
                            var root = this.firstChild
                            nodes = root.childNodes     
                            subnodes = nodes[0].childNodes
                            _root.genre.instance.title_txt.text = subnodes[1].firstChild.toString()
                            _root.genre.instance.descriptions_txt.text = subnodes[5].firstChild.toString()
                            _root.genre.instance.starring_txt.text = subnodes[6].firstChild.toString()
                            _root.genre.instance.director_txt.text = subnodes[7].firstChild.toString()
                            _root.genre.instance.genre_txt.text = subnodes[3].firstChild.toString()
                            _root.genre.instance.format_txt.text = "undefined"
                            _root.genre.instance.language_txt.text = subnodes[18].firstChild.toString()
                            _root.genre.instance.subtitles_txt.text = subnodes[19].firstChild.toString()
                            _root.genre.instance.status_txt.text = "undefined"                                                
                            _root.genre.instance.coverdetails_mc.loadMovie("http://www.subtitlesgroup.com/movies_pictures/"+subnodes[21].firstChild.toString())
                        } else trace("Error loading XML document")
                        }
                };
            };
            var text_btn=_root.genre["cover_title"+i].text = subnodes[1].firstChild.toString();/*function for display movie name*/
            var image_path ="http://www.subtitlesgroup.com/movies_pictures/"+subnodes[21].firstChild.toString();
            var movieid = subnodes[0].firstChild.toString();
            var mcl:MovieClipLoader = new MovieClipLoader();
            mcl.addListener(mclis);
            mcl.loadClip(image_path, duplicate_movie);
        }
    } else {
        trace("Error loading otherXML");
        }
};/*end other xml load function*/
  1. myXML = new XML();
  2. myXML.ignoreWhite = true;
  3. myXML.load("http://www.subtitlesgroup.com/subcat/index.php/movie/list/1/1");
  4. myXML.ref = this;
  5. myXML.onLoad = function(succes) {
  6.     if (succes) {
  7.         var root = this.firstChild;
  8.         var nodes = root.childNodes;
  9.         for (var i = 0; i<nodes.length; i++) {
  10.             subnodes = nodes[i].childNodes;
  11.             var duplicate_movie:MovieClip=_root.genre["load_film"+i];//
  12.             var mclis:Object = new Object();
  13.             mclis.onLoadInit = function(target_mc:MovieClip) {//Invoked when the actions on the first frame of the loaded clip have been executed
  14.                 target_mc._width = 60;//applying new width
  15.                 target_mc._height = 100;//applying new height
  16.                 target_mc.onRelease = function() {
  17.                     _root.genre.attachMovie("description_bg", "instance", _root.genre.getNextHighestDepth());//attach description bg on library to stage to display details
  18.                     target_mc.movie_idsaves = movieid ;//hold value "id"
  19.                     var path_movieid = this.movie_idsaves;//display id which suitable with load_film in our click
  20.                     trace(path_movieid)
  21.                     detailXML.load("http://www.subtitlesgroup.com/subcat/index.php/movie/detail/"+path_movieid+"/1");//load new xml when get id
  22.                     detailXML.ref = this;
  23.                     detailXML.onLoad = function(succes){
  24.                         if(succes){
  25.                             var root = this.firstChild
  26.                             nodes = root.childNodes     
  27.                             subnodes = nodes[0].childNodes
  28.                             _root.genre.instance.title_txt.text = subnodes[1].firstChild.toString()
  29.                             _root.genre.instance.descriptions_txt.text = subnodes[5].firstChild.toString()
  30.                             _root.genre.instance.starring_txt.text = subnodes[6].firstChild.toString()
  31.                             _root.genre.instance.director_txt.text = subnodes[7].firstChild.toString()
  32.                             _root.genre.instance.genre_txt.text = subnodes[3].firstChild.toString()
  33.                             _root.genre.instance.format_txt.text = "undefined"
  34.                             _root.genre.instance.language_txt.text = subnodes[18].firstChild.toString()
  35.                             _root.genre.instance.subtitles_txt.text = subnodes[19].firstChild.toString()
  36.                             _root.genre.instance.status_txt.text = "undefined"                                                
  37.                             _root.genre.instance.coverdetails_mc.loadMovie("http://www.subtitlesgroup.com/movies_pictures/"+subnodes[21].firstChild.toString())
  38.                         } else trace("Error loading XML document")
  39.                         }
  40.                 };
  41.             };
  42.             var text_btn=_root.genre["cover_title"+i].text = subnodes[1].firstChild.toString();/*function for display movie name*/
  43.             var image_path ="http://www.subtitlesgroup.com/movies_pictures/"+subnodes[21].firstChild.toString();
  44.             var movieid = subnodes[0].firstChild.toString();
  45.             var mcl:MovieClipLoader = new MovieClipLoader();
  46.             mcl.addListener(mclis);
  47.             mcl.loadClip(image_path, duplicate_movie);
  48.         }
  49.     } else {
  50.         trace("Error loading otherXML");
  51.         }
  52. };/*end other xml load function*/

i dont have problems to load cover movie and title but, i can't hold value for id, it always looping. and will get the last id
did anyone have solutions,
it will be great, and respectfull,
thanks

p/s i hope graphixbox know my problems can help me :D,
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 13 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.