-
YOu may download it and view the documentation for it(all 40 pages) at:
http://www.markme.com/as/flashsql/
What is the Flash / SQL component kit you ask?
The FlashSQL component kit is a collection of client side ActionScript objects, and server side tags that work together to allow users to execute SQL database queries from within Flash 5, and then manipulate the results of the query within Flash 5 through a Java like ResultSet object.
The kit includes both Cold Fusion and JSP custom tags, as well as PHP code that allow you to use these languages as the server side level of the architecture. In addition, this document describes what is necessary in order to use other middleware languages such as ASP and Perl as the server side part of this architecture.
What does the code look like to execut a database query from flash?
s = new Sql();
s.sqlOnData = mySqlOnData;
s.setServerUrl("http://localhost/test/FlashSQL.cfm");
if(!s.isActive())
{
s.execute("select * from Weather");
}
have fun...
mike chambers
-
hm... looks like cool stuff.
I'll give it try tomorrow at work - lets see if it likes my Win2k, Apache, PHP4 and mySQL config
Yours
HTD
-
here are the php configurations i tested with:
win 2000, php 4, apache 1.3.9, ODBC
linux / red hat 6.2, php 4, apache 1.3.9, MySQL
so you shouldn't have any problems (but let me know if you do).
mike chambers
-
You're right... it works just fine, I tested it on our Server and on my machine. The AS, PHP and CF are very well designed (i can't tell if the JSP is too - i don't like java ) You have done a great job here, thank you!
I'll tell you when we set up a Project on this FlashSQL thing. I think problems or ideas for new features only come up when it's used in "real-life"!
Yours
HTD
-
Your site has a broken link for the string.as file in the "View Flash Objects" section.
-
I like the sound of what you've done with this. A couple of questions:
1. Since you are using the XML object, can I assume that the object doesn't really care what sort of data you are sending and retrieving? Doens't have to be XML at all, huh?
2. Is the syntax the same for every type of middleware that you support? And the middleware (scripts) for CF, ASP, and PHP are all pre-written?)
3. Were there any other reasons for using the XML object besides the ease of the load method? Seems you could have built that method yourself.
4. How does the onData (callback?) function work? Is that a generalized version of onLoad for the XML object?
Thanks!
-
Mike,
Good questions.
1. I am extending the XML object, but I am not sending and retrieving XML. I am sending a retrieving a string of data which I manually parse into a ResultSet object.
I do this because it is significantly faster than loading and parsing XML.
2. As far as the Flash ActionScript syntaz is concerned, yes, it is the same no matter what the server side code. All of the server side components i wrote (JSP, Cold Fusion, and PHP) basically work the same with some minor differences (which are documented).
3. see 1. I basically did build the method myself.
4. onData is an undocumented method that is called once all of the data is loaded. THe reason I extended the XML object is so that I could use its onData method, and the have the user define their own so i could pass the data to them.
mike chambers
-
I know about the broken link for the string.as file. Branden has been doing some work on his web server, so the link should be fixed soon.
the string.as is included with the download though.
mike chambers
-
Originally posted by MikeChambers
4. onData is an undocumented method that is called once all of the data is loaded. THe reason I extended the XML object is so that I could use its onData method, and the have the user define their own so i could pass the data to them.
I've been trying to gather more information about the XML object and XMLNode object.... more of the undocumented information. Do you know any other methods or properties for these objects that isn't referred to by Macromedia?
-
none that come to mind...
you should check out:
ActionScript the Definitive Guide
by Colin Moock
http://www.amazon.com/exec/obidos/ASIN/1565928520
It covers everything, and i mean everything, there is to know about ActionScript.
mike chambers
mesh@macromedia.com
-
Thanks for the book reference. I just looked at that yesterday. There is some great info in there -- seems to be the most technical book I've seen about Flash.
-
FlashSQL Kit - middleware
Mike, Thanx for the flashSQL Kit. Haven't been able to us it yet as my host refuses to install php4.0.5. Is it possible to create php3 middleware to work with flashSQL Kit?
The alternative is to try and get it working with jServ on a unix. Can you see any problems with that before I go down a dead end?
cheers
stuartha
-
I would imagine that it would be relatively easy to get it to work with php 3. do you know what parts of the php page it is choking on.
if you know some java, it would be pretty simple to create a java servlet to get it to work with jserv. just use the jsp custom tags and pages included as a guide.
i have a new version done, i just need osme time to polish it. it is much faster now. if i get a chance i will add a servlet to the kit. also, if you get it working with php 3, send me your page and i will add it to the kit.
mike chambers
-
the php is sending back
Fatal error: Call to unsupported or undefined function writemessage() in /usr/local/etc/httpd/sites/abc.org/htdocs/bat/FlashSQL_MySQL.php on line 1
I'm just a flash 'as' person, but I'll get a friend to take a look at the php4 convertion to php3.
If you do get the time to put a servlet in the next version of the kit.... 8)
thanx again
stuartha
[Edited by stuartha on 10-11-2001 at 04:42 AM]
-
php middleware working with php3
In your script the function declaration appears BELOW the function calls. By putting the function declaration ABOVE the calls to it....
function writeMessage($msg, $conn)
{
if($conn)
{
mysql_close($conn);
}
out.print($msg);
exit();
}
8)) and now it works..... with php3
Great KIT.....
-
cool, that was easy. i will update it in the kit for the next release.
thanks for the help...
mike chambers
-
php middleware
Hi Mike,
Just to let you know that the php middleware, does not seem to utilize the ResultSet as intended.
all rows returned from FlashSQL_MySQL.php are present in the first row.
which meant that i had to .split up the first row into my own array.
Hope it makes sence.
by the way markme does not seem to be up.
Stu
-
lets see, i think that that bug was fixed, and has something to do with single quotes automaticalyl being escaped? to be honest i dont remeber.
the web site is down indefinately until i find time to get it on a new host.
if you send me an email offline, i will see if i can find the update php file, or find out for sure what the bug was.
mike chambers
mesh@macromedia.com
p.s. sorry for all of the typos, i am tired.
-
Hi Mark,
first of all - thanks for that great work.
I just want to point out that there may be some reasons to do databasing the traditional way (with scripts on the server)
a) if you view websites you might wonder why one site's search feature takes one second to produce results, and another one takes half a minute. This may be just a slow server, or a better organiztion of the database tables. Now, with the sql codes inside the flash movie, it is very easy for your competitors to find out. Exposing details like table and column names might even make it easier to hack a database
b) some queries cannot really be done in mysql, so you would normally produce an enormous result set and use php to filter it. If you make the db call directly from flash, all that lot would be transferred to the movie
Musicman
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|