- Flash Detection
- Posted by Brian Mays on August 7th, 2006
This subject came up in another thread, I thought I'd post it here also
so casual browsers of ADG could find it.
A great solution for Flash detection is the SWFObject.
http://blog.deconcept.com/swfobject/
What I've enjoyed about it is the ease of putting in alternate content,
and the fact that it is forward thinking. If I tell it to detect Flash
7, it will detect Flash 7...and any future versions, no diddling required.
Enjoy!
Brian Mays
- Posted by Onideus Mad Hatter on August 7th, 2006
On Mon, 07 Aug 2006 13:51:19 GMT, Brian Mays <bmays@newsok.com> wrote:
Tell me, did it even OCCUR to you AT ALL to find out just how CROSS
COMPATIBLE that so called "solution" is before you started humping it
as the return of Jesus? I only bring it up cause teh VBscript method
I'm currently using (which interestingly enough isn't even MENTIONED
on that site)...yeah I ACTUALLY TESTED IT on Linux/OSX/WinXP and on
multiple browsers so that I would know with ABSOLUTE CERTAINTY that it
worked...that link of yours...it uh...doesn't seem to say ANYTHING
about cross compatibility or if it was even tested...AT ALL. o_O
Further, I downloaded their method and um...their external .js file
that's used for the detection...it's SIX AND A HALF TIMES THE SIZE of
my VBscript method...and just looking at their code...I HIGHLY doubt
that it's as cross compatible as my chit. Oh and my chit ALREADY
detects ANY version of Flash, thanks much. Oh wait, I'm not
done...with THEIR shit version of code you need to add in tons of
silly hoo-ha code into the HTML, all the fuck I need is an IF
statement and a document write...LOL...get the fuck outta here kid,
you don't know what yer talkin about.
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by Brian Mays on August 8th, 2006
Onideus Mad Hatter wrote:
Hi, Hatter. Thanks for the reply.
I hadn't heard about a VBscript detection scenario. Have you
considered marketing it? Size alone may be a reason to look into it.
Also, one of the pieces we liked about this is that it will work on
most any server, and if the javascript doesn't run (which isn't likely
these days) the alternate content is already there. Does the VBscript
require anything special server side to run?
We have also used it to send a number of parameters to the Flash
player, one of which is the method for transparency on the page. We've
coupled it with a javascript mask that allows us to place Flash content
on a page, but still allows you to click behind it in all browsers (not
an easy task we found out). It works well on clickthroughs for Flash
pieces, to be tracked through ad tracking systems. It also doesn't
lock us into placing a URL into the Flash file and then coming to
bother me when it needs to be changed...we place the URL into our
detection code and the editors and salespeople can change them to our
clients' content.
For the testing, I have seen a number of professional Flash coders over
the years switch to this. Adobe uses it as well with the Flash
galleries in Photoshop. So I figure it's stood the tests of time and
coders.
Thanks,
Brian Mays
- Posted by Onideus Mad Hatter on August 8th, 2006
On 8 Aug 2006 04:57:00 -0700, "Brian Mays" <brianleonmays@gmail.com>
wrote:
....um, I'm a horrible, malevolent, nasty, malicious bastard of GOD
LEVEL proportions...marketing things isn't really an option for me.
Being right isn't the same as being liked, with the later you can sell
anything, with the former...not so much. I suppose I could sell out
and start pretending to be someone I'm not...but somehow that idea
just doesn't sit too well with me.
Nope, nothin special at all.
On some of my Flash stuff I use a mouse listener to constantly monitor
the location of the mouse as a global variable, that way any number of
other functions can make use of it. I'm not so much into combining
Flash with too much HTML/CSS/Javascript content though, to me that's
kind of backwards. I suppose if you were dealing with a lot of
different content from different vendors/sub contractors/whatever it
might be good/necessary...however I'd just assume have them send me
their stuff and I can recreate it in Flash.
....why can't they simply be educated on how to alter the Flash file as
needed and then recompile it themselves rather than going to you to do
it for them?
To me it just seems easier to do it all in Flash and then for dynamic
content work off integrated PHP and SQL databases. Have a kind of
"developers site" that will allow your editors and salespeople to
change URLs or whatever, which will then make changes to that sites
SQL database. You could develop site templates that way too which
would take the whole coding aspect of it out completely for the
editors and salespeople (which may be for the best). Like with my
blog, I have a simple PHP page that lets me put new entries into the
database so I never have to make any direct changes to the Flash file
at all. It also makes backing up of essential content easier since
it's all in a database.
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by aigaokpresident@gmail.com on August 9th, 2006
Onideus Mad Hatter wrote:
Sometimes that's what we end up with. Got a Flash ad today that a
client built...at the last minute...had to go up. They wanted to send
us the url and just have it link, which of course we couldn't do. Gave
them two choices...have the url embedded or we'd feed in the parameter
that our script reads. I should add, most of the time that parameter
is used strictly for tracking purposes. It ended up going up without
us editing anything. Whether it clicks through I don't know :-)
We actually floated that idea...but two reasons came out.
1. The people managing these are usually editors and writers...so they
were intimidated in some cases, in others it's scary to put those tools
in their hands.
2. Budget
That's what I'd like to do...I think this is the first step toward
that. We're actually trying to build our Flash pieces in ways that
will allow them to do a good deal of customization through admin pieces
like you mentioned. We've made a bit of headway...just have more to
go, and will probably forever.
Brian Mays
- Posted by SpaceGirl on August 9th, 2006
Onideus Mad Hatter wrote:
Um... why would you do that? The mouse location is global already, and
can be accessed any time from anywhere ._xmouse ._ymouse in
ActionScript... *frown* Seems a tad pointless.
We generally have scripts on the server (JSP, ASP, whatever) that when
prodded from inside Flash spit out pure XML which Flash reads (into an
XML object and/or an array... easy to manage, have events on etc).
Flash is very good at parsing this output.
eg,
MySQL (database of phone numbers) > ASP (phoneNumbers.asp) > which when
run generates an XML document > Flash (which loads phoneNumber.asp into
the AS XML object, because all that Flash ever sees is the XML
generated by phoneNumbers.asp) > AS array (so we can now do things with
the data) > AS events (whatever needs to be done)
- Posted by Davémon on August 9th, 2006
\\ Onideus Mad Hatter :
Yes, yes. Or you could have just posted a link to the authors site:
http://www.quirksmode.org/js/flash.html
BTW I moved from Quirksmode to SWFObject (FlashObject as was) because
IMHO the alternative content delivery is cleaner (no nasty noscript
tags) and it all lives away in its own file so I can forget about it.
--
Davémon
http://www.nightsoil.co.uk/
- Posted by Onideus Mad Hatter on August 10th, 2006
On Wed, 9 Aug 2006 18:04:39 +0100, Davémon <"davémon"@nospam.com>
wrote:
The "authors" site? Pffft...at least they fucked my code all up...not
to mention the code they've got up only detects up to version 6, mine
goes up to a theoretical version 15.
How is an extra FOUR KILOBYTES worth of bloat code "cleaner"? Oh and
coincidentally, you could put my code in it's own .js file if you
really wanted to, wouldn't require much skill, Kiddo.
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by Onideus Mad Hatter on August 10th, 2006
On 9 Aug 2006 05:45:20 -0700, "SpaceGirl"
<nothespacegirlspam@subhuman.net> wrote:
....because it would run slower. If you've got like 7 or 8 different
functions all continuously checking ._xmouse and ._ymouse coordinates
at all times it's gonna choke a bit, where as if you just have ONE
function checking the coordinates and assigning them to a global
variable it runs smoother...at least that's been my experience. I've
found a lot of weird/strange quirks as far as speed issues with Flash.
Is that faster than simply using post variables? Seems like it'd be a
lot slower since it'd need to generate an XML document...and then what
do you do with the document? Trash it after use? Wouldn't that
equate to more wear and tear on yer servers HDs?
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by SpaceGirl on August 10th, 2006
Onideus Mad Hatter wrote:
Interesting - I've not profiled anything in Flash 8 (9) yet - it'd be
interesting to see if it makes any serious impact WHERE the processing
is done.
I do have a container function running off of the mouse event, mainly
for ease of reading rather than processing considerations.
It's like generating any scripted page. The resulting page is not
stored on disk, it is sent to the requesting client. If I write a
complex ASP page, the scripts are run by the server and only the
resulting HTML is sent via HTTP to the client browser. It's never
written to disk (apart from the the client cache!). Same goes for ASP
generated XML. It only exists in memory long enough for the client
(Flash) to read it. Flash then maintains the XML as an array. This is
vastly more efficient as complex structured data can be sent to and
from Flash with a single HTTP request; unlike POST/GET which cannot
easily represent anything other than linear data.
There is a processing hit for XML (we're talking ms here); but that's
negligable and effects the server rather than your Flash movie.
I think you you are only handling very simple paired data
(username=miranda) then XML maybe an over kill. But if I wanted to get
say, 20 items I would use XML as each variable is easy to find inside
the XML model rather than having to do classic script kiddie "if (this
..thing==something) { }" over and over.
- Posted by SpaceGirl on August 10th, 2006
Onideus Mad Hatter wrote:
Do you have an example of your code? We currently do pretty raw
detection, if there's a better way I'm interested.
- Posted by Onideus Mad Hatter on August 10th, 2006
On 10 Aug 2006 01:39:31 -0700, "SpaceGirl"
<nothespacegirlspam@subhuman.net> wrote:
Simple St00f:
: <script language="Javascript">
: var flashinstalled = 0;
: var flashversion = 0;
: MSDetect = "false";
: if (navigator.plugins && navigator.plugins.length)
: {
: x = navigator.plugins["Shockwave Flash"];
: if (x)
: {
: flashinstalled = 2;
: if (x.description) { y = x.description; flashversion = y.charAt(y.indexOf('.')-1); }
: }
: else { flashinstalled = 1; }
: if (navigator.plugins["Shockwave Flash 2.0"])
: {
: flashinstalled = 2;
: flashversion = 2;
: }
: }
: else if (navigator.mimeTypes && navigator.mimeTypes.length)
: {
: x = navigator.mimeTypes['application/x-shockwave-flash'];
: if (x && x.enabledPlugin) { flashinstalled = 2; }
: else { flashinstalled = 1; }
: }
: else { MSDetect = "true"; }
: </script>
And then:
: <script language="VBScript">
: on error resume next
: If MSDetect = "true" Then
: For i = 2 to 15
: If Not(IsObject(CreateObject("ShockwaveFlash.Shockwav eFlash." & i))) Then
: Else flashinstalled = 2
: flashversion = i
: End If
: Next
: End If
: If flashinstalled = 0 Then
: flashinstalled = 1
: End If
: </script>
Assigns the version number to the variable "flashversion" which can
then be used with a document write, like nyah:
:if (flashversion >= 8) { document.write(""); }
There's a couple other methods though that I think are even tidier
than that, one works off just javascript...not sure if they're ass
cross compatible or not though. The only downside (if you want to
call it that) is that this method relies on scripting so if they have
Javascript disabled then they're screwed from the start, even though
they might have the right version of Flash installed...but like on my
sites I have a noscript tag which says that both javascript and Flash
are needed, so I don't consider it to be any kind of problem. People
shouldn't have javascript disabled and if they're too lazy to enable
it to view my sites, well I couldn't really give a flying fuck. They
can enjoy the wonderful plain text fallbacks that I SOMETIMES bother
to include. ^_^
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by Onideus Mad Hatter on August 10th, 2006
On 10 Aug 2006 01:36:08 -0700, "SpaceGirl"
<nothespacegirlspam@subhuman.net> wrote:
Hrmmm...
Uh...the data is SENT linear...
....why would you need to do that?
Just use scripting to assemble the data string for transport, but
there's no need to parse it like you're suggesting on the other end.
Like in my blog, when you click on a day it sends a variable and then
gets the following:
:<?php
:
: SQL connect blah blah blah
:
: $d_check = $HTTP_POST_VARS['date'];
:
: Use date to find the entry in database, retrieve the following
:
: echo "&title=".$entry_show;
:
: echo "&entry=".$entry_show;
:
: echo "&image=".$entry_show;
:
: echo "&video=".$entry_show;
:
: Blah, blah, blah, whole bunch of calculation and math to get the number of lines
:
: echo "&lines=".$toal_lines;
:
:?>
Now, when it sends that stuff back to the Flash file it might look
something like:
&title=Farfoos&entry=blahblalblsdllsdlslaslsalsalk lalkaslk&image=&video=&lines=1
But ya see, you never have to deal with that string, teh Flash code
automagically keeps the variables "title", "entry", "image", "video"
and "lines"...so then you can directly use them as such, no havin to
break apart some big 'ol stream.
And of course it can handle some complex data, I mean holy bejesus
have you SEEN how much text is in some of my blog entires? There's
one in there where I think it's like close to a thousand lines.
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by SpaceGirl on August 10th, 2006
Onideus Mad Hatter wrote:
Okay: the project I'm working on right now is a virtual tour of some
offices. I took photos of every working area, and every empty chair.
Each has a little box hovering over the chair with a photo of the
person who sits there and via a mouse rollover details about their
role. There are 25 people in this office. Can you imagine what the
POST/GET would look like for that!?
Rather than
?firstname1=fred&surname1=blogs&job1=designer&firs tname2=jon&surname2=red&job1=programmer...
for all 20 folks; this works better:
<?xml version="1.0 encoding="UTF-9"?>
<staff>
<item firstname="fred" surname="blogs" title="Designer"
image="something.jpg">
<desc><![CDATA[This is a text description... unilited length, can
contain HTML or images]]></desc>
<data><![CDATA[more data on this user]]></data>
<address><![CDATA[Users address perhaps]]></address>
</item>
<item firstname="another" surname="user" title="Designer"
image="something.jpg">
<desc><![CDATA[This is a text description... unilited length, can
contain HTML or images]]></desc>
<data><![CDATA[more data on this user]]></data>
<address><![CDATA[Users address perhaps]]></address>
</item>
<item firstname="another" surname="user" title="Designer"
image="something.jpg">
<desc><![CDATA[This is a text description... unilited length, can
contain HTML or images]]></desc>
<data><![CDATA[more data on this user]]></data>
<address><![CDATA[Users address perhaps]]></address>
</item>
....
As you can see, with this I can describe complex relational data, in
any which way I want without size limitations or relying on buggy
POST/GET. Some browsers have limits to how much data can be sent over
POST/GET or query strings. I could send gigabytes of data via XML and
never worry (well, Flash may explode!)
Because this is all in an array, it becomes very easy to simply
something like this in a loop or function (psuedo code! not real AS);
this.myBox_mc.nameTextBox_txt = user[x].username
this.myBox_mc.addressTextBox_txt = user[x].address
So, now, if any data at all changes in the database I dont have to
worry. I dont ahve to care wether or not I'm going to hit a 16kb limit
on a query string, I dont care if "&" are escaped or any weird
characters have been accidentally added into the DB that would trip
Flash up. Because of the explicit structure of the XML document, it
works, all the time.
Yes but it's very simple data. No relationship. You cannot tell what
bit of data belongs to which thing. If you had say, 4 authors blogging
on your site, it becomes very hard to pass data over post. How do you
define which author is which? You end up creating more and more things
to pass over the string just so you can identify each query pair. XML
means all this vanishes. The whole thing becomes about 4 lines of code,
regardless how much data is being sent. And it doesn't care at all if
the structure changes.
Add into all of this the fact that XML is universal. ANYTHING could
parse my XML document... and RSS reader for example, or a cellphone...
or a web browser. I dont have to make any changes at all... or even
write any script! Can't do THAT with POST/GET 
- Posted by SpaceGirl on August 10th, 2006
Onideus Mad Hatter wrote:
<snip code>
Okay. We do it inside Flash & at the server instead. Interesting code
tho, thanks.
- Posted by Onideus Mad Hatter on August 10th, 2006
On 10 Aug 2006 03:14:46 -0700, "SpaceGirl"
<nothespacegirlspam@subhuman.net> wrote:
....what would it matter, it's not as if you ever ACTUALLY see it.
There's no sense to that.
Well yeah...but it's senseless...I mean you're adding in a 5th wheel,
going through all this trouble of constructing an XML document that's
just going to be immediately trashed.
Essentially it's as if you're building a brand new car to transport
your data from the server to the client and then as soon as it gets
there teh car asplodes!
....why?
I mean whatever variables you have setup to construct the XML, just
point them directly at the Flash file via post variables and skip yer
bloated middle man.
....there are no size limitations. With post the variables and their
values are sent in the BODY of the URL request and not in the header,
only the HEADER has a size limitation (something in the range of 8
thousand characters I believe).
....how is it buggy again?
Which browsers are these that have limits? What versions and on what
operating systems? I've never heard of ANY browser having such a
limitation...in fact they would have to go outside of spec and
specially code their browser to make it NOT work that way...I mean, it
doesn't REALLY have anything to do with the browser directly at all,
it's in teh hypertext transport protocol specs.
Well, actually you couldn't...at least not all at once, but anyway,
the bottom line is that post variables are just as good as XML so
there's no point in senselessly creating a bunch of extra work for
yourself and your server...which is all you've managed to accomplish.
*shrugs*
Huh?
I mean...
'?' => %3F
'=' => %3D
' ' => %20
'(' => %28
')' => %29
'&' => %26
'@' => %40
....in fact I think there's a function in PHP that'll automagically
escape such characters taken from yer database..."rawurlencode" I
believe...
Look...kiddo...there's something yer not grasping here.
The data in your database is all very simple in it's individual parts.
Now, what you're doing is you're having ASP take all those simple bits
of data out of yer database and then it's constructing an XML page
with the data in the way you need it...now, what I'm saying, is that
you can just skip all that.
Whatever yer ASP page is doing...have Flash do that (hell it'll do it
even faster than ASP can). Have PHP be the direct conduit to the
database so that the Flash can get whatever it needs to assemble
whatever "complex" data it needs to assemble.
It's sorta like you want to get from point A to point B...and you're
saying the fastest way there is a straight line...and I'm saying the
fastest way there is zero movement (like folding space).
....no it really wouldn't actually. How do you think it would be hard?
It'd be the EASIEST way...because it would be direct...BOOM BOOM, the
data is in, the data is out...with yer method you've got all this
middle man horse shit you've gotta bother with.
I'd add one single variable called "author"...really that's it, that's
all I'd need to do. o_O
No...if you had more than one author you would still need to have a
variable for them with XML...unless you wanted all submissions to just
show up as a collective conscious.
....your structure is meaningless...it's being created by ASP and then
it's immediately destroyed by yer Flash...unless the Flash is copying
the structure...but then why have ASP do the structuring of your data?
Why not simply have the data sent directly to the Flash and have IT do
the structuring? That way you don't need any XML at all and the final
result is exactly the same except that it's faster, more efficient and
requires less coding/effort on your part.
Um, if you NEEDED an XML document for an RSS reader or whatever you
could have Flash create it directly...
It seems to me you have a deficiency in Actionscript so you're trying
to overcompensate for it with your knowledge in ASP...see like with
the PHP I'm using...it's not really DOING anything except acting as a
simple conduit (a kind of wormhole if you will) between the Flash and
my database...where as with yer ASP you're actually having it do all
sorts of sorting, organizing, structuring, etc...and THEN yer sending
it into to the Flash file...which makes no sense at all, especially
when you consider that Flash/Actionscript is WAY faster and more
efficient than ASP...*shrugs*...
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by Onideus Mad Hatter on August 10th, 2006
On 10 Aug 2006 03:17:20 -0700, "SpaceGirl"
<nothespacegirlspam@subhuman.net> wrote:
Via URL redirects within a preloaded Flash file in conjunction with
some kind of meta refresh I'm assuming? That's the only way I could
see that you could do it within Flash...well I mean you can check the
version of Flash within Flash, but then if they didn't have Flash they
wouldn't even be able to get that far anyway. Anywho, teh method I
mentioned that I assume yer using is extraordinarily slow you
know...although it eliminates the need for javascript.
Yer welcome.
--
Onideus Mad Hatter
mhm ¹ x ¹
http://www.backwater-productions.net
http://www.backwater-productions.net/hatter-blog
Hatter Quotes
-------------
"I'm not a professional, I'm an artist."
"Your Usenet blinders are my best friend."
"Usenet Filters - Learn to shut yourself the fuck up!"
"Drugs killed Jesus you know...oh wait, no, that was the Jews, my
bad."
"There are clingy things in the grass...burrs 'n such...mmmm..."
"The more I learn the more I'm killing my idols."
"Is it wrong to incur and then use the hate ridden, vengeful stupidity
of complete strangers in random Usenet froups to further my art?"
"Freedom is only a concept, like race it's merely a social construct
that doesn't really exist outside of your ability to convince others
of its relevancy."
"Next time slow up a lil, then maybe you won't jump the gun and start
creamin yer panties before it's time to pop the champagne proper."
"Reality is directly proportionate to how creative you are."
"People are pretty fucking high on themselves if they think that
they're just born with a soul. *snicker*...yeah, like they're just
givin em out for free."
"Quible, quible said the Hare. Quite a lot of quibling...everywhere.
So the Hare took a long stare and decided at best, to leave the rest,
to their merry little mess."
"There's a difference between 'bad' and 'so earth shatteringly
horrible it makes the angels scream in terror as they violently rip
their heads off, their blood spraying into the faces of a thousand
sweet innocent horrified children, who will forever have the terrible
images burned into their tiny little minds'."
"How sad that you're such a poor judge of style that you can't even
properly gauge the artistic worth of your own efforts."
"Those who record history are those who control history."
"Is my .sig delimiter broken? Really? You're sure? Awww,
gee...that's too bad...for YOU!" `, )
- Posted by SpaceGirl on August 10th, 2006
Onideus Mad Hatter wrote:
No, not really. That's a bit like saying ANY generated web page is a
"5th wheel". XML is a container for data. It's a way of encapulating
data in a format that is universal; so if I were to swap out Flash for
some OTHER presentational layer, it would be very easy.
And loose the inherant flexibility that XML offers. There is a good
reason Flash has a really REALLY good XML parser. It's because it's the
very best method for transporting lumps of relational data. Take a look
at some XML help sites. It's amazing how much time (ultimately) XML
saves.
Depends on the browser. Google it, there are lots of examples. It
doesn't matter anyway -- you are reliant on the browser to handle your
POST/GET. But what if you want to feed your data into something else
that doesn't support large POST/GET? You'd have to re-write your
application. If it were XML, no re-write required. Let browsers worry
about displaying HTML. Let Flash worry about prettyness. Let XML
contain your data.
Okay, IE for example; POST/GET is actually misprocessed (strictly by
the HTTP spec) - it caused us issues here when switch from
standards-based and non-standards based browser using JBoss. What
happens is IE effectively POSTs the form results as an "invisible query
string" as well as a proper POST. An application on the server
processing against strict POST/GET can choke, or misread. Also,
anything passed over QS or POSTs are very easily modifed by the user
(faked) making it easier to hack too.
IE 5, 5.5, broken QS handling in 6. That should be enough 
Earlier versions of NS only supported 1000 character posts too.
Could, and HAVE. When translating a database from one format to
another, the safest way is via XML. Once in XML, practically and
database can read it back in again. Try repressenting an entire
database with POST/GET
Dare you! 
Of course Flash would choke with any string over 32kb in size... unless
it's an XML document!
That's not the point. Why bother escaping at all? Use XML.
Yes...
Not if you want to maintain structure. Example; say I have 100 people
in a database. I extract the "people.db" as a single XML document.
That's ONE http request, and one lot of data over the network, yes?
Now, say I want to select everyone who was born in 1980 from the
database.
How would you do this using POST/GET?
How would you get all 100 records into Flash in the first place?
I really think you need to have a good look at how Flash handles data.
There's a lot of amazing functionality in there. There IS a good
alternative for XML, but that's not GET/POST. You can also use a Web
Service directly from Flash to inject data - that is much faster than
POST/GET or XML, but does require you to create a WS on the server that
Flash can talk to.
Straight line, if it gets you what you want. By using your method, with
a 100 record db you'd either have to have POST data that contained 100
records (extremely slow, imagine trying to parse that...!) or request
each record one at a time (100 times the number of HTTP requests
compaired to the single HTTP request needed for XML)
That's a single author. If there are twenty requests...
?author=fred&author=tom&author=mary...
Which is invalid. Would you start passing author1=fred, author2=tom
etc??? That means you have to dynamically assign all the vars, yes?
Nope. An array love. Just one single array - and it's an XML array, so
super easy to push and pull data from it.
Ah, this is where it gets sexy. You keep the structure so that in a
single line of code I can say "show me all books that belong to this
author" or "how many authors have X int heir name" and so on. Or, even
more complex stuff like "show me the comments made on this blog post,
then show me all other posts that have comments from these people". At
no point do I ever have to go back to the server and collect data. It's
already here, in memory, in an XML array.
Flash has no data structure, that's why. It's not fast, it's a lot
slower.
There's a really fantastic document here on the ins and outs of XML:
http://www.flashdeveloper.nl/g_flash_xml_faq.html
Not to mention stacks and stacks of documentation on the Adobe web
site.
Ernm... do you know how Flash works??? Hehe. Okay Flash CANNOT generate
XML (easily). It outputs graphics
XML is raw data. You'd never use
Flash for processing data for output into anything else other than a
presentation layer.
That's only because we're talking about a technology you don't
understand. Seriously, I'm not trying to wind you up or have a go - if
you are serious about Flash application design, you *have* to look into
XML. Flash is essentially geared towards it. Especially AS3.0. You
won't regret is, I promise. XML may look clunky from the outside (and
it CAN make projects bigger and slower sometimes), but as a way of
visualising, managing and representing data... it's a must have!
I can send you some little code examples if you're interested.
- Posted by Davémon on August 10th, 2006
\\ Onideus Mad Hatter :
a number, see... it was changed!
4k = bloat, are we in 1997 or something?
The content-type declaration be all freaky if you put Quirkmodes vb & js
together in the same file. Or no?
--
Davémon
http://www.nightsoil.co.uk/
- Posted by Davémon on August 10th, 2006
\\ SpaceGirl :
Totally. A rather simple example would be my flash-blog:
http://www.nightsoil.co.uk/index13.htm
It never got finished in that form, but it 'feeds' directly from the XML
created by the blog (wordpress running on php), so rather than having to
create multiple sets of logic to do different jobs (blog, rss, flash)
it's just done the once.
Also because it's using a known XML variant RSS, I can point it to other
sources and make it do the same crap! The context-free datastructure
just makes the flash code a heck of a lot more portable, which means
quicker development time.
There are speed issues with XML, for anything that requires realtime
interaction it /probably/ has too large an overhead. Applications like
multi-user arcade games you wouldn't want to be passing too much data
around in an XML format.
--
Davémon
http://www.nightsoil.co.uk/