Groups | Blog | Home
all groups > flash data integration > november 2005 >

flash data integration : Re: flash + php + mysql



lwq
11/13/2005 8:15:24 AM
The data to be sent(to be diaplayed in flash)from my code has two formats:
one is just display all the variables
the other is a display of some variables plus a password box when one variable
is true
eg.(according to my code)
if($blog_pwdtf){
//display title and password box
}
else{
//display title,post,post data
}
So if the $blog_pwdtf is set to true
the "if" will be true and whatever is outputed
otherwise the "else" will be true
Motion Maker
11/13/2005 10:44:29 AM
Not sure of your entire data flow and starting poing but assuming the PHP
script is the start point here is a possible structure using LoadVars. It is
a minimal skeleton but should work, you need to comment or uncomment the
first two lines of PHP. You may want to use XML since it looks like you will
have repeating variables and this can be easily modified for XML.


PHP:
<?php
//$blog_pwdtf = false;
$blog_pwdtf = true;


if($blog_pwdtf){
//display title and password box
echo "&showTF=true";
}
else{
//display title,post,post data
echo "&showTF=false";

}
?>

Flash (Just a request example for this pass. Can also do a send to send the
login data):

// Frame 1 code below and a text box that says "loading..."
// Frame 2 Your display title and password box and another set of code to
send it. Temporarily just place a text box that says "Future display of
title and password"
// Frame 3 Your display display title,post,post data. Temporarily just
place a text box that says "Future display of title, post and post data"
// Frame 4 Display of failed data comm to server. Temporarily just place a
text box that says "Error contacting host."

var my_lv:LoadVars = new LoadVars()
my_lv.onLoad = function(success)
{
if (success)
{
if (my_lv.showTF == "true") // Var from PHP
{
gotoAndStop(2)
}
else
{
gotoAndStop(3)
}

}
gotoAndStop(4)
}
my_lv.load("blogGetter.php")
stop()

Once you get this down, then you can ask about how to send down the
post,post data and how to design a screen to show it.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
The data to be sent(to be diaplayed in flash)from my code has two formats:
one is just display all the variables
the other is a display of some variables plus a password box when one
variable
is true
eg.(according to my code)
if($blog_pwdtf){
//display title and password box
}
else{
//display title,post,post data
}
So if the $blog_pwdtf is set to true
the "if" will be true and whatever is outputed
otherwise the "else" will be true

Motion Maker
11/14/2005 1:44:33 AM
On the data part of the question, you can download all the data you want and
then dynamically generate textfields and GUI objects as desired.

You may need to look at the ScrollPage UI component for a long scrolling
page where the length is not known.

Yes you can have users post comments and refresh the Flash movie with those
changes.

You need to remember in the PHP/HTML arrangment you reload the entire page
each time. In Flash, you have the Flash movie reconfigure itself with data
messages to and from the server.

Its all possible, just a matter of t and b (time and budget).

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
Is it possible to list all the entries in one page like this php page at
http://www.lwq.buildtolearn.net/blog/
and
a separate section whereby entries are displayed separately like
http://lwq.buildtolearn.net/blog/?p=11

And users can freely post comments?

-> Just like what is done in php being moved into flash?

lwq
11/14/2005 2:40:13 AM
Is it possible to list all the entries in one page like this php page at
http://www.lwq.buildtolearn.net/blog/
and
a separate section whereby entries are displayed separately like
http://lwq.buildtolearn.net/blog/?p=11

And users can freely post comments?

-> Just like what is done in php being moved into flash?
lwq
11/14/2005 9:27:32 AM
I have the "time" but no "budget" because i am doing it for a personal website.
Motion Maker
11/14/2005 11:00:39 AM
Of course you will know if you want to invest the time to learn Flash and
how it could be configured for your interface. That is where all the work
will be depending on choices made for Flash. So be sure you have the answer
to why use Flash for this.

I think you can get help from the Flash forums and I will follow this thread
to help.

The data com back and forth should be easier since you have a handle on the
PHP and Flash side data com is easy.

You might decide if you want to communicate data via URL vars or XML.

I suggest you start with a simple Flash movie that simply echos the data
from your PHP script and displays in a Flash text field. Strip the PHP
script of all the HTML and simply echo either in URL vars format or XML
format.

I posted some XML examples I use in Flash seminars earlier in the tread you
should study.

--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
I have the "time" but no "budget" because i am doing it for a personal
website.
If you don't mind, could you teach me how to realise the first part,the
blog(all display on one page).

lwq
11/15/2005 9:37:26 AM
Motion Maker
11/22/2005 10:25:32 AM
I suggest you start with a simple Flash movie that simply echos the data
from your PHP script and displays in a Flash text field. Strip the PHP
script of all the HTML and simply echo either in URL vars format or XML
format.

I posted some XML examples I use in Flash seminars earlier in the tread you
should study.


--
Lon Hosford
www.lonhosford.com
May many happy bits flow your way!
[quoted text, click to view]
where should i start?

AddThis Social Bookmark Button