A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Stump on gettin data form custom class

  1. #1
    Member
    Join Date
    Mar 2003
    Posts
    50

    Stump on gettin data form custom class

    hello, I created this custom class after reading some tutorials. everything works but i have no clue on how to get the data.

    Q: how to get xmlList from the stage?

    PHP Code:
    package as3 {
        
    import flash.display.Sprite;
        
    import flash.net.URLRequest;
        
    import flash.net.URLLoader;
        
    import flash.events.*;

        public class 
    XmlLoader extends Sprite {
            var 
    xmlData:XML;
            var 
    xmlList:XMLList;
            public function 
    XmlLoader(address:String) {
                var 
    xmlRequest:URLRequest = new URLRequest(address);
                var 
    xmlLoader:URLLoader = new URLLoader();
                
    xmlLoader.load(xmlRequest);

                
    xmlLoader.addEventListener(Event.COMPLETExmlLoaded);

            }

            function 
    xmlLoaded(events:Event) {
                
    xmlData XML(events.target.data);
                [
    b]xmlList xmlData.children();[/b]
            }
        }


  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    These are your data:
    xmlData = XML(events.target.data);

    What is this supposed to be?
    xmlList = xmlData.children();
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Mar 2003
    Posts
    50
    the whole script basicly just loads a XML file.
    xmlList is a XML file
    example:
    PHP Code:
    <data id="4" name="somename" />
    <
    data id="5" name="someothername" /> 
    so i called the custom class from the stage
    PHP Code:
    loader = new XmlLoader(address_to_XML_file); 
    it loads create the xmlList

    but the problem is how do i get the xmlList from the stage timeline.

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