no javascript, just do a new XML object in flash, and load the page.

so you really just need to pass the page url into flash:

so.addVariable("currentPage", document.location.href);

then use that to do an xml.load()



On Nov 9, 2006, at 3:03 PM, Mike Keesey wrote:

That sounds *much* nicer--how do you grab the whole XHTML page in
Javascript?
―
Mike Keesey

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:flashcoders-
[EMAIL PROTECTED] On Behalf Of Ryan Potter
Sent: Thursday, November 09, 2006 11:39 AM
To: Flashcoders mailing list
Subject: RE: [Flashcoders] Grabbing data directly from the HTML page

Not sure how complicated your html page is, but I have been playing
with
the same idea but going at it a different way.  I just loaded the
entire
page in as xml. As long as the page is valid xhtml it works great. I
realize it doesn't exactly answer your sgml question, but it should
get
you
the same effect and it doesn't rewrite your code. Then you can either
go
directly to the node or use xpath to navigate to it.

Just a thought.


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike
Keesey
Sent: Thursday, November 09, 2006 12:24 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] Grabbing data directly from the HTML page

I was playing around with the idea of passing data from an HTML page
directly into a Flash movie via Javascript/SWFObject. One thing I
wanted
to try was sending the text that SWFObject replaces into the Flash
movie.

In Firefox this was pretty simple. E.g., if SWFObject was replacing
the
contents of <div id="flash-content">...</div>, then all that was
needed
was something in the Javascript code like:

var swfObj = new SWFObject(parameters);
swfObj.addVariable("HTML_flashContent", escape('<div
id="flash-content">' +
document.getElementById("flash-content").innerHTML.toString() +
"</div>"));

Then, in Flash, the root variable HTML_flashContent can be parsed into
an XML object. This has obvious benefits for search engine
optimization,
as well as making it so a Flash and non-Flash version of a page can be
the exact same file.

Unfortunately, though, Internet Explorer and Safari return SGML, not
XHTML, for the innerHTML property (e.g., the above div tag gets
converted to <DIV id=flash-content>...</DIV> in IE). I made a
quick-and-dirty SGML to XHTML conversion tool to get around this, and
it
seems to work so far.

My question is, has anybody else made an SGML to XHTML conversion tool
in ActionScript, or should I continue to refine mine and offer it for
public use when done?
―
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Ave. Ste. B
Los Angeles, California 90039


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to