The FlashChemist!

My Experiments and Thoughts on the Flash Platform

Archive for the ‘as3’ tag

Font Size Limitation in Flash!! – 127 px

leave a comment

I was surprised by the fact that there is a limit to the maximum font size you can set in Flash. Yes, there is a limit and the magic number is 127 px. Collin Moock says, ‘The limitation is based on historical requirements placed on Flash Player by the operating system’ …

He mentions about a solution in his blog post here, which is really a work around, and it may not work well for you in all the situations. It basically to  resize the text field(scaled it proportionally).

Or read about font rendering using the FP 10 Drawing API here in Polygonal Lab (AS3 Data structures fame). There should not be any limitation to font size because it uses the drawing API and so vector shapes. But, obviously, it will not be a text field.

Written by Vipin

August 9th, 2010 at 7:21 am

Posted in Flash

Tagged with ,

Creating AS 3.0 AIR Projects in Flex Builder 3.0 /Flash Builder 4.0

leave a comment

While this is an ideal choice of making AIR desktop applications for those who does not want the Flex framework, I am still surprised that Adobe didn’t add this option to its new IDE product, Flash Builder 4.0. Flex/Flash Builder being the best AS 3.0 editor so far, this option is really missing.

There is a bug in the Adobe JIRA – https://bugs.adobe.com/jira/browse/FB-9303 . But honestly, this looks like a natural choice for Adobe (!?)

I was using a hack for making this work with Flex Builder 3.0 and same works for Flash Builder 4.0. Its is a simple method though:

In the Flex/Flash Builder IDE, select ‘New >> Project’ and select ‘Flex Project’ option.

From the Wizard, please select ‘Desktop Application (Runs on AIR)’, give a project name and click ‘Next’ button instead of your usual ‘Finish’ button.

The next screen prompts for defining the folder for debug. Leave it as is, unless you want to, and click on ‘Next’ button.

The next screen is where you have to do some magic. Here it is.

Change the file extension of ‘Main Application file’ from .mxml to .as — nothing else.

Now click your favourite ‘Finish’ button, and you are set. But, if you run your project, it doesnt show up; this is because the visibilty option of your native window is set to ‘false’ by default. So, open up your application XML file (That will be in the root and named ProjectName-app.xml), and uncomment the sub node of the node and set it to true. Here is how it will look like:

Now, you have your AS3 AIR project, and you have access to all the AIR API’s, and your ’stage’ attribute will have the AIR related properties.

Workaround, still works nice. Adobe, we need this option from the wizard.

Written by Vipin

June 1st, 2010 at 2:47 pm

Posted in AIR, Flash

Tagged with , , , ,

A PureMVC multicore sample for pure AS3 Flex Builder 3.0 project

leave a comment

I have been searching for a sample of pure as3 project sample (using Flex Builder 3.0), for a new assignment. I have been using PureMVC multicore for my module Flex/AIR based applications, but never did a pure as3 project.

Here is the link to the beautiful tutorial by Actionscript 3.0 design patters. The source is available for view or download. The downloaded file is a Flex Builder archive and can directly be imported into Flex Builder workspace.

Written by Vipin

March 3rd, 2010 at 6:33 pm

Posted in Flash

Tagged with ,

Stop All Sounds playing in a Flash Movie

one comment

Well, I didnt know that there is no stopAllSounds() in AS3 compared to AS2 world. But ofcourse you need this method most of the time to stop all the sounds playing in a movie irrespective of the source or hierarchy.

The stop all sound functionality exists, but moved to a new safe place, called the ‘SoundMixer’ class. Why in SoundMixer? No idea.

SoundMixer.stopAll()

is going to do the trick for you.

I always used to feel that why playing sound in AS 3.0 is so complicated. You have to use Sound, SoundChannel, and SoundTransform to write a basic Audio Player. At times SoundMixer tooo.

Written by Vipin

February 28th, 2010 at 5:18 am

Posted in Flash

Tagged with