All Posts in AS3

March 27, 2013 - No Comments!

Wordwrap between Textfields AS3

On a project we're currently working on I was required to animate character input using sprite sheets to handle the animation of the characters. This was done by using textfields hidden to the user and animating their input. One of the features required was wordwrap so here is a simple way to create the appearance of wordwrapping between 2 separate fields...

Read more

January 13, 2012 - No Comments!

Flash Bug: Flash HTMLText Jumps on RollOver

Working on a project where the html text of a field would appear to jump/ contract on rollover. It appears the issue occurs when a dynamic textfield has autoSize set to true. There is a simple fix by setting autoSize to false after the text has been set.This may play with the height of the textfield if it is dynamically sizing so to fix this I add in the following code...

Read more

January 3, 2012 - No Comments!

Code Snippet – Get Day in Year

Small code snippet that calculates the number of the selected day in the overall year (e.g. 1st Feb is the 32nd day of the year).

function getDayInYear(day:int,month:int,year:int):int
{
var day:int = day;
var month:int = month;
var year:int = year;
var dias:Array = [31,28,31,30,31,30,31,31,30,31,30];
if(year%4 == 0 && month > 1)
day++;
for(var i:int = 0;i < month;i++) day+=dias[i]; return day; }

June 9, 2011 - No Comments!

WCK Pure AS3 Example with Contact Events

The WCK framework is something I used recently on the Blackberry Playbook version my Susie Starfish app. Moving into the world of physics is a big step for any flash dev and I feel the WCK framework is a good way to get up to speed on some of the basics.

Moving onwards I wanted to be able to appreciate how the framework works a little more so I could begin to program aspects myself through pure code in a way that was more familiar to me than the Box2DAS port. My reasoning is that I just wanted to be a little more in control for when I come to memory management and the general interactivity of the project. The following code snippet is a quick example of a box falling onto the ground and firing off the events related to such an activity.

Read more

June 9, 2011 - No Comments!

Playbook Debug Connection Error Resolved

Finally managed to get the debug running on my Playbook/ Mac setup - initially I thought it was something to do with Little Snitch or a firewall setting. Anyhow... to find the correct debugger IP go to >Flash Builder >Preferences >Target Platforms and use the IP address from the drop down (in my case I used the en1) and voila - your debug statements will appear in the console!

June 9, 2011 - No Comments!

failure 550 ApplicationModeMismatchError – Playbook Development

Just a small issue relating to publishing to the Playbook from Flash Builder 4.5. When launching the application onto the device you are greeted by a nice error telling you of an "ApplicationModeMismatchError."

The fix that worked for me was to go into your "Run Configurations" ( > Run > Run Configurations) and uncheck the "Clear application data on each launch" option - then run the app, then go back and recheck it.

May 5, 2011 - No Comments!

Fonts Disappear from Textfields In Flash CS5

This is a small issue I seem to run into when I use the Flash CS5 IDE. I'll create a text field at some point in the project only to come back the next day to find that it won't display the text. Only something I can put down to as a glitch in Flash. A simple fix I found today was to move the file and reopen it - and yep.. the fonts come back. No idea why but seems to be an issue a few people have run into, hope this helps some people out.

April 4, 2011 - No Comments!

2011… Year to be a Flash Dev with some emerging technology… Thank you Apple

Over the last couple of weeks I've had some free time on my hands and wanted to see what was going on in the Flash community of late. It seems like the guys on the Adobe Evangelist team have got it right when they said the year would be a good one for Flash devs (not that any of us were sweating right!). With lots of cool projects on the Flash horizon I thought I'd put together a quick post on some interesting projects I'd been able to play with and those I'd seen on the radar.

Read more