The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 1 of 1

Thread: XML Loader

  1. #1

    XML Loader

    Hi. I want to create a flash movie that uses XML to load some data. I want each line of data to appear one by one when a user clicks on the screen. So far I have all my data added to the screen but I'm not sure how to write the clicking mechanism for this.

    I've managed to remove an object by clicking on it, but I don't know how get that object back. Ideally I'd like each object to be shown one item at a time.

    My Document Class Follows

    package  {
    	import flash.display.MovieClip;
    	import flash.text.TextField;
    	public class MuppetsDoc extends MovieClip {
    		public var myData:XML = <data>
    				<a>Kermit the Frog</a>
    				<b>Jim Henson</b>
    				<a>Miss Piggy</a>
    				<b>Frank Oz</b>
    				<b>Frank Oz</b>
    				<a>The Swedish Chef</a>
    				<b>Jim Henson/Frank Oz</b>
    		public function MuppetsDoc() {
    			// constructor code
    			//muppets_txt.text = myData.item[2].a.length();
    			var aTxt:String = myData.item[2].a.text();
    muppet_name0.addEventListener(MouseEvent.CLICK, fl_ClickToKermit);
    function fl_ClickToKermit(event:MouseEvent):void
    	muppet_name0.visible = false;
       if (muppet_name0.visible == false) {
            //if it is make them invisible
            muppet_name0.visible = false;
        } else {
            //otherwise make them visible
            muppet_name0.visible = true;
    Last edited by jbsosbj; April 12th, 2012 at 10:29 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012