[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 401
  • Last Modified:

AS3 papervision3D: Cant get my XML text to display in my dynamic textfield?

I am able to read in all of my XML but I cant get my text from XML into my dynamic textfield with my pv3D class.  What am I not doing?  I need to get the "copy" node (within the XML) to replace the string: textField.text="This is only some sample text This is only some sample text";

Thanks for all the help!
package {
	import flash.events.Event;
	import br.com.stimuli.loading.BulkLoader;
	import br.com.stimuli.loading.BulkProgressEvent;
	import flash.display.Sprite;
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	import flash.filters.GlowFilter;
	import flash.display.MovieClip;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFieldAutoSize;
	import flash.text.TextFormatAlign;
	import flash.text.AntiAliasType;
	import flash.display.DisplayObject;

	import gs.easing.Quint;
	import gs.TweenLite;
	import org.papervision3d.events.InteractiveScene3DEvent;
	import org.papervision3d.materials.BitmapMaterial;
	import org.papervision3d.objects.DisplayObject3D;
	import org.papervision3d.objects.primitives.Plane;
	import org.papervision3d.view.BasicView;
	import org.papervision3d.view.Viewport3D;
	import org.papervision3d.core.effects.view.ReflectionView;
	import org.papervision3d.materials.MovieMaterial;

	public class Main extends BasicView {
		protected var planes:Array=[];
		protected var images:Array=[];
		protected var numItems:Number;
		protected var currentItem:Number=3;
		protected var angle:Number=25;
		protected var rightBtn:Sprite;
		protected var leftBtn:Sprite;
		protected var xmlPath:String="xml/imageXML.xml";
		protected var bulkInstance:BulkLoader;
		private var carousel:DisplayObject3D=new DisplayObject3D  ;
		private var bitmapViewport:Viewport3D=new Viewport3D(940,300);

		
		private var view:ReflectionView;

		public function Main():void {
			super(940,300,true,true);

			addChild(bitmapViewport);
			bitmapViewport.interactive=true;
			loadXML();
		}

		//First load our XML
		protected function loadXML():void {
			bulkInstance=new BulkLoader("bulkInstance");
			bulkInstance.add(xmlPath);
			bulkInstance.addEventListener(BulkProgressEvent.COMPLETE,onXMLReady);
			bulkInstance.start();
		}

		//When our xml is ready parse and load our images
		protected function onXMLReady(evt:BulkProgressEvent):void {
			bulkInstance.removeEventListener(BulkProgressEvent.COMPLETE,onXMLReady);
			bulkInstance.addEventListener(BulkProgressEvent.COMPLETE,onImagesReady);

			var xml:XML=bulkInstance.getXML(xmlPath);
			var xmlList:XMLList=xml.image;

			for (var i:int=0; i<xmlList.length(); i++) {
				var imagePath:String=String(xmlList[i].pic);
				//var textPath:String=String(xmlList[i].copy);
				bulkInstance.add(imagePath);
				images.push(imagePath);
				//images.push(textPath);
				//trace("xmlList[i].pic = " + xmlList[i].pic);
				//trace("xmlList[i].copy = " + xmlList[i].copy);
			}
			numItems=images.length;
		}
		protected function onImagesReady(evt:BulkProgressEvent):void {
			init();
		}
		protected function init():void {
			createChildren();
			startRendering();
		}
		protected function createChildren():void {
			for (var i:int=0; i<numItems; i++) {
				var mat:BitmapMaterial=new BitmapMaterial(bulkInstance.getBitmapData(images[i]));
				trace("images[i] = " + images[i]);
				mat.interactive=true;
				mat.smooth=true;
				var plane:Plane=new Plane(mat,360,280);
				carousel.addChild(plane);
				plane.rotationY=360/numItems*i;
				plane.moveForward(900);
				planes.push(plane);

				//reflection should be implimented here///////////////////////////
				view=new ReflectionView(940,300,true,true);
				addChild(view);
				view.singleRender();


				var textMC:MovieClip=new MovieClip  ;
				var textField:TextField=new TextField  ;
				textField.wordWrap=true;
				textField.width=400;
				textField.height=280;
				textField.multiline=true;
				textField.text="This is only some sample text This is only some sample text";
				textField.autoSize=TextFieldAutoSize.LEFT;
				textField.antiAliasType=AntiAliasType.ADVANCED;



				var textFormat:TextFormat=new TextFormat("Arial");
				textFormat.size=30;
				textFormat.color=0xffffff;
				textFormat.bold=false;
				textFormat.align="center";
				textMC.defaultTextFormat=textFormat;
				textField.setTextFormat(textFormat);
				//Create a rect the size of the MovieClip with an opacity of 0
				//This lets the TextField render properly
				textMC.graphics.beginFill(0x00ff00,0);
				textMC.graphics.drawRect(0,190,360,80);
				textMC.graphics.endFill();
				textMC.addChild(textField);

				var tfMaterial:MovieMaterial=new MovieMaterial(textMC,true,false,true);
				tfMaterial.interactive=true;
				tfMaterial.smooth=true;
				tfMaterial.tiled=true;
				var tmpPlane:Plane=new Plane(tfMaterial,400,380);
				tmpPlane.y=-360;
				plane.addChild(tmpPlane);


				plane.id=i;
				plane.addEventListener(InteractiveScene3DEvent.OBJECT_OVER,onPlaneOver);
				plane.addEventListener(InteractiveScene3DEvent.OBJECT_OUT,onPlaneOut);
				plane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS,onPlaneClick);
				scene.addChild(carousel);
				startRendering();
			}
			camera.zoom=80;
		}


		protected function onPlaneOver(evt:InteractiveScene3DEvent):void {
			var plane:Plane=evt.target as Plane;
			plane.moveForward(-200);
			trace("over");
		}
		protected function onPlaneOut(evt:InteractiveScene3DEvent):void {
			var plane:Plane=evt.target as Plane;
			plane.moveForward(200);
			trace("onPlaneOut");
		}
		protected function onPlaneClick(evt:InteractiveScene3DEvent):void {
			var plane:Plane=evt.target as Plane;
			//plane.moveForward(-200);
			trace("onPlaneClick");
		}
		public function MouseOverStage() {
			stage.addEventListener( Event.MOUSE_LEAVE, mouseOutHandler );
		}

		private function mouseOutHandler( event:Event ):void {
			trace( "mouse has left the stage" );
		}


		override protected function onRenderTick(event:Event=null):void {
			carousel.rotationY-=viewport.containerSprite.mouseX/100;
			renderer.renderScene(scene,camera,bitmapViewport);

		}
	}
}


