views:

56

answers:

1

i have a few questions about flash web sites.

  1. are their "pages" done using frames? is that the only way?

  2. for login/access control, is setting variables to indicate login secure? is there a way to use PHP Sessions like in regular PHP sites? or will it be the same as flash variables?

+1  A: 

flash web sites are usually applications, that are loaded once, and then display all the content ... so navigation is within the loaded swf ...

there are two different approaches ... either the site content is loaded from a server, using XML, url variables (&ident1=value1&ident2=value2...), or plain text (which in turn may represent a custom format, such as JSON, CSV etc.) ... or the subpages are swfs, that will be simply loaded into the main swf when needed ... the first approach is cleaner and much more flexible though ... you should not use the second approach, unless your content is static or rarely updated ...

when it comes to sessions/login, this is something, you will need to handle yourself ... you will need some kind of login.php, that will allow authentication and session creation ... login would look something like login.php?user=username&password=userpassword ... and it should return a session id and maybe a status, thus "&success=1&sid=somesessionid" on success and "&success=0" on failure ... any further actions/loading operations would then go to other php-files, and would look like someAction.php?sid=somesessionid&param1=value1... ... in your php you would then check against the sid (usually stored in a database) ... you could, in theory, use php sessions as well, but this is a little more tricky ...

for XML, use the XML class, for url variables, use LoadVars, and callback onLoad, for plain text or custom formats, use LoadVars and onData ... look them up in the language reference ... and appart from that, AMFPHP is worth mentioning ... have a look at it ...

good luck then ... ;)

back2dos