Twister1004 Posted January 9, 2009 Share Posted January 9, 2009 Hey everyone! Well my life just got a whole lot more complicated! D=. Ok, I basically have a huge question, which I know nothing about flash and I would like to ask everyone, if you know how to include the PHP stuff on the action script. Is it like normal in HTML where you go <?php ?> and stuff or do you have to include it from another file? If anyone could help me with this, it is greatly appreciated! P.S. My game design team (new team) is converting to flash, and I don't know anything about it. So this is why I'm asking. Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/ Share on other sites More sharing options...
corbin Posted January 9, 2009 Share Posted January 9, 2009 Uh, you can't embed PHP in Flash.... They can communicate in a couple of ways, but no embedding. Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-732984 Share on other sites More sharing options...
Twister1004 Posted January 9, 2009 Author Share Posted January 9, 2009 So, it has to be in different files, as in the PHP scripts can be included into the action scripts? Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-732989 Share on other sites More sharing options...
corbin Posted January 9, 2009 Share Posted January 9, 2009 PHP scripts cannot be included into ActionScript code. Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-733709 Share on other sites More sharing options...
xtopolis Posted January 10, 2009 Share Posted January 10, 2009 What corbin means to say is that if you want to "have PHP in your flash" it's not what you think. You can interface with PHP via AS... but PHP will always be doing PHP things and processing and serving up data/html/ or interacting with a database. If you are the "php guy" of your game design team, you won't do anything different other than set up pages for your "flash guy" to talk to with his AS. It works the same way as if you were to use a form/url. The only thing you might do differently is setup return data into things that will be easy for the AS to pickup and interpret (such as xml for scores, or values for ingame things) Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-733786 Share on other sites More sharing options...
corbin Posted January 10, 2009 Share Posted January 10, 2009 What corbin means to say is that if you want to "have PHP in your flash" it's not what you think. You can interface with PHP via AS... but PHP will always be doing PHP things and processing and serving up data/html/ or interacting with a database. If you are the "php guy" of your game design team, you won't do anything different other than set up pages for your "flash guy" to talk to with his AS. It works the same way as if you were to use a form/url. The only thing you might do differently is setup return data into things that will be easy for the AS to pickup and interpret (such as xml for scores, or values for ingame things) Uh, you can't embed PHP in Flash.... They can communicate in a couple of ways, but no embedding. Yeah, I hinted at that, but I guess I should've been more clear ;p. Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-733823 Share on other sites More sharing options...
Twister1004 Posted January 10, 2009 Author Share Posted January 10, 2009 So basically it can be used to make pages, and PHP can direct it (by $_GET and stuff), but is it even possible (by what you say) to use a login, in flash? Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-734311 Share on other sites More sharing options...
xtopolis Posted January 10, 2009 Share Posted January 10, 2009 You can create a PHP login system and access it through Flash (AS) to authenticate. As for storing the authentication inside flash, I'm not sure how you do it. Stop thinking of PHP and Flash as things that work inside one another. PHP is a separate entity. It processes things, interfaces with a database perhaps, and returns content (be it xml, html, plaintext, etc). As soon as PHP does any of those things, it stops. Each request is treated as new (except for sessions, kinda) Flash is used for creating movies, timelines, events. It provides constant feedback and event listening because it's persistent. ActionScript can be used to query a webpage just in the same way that your browser would. Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-734316 Share on other sites More sharing options...
Twister1004 Posted January 10, 2009 Author Share Posted January 10, 2009 Ok, I will eventually figure this out! >=D, I must. Thank you for your help. If you anything else you could say, post it . I will now start to try and work this all out =D. <3 Quote Link to comment https://forums.phpfreaks.com/topic/140095-new-to-flash-with-adding-php/#findComment-734321 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.