7/02/2009

FlashAntTasks – Compiling Flash Movies With Ant


If you’ve seen Mike Chambers flashcommand implementation you’ll notice that it only works on the mac. We have a lot of people at my office on Windows and I wanted to provide them something that could also work on a Windows computer. Plus I wanted something a little cleaner, easier to learn and a bit more elegant than most of the solutions out there. So I created FlashAntTasks. Its a jar file that you reference in your class file that creates flash tasks that compile separate movies. I’m posting it up on Google code so everyone can enjoy. So enough with the fluff, here’s the details
WINDOWS USERS – you need to pass in flashcommand the flashapp attribute with the uri to your flash.exe like
You can download the code at http://code.google.com/p/flashanttasks/.






simple example build file






















































Web Tier Compiler For Flex

Adobe is releasing a new web tier compiler for Flex on Adobe labs. This allows you to simply copy the Flex files into a directory visible to your server and your app will be compiled automatically when you request the main application file using your web browser. The resulting model feels very similar to working with ASP, JSP, PHP, or CF.
It is available for both Apache and IIS, and runs on Windows, Mac, and Linux.
All that’s needed is a Java Runtime Environmnet (JRE). This has NOTHING to do with Flex Data Services and FDS applications will not run with it. It does NOT require J2EE. It’s just a simple piece of software you can deploy to make Flex development more like standard web development. Enjoy!

Installing Ant in Flex Builder 3

Until Flex Builder 3 Stand Alone includes Ant built in you will have to install it separately. For those that are not familiar with Eclipse, this can be tricky to install.The following is the revised steps for Flex Builder 3 Stand Alone.
Launch Flex Builder 3
Go to Help > Software Updates > Find and Install
Search for new features to install, click next
Select “The Eclipse Project Updates”, click finish
Note: If you do not have the option above click New Remote Site and enter “The Eclipse Project Updates” as the name and “http://update.eclipse.org/updates/3.3″ as the url.
In Eclipse Project Updates > Eclipse SDK Eclipse 3.3.2 (3.3.3, 3.3.4, etc) Select “Eclipse Java Development Tools…”, or otherwise known as JDT click next
Accept the license agreement, click next
Click finish to start download
Eclipse downloads Java Development Tools
Click “Install all” to install Java Development Tools
Restart the Eclipse workbench
That’s it! You now have Apache Ant support in your standalone Flex Builder 3 install.Go to Window > Other View > Ant and Click OK. You now have the Ant view

7/01/2009

How to embed a text file in Flash

package {
import flash.utils.ByteArray;
[Embed(source="words.txt",mimeType="application/octet-stream")]
public class embedded_text extends ByteArray {
public function embedded_text() {
}
}
}


package {
import flash.display.Sprite;
import flash.text.TextField;
public class wordz extends Sprite {
var text_field:TextField = new TextField();
var words:embedded_text = new embedded_text();
public function wordz() {
addChild(text_field);
text_field.height=400;
text_field.width=500;
text_field.text=words.toString();
}
}
}