<?xml version="1.0" encoding="utf-8" ?>
<data>
<!---14 images is really all you want to add as the text below will begin to run together if more are added-------->
<!---12 is optimal, just know that anything less will cause more spacing between image planes---------------------->

	<image>
	<pic><![CDATA[images/img1.jpg]]></pic>
	<copy>This is the sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img2.jpg]]></pic>
	<copy>This is more sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img3.jpg]]></pic>
	<copy>Another set of sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img1.jpg]]></pic>
	<copy>Look at this sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img2.jpg]]></pic>
	<copy>This is the sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img3.jpg]]></pic>
	<copy>Another set of sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img1.jpg]]></pic>
	<copy>Look at this sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img2.jpg]]></pic>
	<copy>This is the sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img3.jpg]]></pic>
	<copy>Another set of sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img1.jpg]]></pic>
	<copy>Look at this sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img2.jpg]]></pic>
	<copy>Look at this sample text</copy>
	</image>
	<image>
	<pic><![CDATA[images/img2.jpg]]></pic>
	<copy>This is the sample text</copy>
	</image>
	
	

</data>

Open in new window

0
cubical38
Asked:
cubical38
  • 6
  • 6
  • 2
2 Solutions
 
cubical38Author Commented:
trace("xmlList[i].copy = " + xmlList[i].copy);
returns the first xmlList node copy:
This is the sample text

I need this to be placed in:
textField.text="This is only some sample text This is only some sample text";

...and be in line with the image that is in the same xmlList

...so the first xmlList:
 <image>
        <pic><![CDATA[images/img1.jpg]]></pic>
        <copy>This is the sample text</copy>
 </image>
...matches img1.jpg with This is the sample text

Any help is huge right now, so Thanks!

 

0
 
vindys80Commented:
Hi cubical,

Is your trace trace("xmlList[i].copy = " + xmlList[i].copy); giving proper text and image text for each node in XMLList now? I mean is your xmlList properly populated? If so you can directly use the same xmlList when you create the textField right?

Thanks,
Vindys
0
 
cubical38Author Commented:
Thanks for the reply!

trace("xmlList[i].pic = " + xmlList[i].pic);
returns:
images/img1.jpg (which is the first pic)

trace("xmlList[i].copy = " + xmlList[i].copy);
returns:
This is the sample text (which is the first copy)

tracing xmlList will list out the entire xmlList

To answer your question, yes that is the idea to feed both pic and copy from the same increment of xmlList.  The trouble I am having is getting the "copy" text into:
                                var textMC:MovieClip=new MovieClip  ;
                                var textField:TextField=new TextField  ;
                                textField.wordWrap=true;
                                textField.width=400;
                                textField.height=280;
                                textField.multiline=true;
                                textField.text="This is only some sample text This is only some sample text";
                                textField.autoSize=TextFieldAutoSize.LEFT;
                                textField.antiAliasType=AntiAliasType.ADVANCED;

...as the image "pic" is placed in like so:
                                var mat:BitmapMaterial=new BitmapMaterial(bulkInstance.getBitmapData(images[i]));
                                trace("images[i] = " + images[i]);
                                mat.interactive=true;
                                mat.smooth=true;
                                var plane:Plane=new Plane(mat,360,280);
                                carousel.addChild(plane);
                                plane.rotationY=360/numItems*i;
                                plane.moveForward(900);
                                planes.push(plane);

Hopefully you can see what I am trying to do and can look at this with some fresh eyes and spot the problem.
Thanks again!

Any thoughts?

 
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
vindys80Commented:
Hi

I got your trouble now. copy is a built in function of XmlList. Thats the trouble you facing right?

xmlList[i].elements("copy").toString() should give you the string.

Thanks,
Vindys
0
 
cubical38Author Commented:
Thanks for the info!

actually "copy" is just a node in the XML file like so:

<?xml version="1.0" encoding="utf-8" ?>
<data>
     <image>
        <pic><![CDATA[images/img1.jpg]]></pic>
        <copy>This is the sample text</copy>
     </image>
     <image>
        <pic><![CDATA[images/img2.jpg]]></pic>
        <copy>This is more sample text</copy>
     </image>
</data>
 
and var textPath:String=String(xmlList[i].copy); is the path to the XML file

Maybe I am not following you correctly but I need to get the text from inside the XML node:  <copy>This is the sample text</copy> into the dynamic textField:  var textField:TextField=new TextField;

If the above code will do that, where do I need to place it within my class posted above and will it increment?  I am not seeing a connection with the textField.

Thanks again!

0
 
vindys80Commented:
I think you might be able to access your xml from createChildren. So i think this might work.

Copy the createChildren function

