fullScreen doesn’t work?

March 10th, 2011 by admin » (0) » AS3

You have a fullscreen-function that just won’t work.

stage.displayState = StageDisplayState.FULL_SCREEN;

No matter what you try… it doesn’t seem to work out. The first thing you should check is, whether you have the Debug Player installed. And if you have, you might get a Security Error, that says, Fullscreen Mode is not allowed…

Adobe Debug Player shows Security Error

Debugger shows Security Error for Fullscreen

The answer is, that entering the fullscreen mode isn’t allowed through a MouseEvent.MOUSE_OVER, you should use a proper CLICK-Event.

Instantiation attempted of a non-constructor

October 28th, 2010 by admin » (0) » AS3

Something that might help you save some precious time of your life.
If you get this error with (perhaps) a class you’ve coded, try this:

Don’t give the variable the same name as the class you want to instantiate…

var MyClass = MyClass();

is bad.

var varName = MyClass();

will probably work.

Workaround CS5 component number problem

July 12th, 2010 by max » (1) » AS3

I came across this problem last week and it drove me nuts!

I had a draggable component with a numerical value for its drop-coordinates. When I entered the first coordinate 0|0, it worked perfectly. But changing this to 10|20 didn’t work anymore. I debugged, and found that the dropX and dropY were »NaN«.

I couldn’t find anything on the net so I tried more. I reopened it in Flash CS4 and found that the value weren’t 10|20, but 10,00|20,00. So I started working around and got to this »solution«:

Instead of typing 10 i tried 0,10 and that works. But only for values up to 99!

I’m not shure whether this is a Number/Integer/Float-problem that I messed up, or if the new Mac OS X 10.6 Flash CS5 IDE has a bug. Anyone firm with datatypes that knows the answer?

Firefox messes up @ in dynamic TextField

December 7th, 2009 by max » (0) » ActionScript

This cost me precious time of my life, no one ever will give me back. Very short: some early versions of FF3.5 (and users don’t always update) do have following bug: dynamic textfields (with font embedded) don’t accept @ as an value, but display (and sends to DB) »q« (on Win) instead (I read, that it has problems with some more special characters).

Solution: turn off

wmode = "transparent"

for the SWF or force update to FF3.5.3

Pitfalls with mailto-Links in Flash

October 20th, 2009 by max » (3) » AS3

In my last project I had some issues with IE8 (at customer-side), Mail (on agency-side) and my way of placing mailto-links.

In this project, the email-address and the subject come from a XML. This was my first setup:

XML-Node

<node contactAddress="support@acme.com" contactSubject="Kontakt über Homepage">

(Please notice: the german »Umlaut« in the subject)

AS3 (excerpt)

private function mailto(e:MouseEvent):void {
var mailaddress:String=XML.node.attribute("contactAddress");
var mailsubject:String=XML.node.attribute("contactSubject");
navigateToURL( new URLRequest( "mailto:"+mailaddress+"?subject="+mailsubject));
}

So, let’s see, what happened with different clients on different OS:

IE7, IE6, FF, Safari on WinXP worked without any problems (with Outlook Express). IE8 on WinXP opens a new Window with an error message (»Navigation wurde abgebrochen« / »Navigation to the webpage was canceled«), but opens Outlook (Express and Outlook 2007) with correct recipient and correct subject.
Every browser on Mac opens up Mail, but didn’t open a new eMail with recipient or subject.

To cut a long debugging-story short: please no german umlauts in mailsubject, so changing the XML-node the following mail, solved the problem:

<node contactAddress="support@acme.com" contactSubject="Kontakt per Homepage">

Nice, but still IE8 opens up a ugly window with the cancelation message. The solution here was the target-attribute of the navigateToUrl-Method: default is “_blank”, which I thought was the correct way to handle it, because I didn’t want the page to unload, if the mailto-Link was clicked. Turned out, that when you use the code in following way, the page doesn’t unload and new tabs/windows are surpressed.

private function mailto(e:MouseEvent):void {
var mailaddress:String=XML.node.attribute("contactAddress");
var mailsubject:String=XML.node.attribute("contactSubject");
navigateToURL( new URLRequest( "mailto:"+mailaddress+"?subject="+mailsubject), "_self");
}

Conclusion: don’t use Umlauts (and probably no other special characters) with OS X, don’t use “_blank” or default.