Here is a sample of the XHTML from inside the "copy" div: <div id="copy"> <div id="body"> <p>Deepak Thadhani is the founder and President of Cram Crew. He has extensive experience and a real passion for education-based businesses. Deepak completed his undergraduate degrees in Mathematics and Biology, with a minor in Chemistry at the University of Houston. He did follow-up work at Ben Taub Hospital and while there, completed the MCAT with the intentions of a career in medicine. He decided that medicine was not his real passion and returned to the University of Houston. He received his MBA in Marketing along with a certificate of entrepreneurship at the Center for Entrepreneurship in the Bauer School of Business. This broad educational background turned out to be the perfect combination for an education-based business.<br /><br />Deepak began more than 14 years ago under the name 'Academic Solutions Group.' He changed the name to Cram Crew in 2005 to better align the brand with his market.<br /><br />Prior to Cram Crew, Deepak marked success by creating other service-based businesses. He has always harbored a love for tutoring, having provided academic services in the midst of his own educational experience and business ventures.<br /><br />With his extensive educational experience, Deepak possesses a unique combination of educational exposure, teaching acumen, and a genuine interest in the achievement of every student. Together these three elements not only give an edge over the competition but also provide the solid foundation on which Cram Crew is built. By combining professionalism and vision with a focus on trusted relationships with customers and partners, he has achieved success in building and growing Cram Crew, Inc.</p> </div> </div>
Basically, all I want is this (which sounds simpler than it is, I suppose!): Two columns of text with basic HTML formatting (as discussed earlier, which I mostly figured out), from an SEO-friendly XHTML file. I wouldn't mind manually setting up separate <span> tags, but when I played with that method I was even more confused. I guess what really confused me was this portion that I borrowed from the code you showed as an example: var label:TextLabel = new TextLabel(); label.htmlText = xml.toString(); columns.addChild(label); } columns.y = 95; The first thing that confuses me with that method is that "TextLabel" doesn't seem to be supported. Is that your own function? That might be why. The second thing that confused me is what "columns" must refer to. Is that the instance name of the MC, or would the instance name have to be "label"? I was researching on google what the structure of x.addChild(x) means, and I get the second part, but the first part, where "columns" goes, is throwing me through a loop. In any case, you don't have to waste your time teaching me AS if this is more complicated than necessary; again, all I want is two columns fed from the XHTML file with some basic HTML properties. Whatever method you think would be easiest/best, I'm all ears. Thanks! Best, Jonathan Wing Graphic Designer Cram Crew, Inc. mobile: (713) 298-2738 office: (713) 464-CRAM (2726) email: jw...@cramcrew.com www.cramcrew.com "One Student At A Time" -----Original Message----- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Steven Sacks Sent: Tuesday, May 26, 2009 6:17 PM To: Flash Coders List Subject: Re: [Flashcoders] How do I flow text from an XML/XHTML file into twocolumns? Could you show some sample of the XHTML you are reading in? Specifically, what does body.p trace out? On May 26, 2009, at 4:00 PM, Jonathan Wing wrote: > Using Gaia, I am trying to load content within flash from an XHTML > file, > and have the text flow from a <p> into two columns. This is what I > have > so far (AS3): > > > > In the .fla file, I have two columns set as dynamic text, with the > instance names column1 and column2, respectively. > > > > In the corresponding .as file, here is my code, including only the > relevant portions: > > > > package pages > { > import flash.display.*; > import flash.events.*; > import flash.text.*; > import flash.external.*; > import flash.xml.*; > > public class AboutPage extends AbstractPage > { > > public var column1:TextField; > public var column2:TextField; > > public function AboutPage() > { > super(); > alpha = 0; > } > override public function transitionIn():void > { > super.transitionIn(); > > var value:XML = XMLList(copy.innerHTML)[0]; > var body:XML = value.div.(@id == "body")[0]; > var i:int = 1; > > column1.htmlText = body.p; > addChild(column1); > if (body.length() > 13) { > column2.htmlText = column1.htmlText; > > for(i=0; i<column1.bottomScrollV; i++) { > column2.htmlText += "<br />"; > } > column2.scrollV = > column1.bottomScrollV + > 1; > addChild(column2); > } > > TweenLite.to(this, 0.1, {alpha:1, > onComplete:transitionInComplete}); > } > > > > So far, the text is indeed loading fine into column1, but then that's > it. The remainder of the content disappears, and does not load into > column2. I took some of Steven's suggestions and looked around Google, > but I still cannot get it to work. Does anyone else have any advice? > > > > > > Thanks, > > Jonathan Wing > Graphic Designer > Cram Crew, Inc. > mobile: (713) 298-2738 > office: (713) 464-CRAM (2726) > email: jw...@cramcrew.com <mailto:jw...@cramcrew.com> > www.cramcrew.com <http://www.cramcrew.com/> > > > "One Student At A Time" > > > > > > ------------------------------------------------------------ > The information transmitted is intended only for the person or > entity to which it is addressed and may contain proprietary, > business-confidential and/or privileged material. If you are not the > intended recipient of this message you are hereby notified that any > use, review, retransmission, dissemination, distribution, > reproduction or any action taken in reliance upon this message is > prohibited. If you received this in error, please contact the sender > and delete the material from any computer. Any views expressed in > this message are those of the individual sender and may not > necessarily reflect the views of the company. > ------------------------------------------------------------ > > _______________________________________________ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ------------------------------------------------------------ The information transmitted is intended only for the person or entity to which it is addressed and may contain proprietary, business-confidential and/or privileged material. If you are not the intended recipient of this message you are hereby notified that any use, review, retransmission, dissemination, distribution, reproduction or any action taken in reliance upon this message is prohibited. If you received this in error, please contact the sender and delete the material from any computer. Any views expressed in this message are those of the individual sender and may not necessarily reflect the views of the company. ------------------------------------------------------------ _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders