Steven,
It does make sense for the most part, except that I'm not sure if I'm
placing it in the right place. I have it in my HomePage.as file (just
using this page as an example, as I assumed that was what you might have
meant when you said "parsing code"), and I guess I need to define "a" or
put it in the right place? Because right now, it gives me an error
#1120: Access of undefined property a. This is how I put it in my code
(minus some of the extra stuff):

        public class HomePage extends AbstractPage
        {       
                public var dynamic_text:TextField;

                public function HomePage()
                {
                        super();
                        alpha = 0;
                }

                override public function transitionIn():void 
                {
                        super.transitionIn();
                        TweenLite.to(this, 0.3, {alpha:1,
onComplete:transitionInComplete});
                        
                        var href:String = a...@href;
                        href = href.substr(0, href.length - 4);
                        var internalTitle:String = href.toUpperCase();
                        Gaia.api.goto(Pages[internalTitle]);
                        
                        dynamic_text.htmlText = this.copy.intro;
                }
        }

Sorry to paste it directly into my code like that; it's just that I can
only guess where it might go...

Thanks,
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: Thursday, May 21, 2009 2:57 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Parsing HTML tags within flash from an XHTML
file?

Do you mean you want to have links in your <a> tags that call  
Gaia.api.goto()?

You can do that, but obviously, those links wouldn't work in the XHTML.

After thinking about it a bit, I think what might work is this

<a href="contact.html">Go to contact page</a>

With that being the link to the SEO XHTML page that is generated for  
that page.

In your parsing code, you would change the href to call an  
actionscript method that would take page.html and convert it to

var href:String = a...@href;
href = href.substr(0, href.length - 4);
var internalTitle:String = href.toUpperCase();
Gaia.api.goto(Pages[internalTitle]);

That is just an example, but basically you're converting  
"contact.html" to CONTACT and, there should be a public static const  
in Pages called CONTACT which has the branch for that title.

Does this make sense? (this part of the question is definitely  
appropriate for the Gaia forum, too)



On May 21, 2009, at 12:29 PM, Jonathan Wing wrote:

> Thanks Steven! That clears a few things up, and like you suggest, I  
> will
> experiment with it until I get it just right. The only reason I've  
> been
> so anxious is that I'm working on a deadline; so, for the time being,
> may I simply ask you this? What is the best (and most SEO-friendly)  
> way
> of presenting links within the copy content? Should I be doing this
> within the XHTML using <a> tags to other swf files, or is there a  
> better
> method? I guess that is the only thing I'm getting hung up on, as my
> pages will occasionally have links within the body paragraphs.
>
> Okay, so I figured out one thing that helps, which is to set my text
> fields to "htmlText" (it was only "text" before). That helps a lot,  
> and
> it appears that the links are showing up and they function--sorta.  
> They
> actually want to open a new page, even if a swf, and even if the  
> target
> is set to "_self".
>
> Really, all I want to do (on my deadline) is have links from one swf  
> to
> another in the website, but have it all be SEO-friendly. Should be
> pretty simple, right? I bet I'm making it more complicated for myself
> than it probably needs to be. ;)
>
> My I present my own guess, and you could tell me if I'm wrong? I'm
> guessing it has something to do with the following, which I found in  
> the
> Gaia demo site (I'm pasting only what I assume is the relevant code):
>
> public var textContent:TextField;
>
> var myStyleSheet = new StyleSheet as StyleSheet;
> var myURL:String;
> var mySection:XMLList;
>
> myURL = Gaia.api.getCurrentBranch();                  
> myStyleSheet =
> IStyleSheet(Gaia.api.getPage("index").assets.xmlCss).style;
> textContent.styleSheet = myStyleSheet
>
> for each ( var u:XML in mySection) {
>                               if (myURL == u...@url) {
>                                       textContent.htmlText = u.copy;
>                               }
>
> Could I use this in tandem with my Gaia-produced XHTML pages? I do not
> see where the actual <copy> node is included in the instance from the
> demo site's XML, but only the url part. How is the rest of the text
> being included?
>
> Sorry to be impatient! I just did not expect this specific aspect of
> development to feel like starting from scratch!
>
>
> Thanks,
> 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: Thursday, May 21, 2009 1:43 PM
> To: Flash Coders List
> Subject: Re: [Flashcoders] Parsing HTML tags within flash from an  
> XHTML
> file?
>
>
http://www.gaiaflashframework.com/index.php/topic,1847.msg7817.html#msg7
> 817
>
> Just so everyone is familiar with the context here, the above is the
> thread on the forum about this.
>
> The question is about how to use E4X to parse XHTML.  I provide a code
> example of how easy it is to do this, but Jonathan's question is more
> of a general one about how to use E4X to parse nodes.
>
> Flash doesn't support <div> in its htmlText, so that's why you use E4X
> to grab the node content like
>
> var value:XML = XMLList(copy.innerHTML)[0];
> var body:XML = value.div.(@id == "body")[0];
>
> I believe the challenge for Jonathan is what the above lines of code
> mean and how they work.
>
> value is the XHTML.
>
> value.div returns an XMLList of all div nodes on the first level
> within the XHTML.
>
> value.div.(@id == "body") means give me an XMLList of the div nodes
> that have an attribute id="body".
>
> valid.div.(@id == "body")[0] means give me the first XML node in that
> XMLList.
>
> This is how E4X works.  A lesson on E4X is out of scope of my forum.
> However, there are lots of resources out there for E4X in AS3.  I
> highly recommend Colin Moock's Essential Actionscript 3.0 book, which
> is how I learned it.  That and the internet.
>
> And Jason, you do not need to complicate things with RegEx.  E4X does
> enough.  XHTML is technically XML and can be parsed the same using  
> E4X.
>
> Also, while Flash doesn't SEEM to support newer HTML tags like
> <strong> and <em> for <b> and <i>, it actually DOES if you write css
> to do it.
>
> strong {
>       font-family: FFScala-Bold;
>       display: inline;
> }
> em {
>       font-family: FFScala-Italic;
>       display: inline;
> }
>
> In this case, I am using a bold and italic font to show them, and by
> defining the node types in css (and setting them to display: inline),
> it works like a champ!
>
> Here's a detailed code sample:
>
http://www.gaiaflashframework.com/wiki/index.php?title=Runtime_Font_Load
> ing#StyleSheet_Example
>
> Now, I can keep my valid XHTML and use it directly in Flash.  It's
> really straightforward.  The challenge is learning how to parse the
> nodes using E4X, which, once you get your head around it (and it took
> me a lot of experimenting to learn how awesome and powerful E4X is and
> how to leverage it), you can do stuff like this easily.
> _______________________________________________
> 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

_______________________________________________
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

Reply via email to