Archive for the ‘Flash platform’ Category

Creating custom design-time preview for Flex 3 components

Friday, February 29th, 2008

Sometimes it is necessary to create custom preview of the component in the Flex Builder “Design” view.
It is undocumented feature ;-)
I’ve found very interesting class in the Flex SDK 3: mx.core.UIComponentGlobals.

This class contains static field designMode:Boolean.

Just check that field in your component code.
You can download example component with the source code from here:
http://anychart.com/tips_and_tricks/designMode/DesignModeComponent.zip

Also you can download the usage sample:
http://anychart.com/tips_and_tricks/designMode/DesignModeComponentSample.zip

Running in the Flex Builder “Design” mode it shows AnyChart image. But when it runs in the flash player it shows only gray rectangle.

ActionScript 3 compiller - - bug

Tuesday, February 19th, 2008

We have found a nice bug in mxmlc compiller :-)

var a:Number = 10;
var b:Number = 20;
var c:Number = a - - b;
trace (c);

It’s correct! Result is 30. But mxmlc ant task doesn’t compile this code sometimes…

It’s very surprising bug.

Flash player 9: relative url with colon and dot signs

Thursday, November 1st, 2007

Interesting in URLLoader and URLRequest.

If you are trying to load file using relative URL, that contains colon (”:”) and dot(”.”) in param values, you receive security error:

e.g.:
var request:URLRequest = new URLRequest("/test.flash?p=smth::else");
or
var request:URLRequest = new URLRequest("./test.flash?p=smth::else");

are not valid URL’s for Flash Player because flash player doesn’t escape “:” in urls.

You should use absolute URL’s for it:

e.g.:

var request:URLRequest = new
URLRequest("http://localhost:8080/test.flash?p=smth::else");

ACPrintManager 0.1 - library for content control of printing from a browser with some bug fixes for Firefox and Internet Explorer

Saturday, October 27th, 2007

As I promised I’ve uploaded source code for solving the problem with flash content printing in Firefox and an example of its usage in Flash.

FFPrintFix library was extended and now it is called ACPrintManager. Now it is not only bug fix for printing, but also content control for printing from a browser.

See all details here:
http://www.anychart.com/blog/projects/acprintmanager/

Solving problem with printing Flash content in Firefox browser

Sunday, September 23rd, 2007

I will let out a secret: we have solved a problem with printing Flash/Flex applications in Firefox :)

Here is the article how you can use it. ;-)

UPD1: http://www.anychart.com/blog/2007/10/27/ac-print-manager/
UPD2: http://www.anychart.com/blog/projects/acprintmanager/
UPD3: LGPL license

(more…)