Another alternative will be to save the copy of each copy to an array when you push images array itself.
protected function createChildren():void {
                	var xml:XML=bulkInstance.getXML(xmlPath);
                        var xmlList:XMLList=xml.image;
                        for (var i:int=0; i<numItems; i++) {
                                var mat:BitmapMaterial=new BitmapMaterial(bulkInstance.getBitmapData(images[i]));
                                trace("images[i] = " + images[i]);
                                mat.interactive=true;
                                mat.smooth=true;
                                var plane:Plane=new Plane(mat,360,280);
                                carousel.addChild(plane);
                                plane.rotationY=360/numItems*i;
                                plane.moveForward(900);
                                planes.push(plane);

                                //reflection should be implimented here///////////////////////////
                                view=new ReflectionView(940,300,true,true);
                                addChild(view);
                                view.singleRender();


                                var textMC:MovieClip=new MovieClip  ;
                                var textField:TextField=new TextField  ;
                                textField.wordWrap=true;
                                textField.width=400;
                                textField.height=280;
                                textField.multiline=true;
                                //textField.text="This is only some sample text This is only some sample text";
                                textField.text = xmlList[i].elements("copy").toString();
                                textField.autoSize=TextFieldAutoSize.LEFT;
                                textField.antiAliasType=AntiAliasType.ADVANCED;



                                var textFormat:TextFormat=new TextFormat("Arial");
                                textFormat.size=30;
                                textFormat.color=0xffffff;
                                textFormat.bold=false;
                                textFormat.align="center";
                                textMC.defaultTextFormat=textFormat;
                                textField.setTextFormat(textFormat);
                                //Create a rect the size of the MovieClip with an opacity of 0
                                //This lets the TextField render properly
                                textMC.graphics.beginFill(0x00ff00,0);
                                textMC.graphics.drawRect(0,190,360,80);
                                textMC.graphics.endFill();
                                textMC.addChild(textField);

                                var tfMaterial:MovieMaterial=new MovieMaterial(textMC,true,false,true);
                                tfMaterial.interactive=true;
                                tfMaterial.smooth=true;
                                tfMaterial.tiled=true;
                                var tmpPlane:Plane=new Plane(tfMaterial,400,380);
                                tmpPlane.y=-360;
                                plane.addChild(tmpPlane);


                                plane.id=i;
                                plane.addEventListener(InteractiveScene3DEvent.OBJECT_OVER,onPlaneOver);
                                plane.addEventListener(InteractiveScene3DEvent.OBJECT_OUT,onPlaneOut);
                                plane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS,onPlaneClick);
                                scene.addChild(carousel);
                                startRendering();
                        }
                        camera.zoom=80;
                }

Open in new window

0
 
