Flex and Flash with Zend
In order for this tutorial to work, you need to make sure that your environment is setup by following the instructions located here. I have included an fla (cs3) file in the /Flash folder of the Flex project archive. You would not normally do this for a production project but this is just meant to be a simple example and since they both use the same php files it didnt make much sense to split this article up into two separate articles.
I am currently using Flex Builder 3.0.2 and Flash CS4 but I saved the fla as a cs3 file for those that don’t have it yet.
Code and instructions after the jump Read the rest of this entry »
Setup WAMP and the Zend Framework for use with Flash and Flex
There are a few tutorials out there on the net about using Zend with Flash/Flex but most seem to be overly complicated and many don’t work even after following the instructions. (I am hoping that mine will.
) The next few articles cover a VERY simple implementation that you can build on for use with future projects and I hope it can save people time when it comes to beginning to explore this new method. This post will deal with setting up your environment to be able to use Zend with Flash/Flex.
Code and instructions after the jump. Read the rest of this entry »
AS3 – Load XML Document Class Example
Posted by Jeff in ACTIONSCRIPT 3.0 on November 18, 2009
One thing that I do quite often in Flash is load XML. In order to save time, I separated a lot of that code out into external class files. I also created a snippet of code that calls those files in order to save time when I want to use them. (You will need Lee Brimlow’s snippets panel for this to work.)
The LoadXML and LoadURL classes are probably very similar to those found at Learning Actionscript 3 as that is where I learned a lot about this topic previously. Hope you find this helpful!
Load XML files (774.5 KiB, 25 hits)
Code snippet (for the panel) after the break…
AS3 – Draw Circle Animation Based on Time
Posted by Jeff in ACTIONSCRIPT 3.0 on November 1, 2009
If you need to perform an animation and have it be standard when viewed across different machines, it is best to use an onEnterFrame event. I had a need in a project recently to draw a circle in a specified amount of time. I had been using the Timer class but found major time discrepancies between running the code locally and running the code in a browser. With some code that Jackson Dunstan provided, I was able to modify the animation so that you can start/stop drawing the circle based on user input. (In the sample provided it is by clicking the stage) I hope this helps someone in a similar situation. Code after the jump…
AS3 – Loading CSS and Fonts
Posted by Jeff in ACTIONSCRIPT 3.0 on October 30, 2009
Working with CSS and fonts in Flash (especially with dynamic text) can be a huge pain. I have come up with a way that makes it a lot easier. What I do is load them up, store a reference to the css file in a global class, and simply refer to that class when you need to use the fonts and css. The css styles dictate which fonts are used where within your application.
This method seems to work out well and saves on file size as you are referring to an instance of the font instead of instantiating it over and over again etc. (You will need the FontLoader class in order for this to work.)
Description of the files after the jump…
AS3 – Search & Replace a Word
Posted by Jeff in ACTIONSCRIPT 3.0 on October 14, 2009
In a project I was working on recently there was some information coming back from the database that I was displaying in a textfield. I didnt have any control of the text stored in the database and it was saying to ‘click the button above…’ but in this new interface we were designing, the button was below this textfield. I wrote a little function that replaced the word ‘above’ with ‘below’. Code after the break.
AS3 – Uppercase an input textfield’s contents automatically
Posted by Jeff in ACTIONSCRIPT 3.0 on September 25, 2009
Here is a quick snippet on how to automatically set an input textfield’s text to uppercase. (If you do it on the KeyboardEvent.KEY_UP event, the text will initially show as lowercase than change to uppercase.)
1 2 3 4 5 | text_txt.addEventListener(Event.CHANGE, toUpperCase) private function toUpperCase(evt:Event):void { evt.target.text = evt.target.text.toUpperCase(); } |
AS3 – Remove Spaces from a String
Posted by Jeff in ACTIONSCRIPT 3.0 on September 21, 2009
I had a need to remove spaces from a string the other day so I came up with this helper utility and put it in a small Utility class. This could also be used to remove other characters.
1 2 3 4 5 6 7 8 9 10 | package { public class Utility { public static function removeSpaces(str:String):String{ var text_arr:Array=str.split(' '); return(text_arr.join('')); } } } |
Usage:
1 2 3 4 | import Utility; trace(Utility.removeSpaces('Remove All Spaces Please.')); //Output: RemoveAllSpacesPlease. |
Draw a Circle – AS3
Posted by Jeff in ACTIONSCRIPT 3.0 on September 18, 2009
In a project I was on, I had a need to draw a circle in a certain amount of time and it proved to be a bit of a pain. So here is my code (with some ugly comments) that I used to do it.
Code after the jump.
Draw a Circle (6.7 KiB, 18 hits)
AS3 – Extrude Text in Flash
Posted by Jeff in ACTIONSCRIPT 3.0 on September 15, 2009
This is my own rough attempt at it but thanks to Devon Wolfgang and Den Ivanov I was finally able to do something that I had wanted to do for awhile in Flash and that was dynamically extrude text in Flash.

Extrude Text (72.2 KiB, 32 hits)