dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: xml tree component & mediaPlayBack comp

  1. #1
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666

    xml tree component & mediaPlayBack comp

    hello .
    i have started a simple media component . so here it is ..
    this i have on the Stage a
    //
    mediaPlayback component
    tree component
    //
    i am using this code
    Code:
    //my Tree setstyle
    tree_comp.setStyle("themeColor", "haloOrange");
    //load the XML source
    tree_compDataProvider = new XML();
    tree_compDataProvider.ignoreWhite = true;
    tree_compDataProvider.load("tree_source.xml");
    tree_compDataProvider.onLoad = function(success) {
    	if (success) {
    		tree_comp.dataProvider = tree_compDataProvider;
    	} else {
    		trace("unable to load/parse tree_source.xml");
    	}
    };
    // add the event listeners
    tree_comp.addEventListener("nodeOpen", myTreeListener);
    tree_comp.addEventListener("nodeClose", myTreeListener);
    tree_comp.addEventListener("change", myTreeListener);
    var treeListener:Object = new Object();
    myTreeListener.change = function(evt:Object) {
    	mp3MediaPlayer.contentPath = evt.target.selectedNode.attributes.data;
    	mp3MediaPlayer.play(this.selectedNode);
    };
    tree_comp.addEventListener("change", myTreeListener);
    and here i cannot get the mp3 to play when selected from the tree component
    any help ---?
    Code:
    //XML sample code ...
    <?xml version="1.0" encoding="iso-8859-1"?>
    <node label="Quick navigation to Artists" value="1">
      <node label="Jonas">
           <node label="funky.mp3" data="http://www.mySite.com/funky.mp3" />
    thanks for any input on this 1 . im stuck at the moment .
    cheers T
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Just wondering in your xml file where is the root element?
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Between Flash & Flashkit timothye's Avatar
    Join Date
    Dec 2003
    Location
    Sweden
    Posts
    1,666
    anye help please ?
    cheers
    I want to learn .
    wannabe flasher [ Actionscript 2.0 ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center