vindys80Commented:
This is the version with an array named copyTexts to save the texts.
package {
        import flash.events.Event;
        import br.com.stimuli.loading.BulkLoader;
        import br.com.stimuli.loading.BulkProgressEvent;
        import flash.display.Sprite;
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import flash.filters.GlowFilter;
        import flash.display.MovieClip;
        import flash.text.TextField;
        import flash.text.TextFormat;
        import flash.text.TextFieldAutoSize;
        import flash.text.TextFormatAlign;
        import flash.text.AntiAliasType;
        import flash.display.DisplayObject;

        import gs.easing.Quint;
        import gs.TweenLite;
        import org.papervision3d.events.InteractiveScene3DEvent;
        import org.papervision3d.materials.BitmapMaterial;
        import org.papervision3d.objects.DisplayObject3D;
        import org.papervision3d.objects.primitives.Plane;
        import org.papervision3d.view.BasicView;
        import org.papervision3d.view.Viewport3D;
        import org.papervision3d.core.effects.view.ReflectionView;
        import org.papervision3d.materials.MovieMaterial;

        public class Main extends BasicView {
                protected var planes:Array=[];
                protected var images:Array=[];
                protected var copyTexts:Array=[];
                protected var numItems:Number;
                protected var currentItem:Number=3;
                protected var angle:Number=25;
                protected var rightBtn:Sprite;
                protected var leftBtn:Sprite;
                protected var xmlPath:String="xml/imageXML.xml";
                protected var bulkInstance:BulkLoader;
                private var carousel:DisplayObject3D=new DisplayObject3D  ;
                private var bitmapViewport:Viewport3D=new Viewport3D(940,300);

                
                private var view:ReflectionView;

                public function Main():void {
                        super(940,300,true,true);

                        addChild(bitmapViewport);
                        bitmapViewport.interactive=true;
                        loadXML();
                }

                //First load our XML
                protected function loadXML():void {
                        bulkInstance=new BulkLoader("bulkInstance");
                        bulkInstance.add(xmlPath);
                        bulkInstance.addEventListener(BulkProgressEvent.COMPLETE,onXMLReady);
                        bulkInstance.start();
                }

                //When our xml is ready parse and load our images
                protected function onXMLReady(evt:BulkProgressEvent):void {
                        bulkInstance.removeEventListener(BulkProgressEvent.COMPLETE,onXMLReady);
                        bulkInstance.addEventListener(BulkProgressEvent.COMPLETE,onImagesReady);

                        var xml:XML=bulkInstance.getXML(xmlPath);
                        var xmlList:XMLList=xml.image;

                        for (var i:int=0; i<xmlList.length(); i++) {
                                var imagePath:String=String(xmlList[i].pic);
                                var textPath:String=String(xmlList[i].copy);
                                bulkInstance.add(imagePath);
                                images.push(imagePath);
                                copyTexts.push(textPath);
                                //images.push(textPath);
                                //trace("xmlList[i].pic = " + xmlList[i].pic);
                                //trace("xmlList[i].copy = " + xmlList[i].copy);
                        }
                        numItems=images.length;
                }
                protected function onImagesReady(evt:BulkProgressEvent):void {
                        init();
                }
                protected function init():void {
                        createChildren();
                        startRendering();
                }
                protected function createChildren():void {
                	var xml:XML=bulkInstance.getXML(xmlPath);
                        var xmlList:XMLList=xml.image;
                        for (var i:int=0; i<numItems; i++) {
                                var mat:BitmapMaterial=new BitmapMaterial(bulkInstance.getBitmapData(images[i]));
                                trace("images[i] = " + images[i]);
                                mat.interactive=true;
                                mat.smooth=true;
                                var plane:Plane=new Plane(mat,360,280);
                                carousel.addChild(plane);
                                plane.rotationY=360/numItems*i;
                                plane.moveForward(900);
                                planes.push(plane);

                                //reflection should be implimented here///////////////////////////
                                view=new ReflectionView(940,300,true,true);
                                addChild(view);
                                view.singleRender();


                                var textMC:MovieClip=new MovieClip  ;
                                var textField:TextField=new TextField  ;
                                textField.wordWrap=true;
                                textField.width=400;
                                textField.height=280;
                                textField.multiline=true;
                                //textField.text="This is only some sample text This is only some sample text";
                                textField.text = copyTexts[i];
                                textField.autoSize=TextFieldAutoSize.LEFT;
                                textField.antiAliasType=AntiAliasType.ADVANCED;



                                var textFormat:TextFormat=new TextFormat("Arial");
                                textFormat.size=30;
                                textFormat.color=0xffffff;
                                textFormat.bold=false;
                                textFormat.align="center";
                                textMC.defaultTextFormat=textFormat;
                                textField.setTextFormat(textFormat);
                                //Create a rect the size of the MovieClip with an opacity of 0
                                //This lets the TextField render properly
                                textMC.graphics.beginFill(0x00ff00,0);
                                textMC.graphics.drawRect(0,190,360,80);
                                textMC.graphics.endFill();
                                textMC.addChild(textField);

                                var tfMaterial:MovieMaterial=new MovieMaterial(textMC,true,false,true);
                                tfMaterial.interactive=true;
                                tfMaterial.smooth=true;
                                tfMaterial.tiled=true;
                                var tmpPlane:Plane=new Plane(tfMaterial,400,380);
                                tmpPlane.y=-360;
                                plane.addChild(tmpPlane);


                                plane.id=i;
                                plane.addEventListener(InteractiveScene3DEvent.OBJECT_OVER,onPlaneOver);
                                plane.addEventListener(InteractiveScene3DEvent.OBJECT_OUT,onPlaneOut);
                                plane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS,onPlaneClick);
                                scene.addChild(carousel);
                                startRendering();
                        }
                        camera.zoom=80;
                }


                protected function onPlaneOver(evt:InteractiveScene3DEvent):void {
                        var plane:Plane=evt.target as Plane;
                        plane.moveForward(-200);
                        trace("over");
                }
                protected function onPlaneOut(evt:InteractiveScene3DEvent):void {
                        var plane:Plane=evt.target as Plane;
                        plane.moveForward(200);
                        trace("onPlaneOut");
                }
                protected function onPlaneClick(evt:InteractiveScene3DEvent):void {
                        var plane:Plane=evt.target as Plane;
                        //plane.moveForward(-200);
                        trace("onPlaneClick");
                }
                public function MouseOverStage() {
                        stage.addEventListener( Event.MOUSE_LEAVE, mouseOutHandler );
                }

                private function mouseOutHandler( event:Event ):void {
                        trace( "mouse has left the stage" );
                }


                override protected function onRenderTick(event:Event=null):void {
                        carousel.rotationY-=viewport.containerSprite.mouseX/100;
                        renderer.renderScene(scene,camera,bitmapViewport);

                }
        }
}


