views:

113

answers:

4

I want to create my own systems for flash (like a scoreboard and made a feedback system) but I honestly have no clue where to even begin when it comes to implementing such things using AS3.

I know how to create say a scoreboard using PHP but then I have no clue at ALL how I would get that into my game using AS3.

Any help/tutorials would be great, Thanks!

A: 

Maybe Flex would be a good option for you. You could try using AS2 which has a lot more in common with JavaScript than anything else. AS2 is a much more forgiving environment too from a syntax/coding style perspective and might be more inviting to a PHP programmer.

Jon
+3  A: 

You can use the HTTPService component with an Adobe Flex program (the language is based on ActionScript3 and is a mix of MXML for the User Interface and ActionScript3), and receive a response from your PHP script in a specific format (i.e.: XML, plain String, etc), which you can process with AS3 and use to update your Flash application. I mentioned XML because AS3 supports the e4x format for HTTPService, and it becomes really easy to manipulate XML data with AS3.

The Adobe Flex Developer QuickStart has everything you need to get started with Adobe Flex (I went through that route), and there are countless other tutorials online (a Google search for a specific tutorial subject would turn up some results). Another resource worth checking out is the Flex section on Switchonthecode.

An article geared towards what you want can be found on the Loading External data with HTTPService page of the QuickStart guide mentioned above.

Additionally, the Flex Getting Started tutorial articles on Adobe's wiki platform may be of use, as they offer a lot of examples of the language's useful features. An article from the wiki on External Interfaces actually explains how to make your Flex Application talk to a JavaScript on the HTML page, which might be useful for you also.

Hope this helps,

raptors
A: 

If you want to get really technical, it doesn't really matter as long as you compile your code into ABC bytecode which is basicly as low level as it gets before Flash compiles/interprets the code. In theory, this would mean that you could write a compiler for most any language.

However, I'm guessing you're asking for something that's more readily available. In that case, ActionScript is your friend. There is no reason to go with AS2 as it is for all intents and purposes a dead end. The player falls back to AVM1 for AS2 code which is much slower than AVM2 which runs AS3 code. AS2 also is a much looser language than AS3. Sometimes that's a good thing, but generally it's like running barefoot across a field of glass.

You could have a look at Flex, which combines MXML and AS3. MXML is a markup language for declaratively defining components (visual and non-visual). While MXML is a markup language, it is not similar to HTML at all. However, it does help knowing HTML (or any other markup language, such as XML) when faring into the world of MXML. The Flex compiler interprets the MXML code and generates AS3-classes which are subsequently compiled into bytecode.

Just as raptors tell above, you can also perform regular http calls. While this is most certainly useful, it's not something I suggest for logic that really do belong client side.

macke
A: 

You should look into AMFPHP, an alternative to Flex Data Services that makes ActionScript-PHP integration much easier.

Selene