SWF Based Relative URLs in Flash or Flex – taterboy
January 17th, 2009 | Filed under: ActionScript 2, ActionScript 3, Flash, Flash AS2 to AS3, Flex, Tips

When a Flash/Flex app loads into a browser, all urls for the swf are now relative to the file that is hosting the swf and not the location of the swf file itself. This can create issues between testing the swf locally and viewing it on the live site.

Case Study:
When building a demo to display on this blog I have to create one version with relative urls to distribute as source and a separate sample for preview using absolute urls. This is because of the setup of the blog, some files like the index page display from the root of the blog while all the article files have unique urls based on title and date.
Read More »

Technorati Tags: , , , , , , ,

| 6 Comments »

Flash Actionscript 101, The First ActionScript I Ever Learned – taterboy
December 21st, 2008 | Filed under: ActionScript 101, ActionScript 3, Flash, Flex, Tutorials

This is it, the very first bit of actionscript code I ever learned, besides play() and gotoAndStop() of course. The lesson went down with an experienced programmer looking over my shoulder telling me what to type. After this little app was finished, my brain hurt only understanding a few of the lines we wrote. That code was referenced and/or modified on more then a few projects that came after, each time deciphering more and applying it to new functionalities.

The original script was back in the day of AS1, but I am going to present it to you in AS3. If you are a beginner to ActionScript then it is the perfect time to learn AS3.

We are going to start really remedial for a minute and go over the basics of the classes and objects we will be using. It is kind-of long, so if you already have the basics covered, you can skip to the Application code.
Read More »

Technorati Tags: , , , , ,

| 5 Comments »

A Simple Game Engine Using Random – taterboy
December 1st, 2008 | Filed under: ActionScript 3, Flash, Flex, Games, Tutorials

Using Random in Game Development, with strict guidelines, can bring some variety to game play.

This sample is not a single solution but an approached I used in developing Whacky Voting – a politically smashing game. It uses random with some strict rules to get rid of sequences that some players can easily remember, yet keeping game play consistent from one game to the next.

This demo starts with a configuration section, used to set up how we want the game to act. The engine it self could be organized a little better to be more transportable. It is commented pretty well though, so it should be easy enough to understand the approach as well as practical usage. Random is used to shuffle all of the objects that appear on screen as well as what container the objects are associated with.

Configuration:
We use config data for each game so that we can easily tweak game-play without hacking our code later. We can use arrays, xml or other data sources. Plan ahead and build config options into your game as it is developed.
Read More »

Technorati Tags: , , , , , , , , , ,

| 4 Comments »

10 Flash/Flex streaming video tips – taterboy
November 27th, 2008 | Filed under: Flash, Flex, Tips, Video

In a Birds-Of-A-Feather discussion group at Adobe MAX last week. No remarks were planned, It was supposed to be a discussion, we hoped to talk to other developers about what’s new in using Flash video. We did not get a bunch of new information but we did get a lot of hard questions. Some of them were not fully answered and others were speculated upon. When I was asked my tips, I gave all I could think of at the time. Later that evening I remembered a couple more, some of my best ones.

So for those who went to MAX and those that did not, here are my official video tips for Flash and Flex.
Read More »

Technorati Tags: , , , , , , ,

| 1 Comment »

Adobe launches Tour de Flex – taterboy
November 17th, 2008 | Filed under: Flex, General Info, Tips

It is official, Adobe launches Tour de Flex, the update to the Flex 2 Component Explorer. Check it out here Tour de Flex.

Check out the About link in the drop-down in the upper right, to find links back to this blog (Todd Williams) and our company HD Interactive.

Also Greg Wilson has more background on how this version can to be.

Technorati Tags: , , , , ,

| No Comments »

Free Fullscreen Kiosk Web Browser – taterboy
October 22nd, 2008 | Filed under: ActionScript 3, Flex, Tips

Building a Fullscreen Kiosk Web Browser using Flex and AIR.

There are a number a fullscreen web browsers/plugins out there, but not all of them are free. We have used a couple different ones over the years for kiosks that need Web Browsing capability or to display an HTML based kiosk application. Next time I can just build one, all I need is a few lines of code and a touchscreen monitor.

I am impressed with AIR’s webkit (HTML Component), it is light and loads pages pretty fast. Here is an example of building a serious utility with very few lines of code. The core fullscreen browser takes only 4 lines of code in Flex 3.
Read More »

Technorati Tags: , , , , , , , , ,

| 5 Comments »

Session Variables and AMFPHP – taterboy
September 3rd, 2008 | Filed under: AMFPHP, Flash, Flex, Tips

In normal uses PHP and other server/scripting languages are able to store variables for later usage. Due to the fact that the these pages are not actually living in a browser, remoting is one of the exceptions where variables do not live between calls. We have to plan out our Flash to PHP conversations as if PHP has very short term memory and include all the needed data to complete every transaction. For instance, if you have to store information in a database using a userID, even though you have just recieved that userID from php, your next php call will have to include the userID because PHP just can not remember.

Here is a demo of using PHP session variables to temporarily store and read data. Even though normal variables vanish, session information is live and well.
Read More »

Technorati Tags: , , , , , , ,

| 1 Comment »

Is AS3 Ready For Prime-Time? (part 2) – taterboy
July 30th, 2008 | Filed under: Flash, Flash AS2 to AS3, Flex, Tips

Is Flex AS3 and Flash AS3 The Same?
It is hard enough to learn a new language, but when you write code using logic based on a method that worked so well in Flex, but now in Flash you are getting errors telling you that the method does not exits. It can get a little frustrating.

In Flex I use the Canvas as a starting point for most components, it inherits properties and methods from Display Object, UIComponent, and Container classes. In Flash we use a MovieClip as our base, which inherits methods and properties from the DisplayObject and DisplayObjectContianer classes.
Read More »

Technorati Tags: , , , , , ,

| 3 Comments »