<?xml version="1.0" encoding="utf-8" ?>
<data>
<!---14 images is really all you want to add as the text below will begin to run together if more are added-------->
<!---12 is optimal, just know that anything less will cause more spacing between image planes---------------------->

        <image>
        <pic><![CDATA[images/img1.jpg]]></pic>
        <copy>This is the sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img2.jpg]]></pic>
        <copy>This is more sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img3.jpg]]></pic>
        <copy>Another set of sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img1.jpg]]></pic>
        <copy>Look at this sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img2.jpg]]></pic>
        <copy>This is the sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img3.jpg]]></pic>
        <copy>Another set of sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img1.jpg]]></pic>
        <copy>Look at this sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img2.jpg]]></pic>
        <copy>This is the sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img3.jpg]]></pic>
        <copy>Another set of sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img1.jpg]]></pic>
        <copy>Look at this sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img2.jpg]]></pic>
        <copy>Look at this sample text</copy>
        </image>
        <image>
        <pic><![CDATA[images/img2.jpg]]></pic>
        <copy>This is the sample text</copy>
        </image>
        
        

</data>

Open in new window

0
 
cubical38Author Commented:
I was thinking something like:
textField.text=xmlList[i].copy;  would work, but Im not sure if this would increment correctly, and since the textfield is in another function it doesnt recognize xmlList...

Thanks!
0
 
vindys80Commented:
Ya cubical,

You have to make a global variable which has all the string variables. Thats what I m doing in second code snippet. So its having an array which has all the text values.

Alternative is to read that xmlList again

so locally for that function I will be reading that xml and creating xmlList

var xml:XML=bulkInstance.getXML(xmlPath);
var xmlList:XMLList=xml.image;


0
 
cubical38Author Commented:
I didnt see your above post.  I will implement both in the morning.  I see the logic to both examples and think this will work.
Thanks for all the help!

As soon as I can get one of these working I will award some well earned points.
0
 
vindys80Commented:

No issues. I thought you not clear what I said. Thats why I was trying to explain.

Hope it help and you fix the problem soon.

Thanks,
Vindys
0
 
TanLiHaoCommented:
First look for this code,

var xml:XML=bulkInstance.getXML(xmlPath);
var xmlList:XMLList=xml.image;
for (var i:int=0; i<xmlList.length(); i++) {


Cut the first two lines of code and paste it

below

private var bitmapViewport:Viewport3D=new Viewport3D(940,300);


Then give them both a private access modifier and remove the instantiation(i.e. only define and not instantiate)

Thus the code will be as follows:

private var bitmapViewport:Viewport3D=new Viewport3D(940,300);
private var xml:XML;
private var xmlList:XMLList;

Then now instantiate the xml and xmlList back where they are originally instantiated, therefore the code will be like this

xml=bulkInstance.getXML(xmlPath);
xmlList =xml.image;
for (var i:int=0; i<xmlList.length(); i++) {

Now look for this chunk of code below

var textMC:MovieClip=new MovieClip  ;
var textField:TextField=new TextField  ;
textField.wordWrap=true;
textField.width=400;
textField.height=280;
textField.multiline=true;
textField.text="This is only some sample text This is only some sample text";
textField.autoSize=TextFieldAutoSize.LEFT;
textField.antiAliasType=AntiAliasType.ADVANCED;

Replace

textField.text="This is only some sample text This is only some sample text";

with

textField.text = xmlList[i].copy;

You should be able to get what you want now.

0
 
TanLiHaoCommented:
Sorry I didn't see what vindys posted but I was thinking the problem is with that the variables you define are local variable and so accessing local variables out of the scope returns undefined, thus your textfields couldn't get the correct text to be displayed.

Therefore I believe my code should get what you want working.
0
 
cubical38Author Commented:
Thanks to both of you for the beautiful work here.  If I could offer you both 500 pts I would.

Thanks Again!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 6
  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now