Showing posts with label flashbuilder. Show all posts
Showing posts with label flashbuilder. Show all posts

Monday, January 30, 2012

unable to open 'C:\... libs\player\9.0\playerglobal.swc' - Solution

If you ever see an error unable to open 'C:\... libs\player\9.0\playerglobal.swc' in your Problems tab maybe below is a solution for you.
I found this situation while importing some projects. I'm still using flex builder 3 while project has been imported from flash builder 4 where was SDK 4.1. I'm not sure why, but somehow during import some old sdk was used as default. Of course I switched it to the good one but then this error occurred.

The fastest way is to set, and later unset requiring a flash version in compiler tab in project properties.
All you have to do is to check 'Generate HTML wrapper file.
Check Require Flash Player version ans set at least major number to 10.
Press Apply.
Uncheck 'Generate ...' so it will turn off.
It's done!




Friday, November 11, 2011

Problem with updating SDK in Flash builder - Flash player version

I've added another version of  SDK to my Flash builder. It's easy as CTRL+C, CTRL+V. But afterwards my projects were complaining that they don't see flash player and throws error with playerglobal.swc in it's title.

I have to mention that I was switching from sdk 3.5 to 4.1 so automatically I had to upgrade player form version 9 to 10.

In my project properties I had unchecked generating html site with embedded flash like on screen below. I thought if it is disabled IDE is not taking this into consideration. WRONG!
When I:

  1.  selected "Generate HTML wrapper file"
  2. put new version of flash player (10.0.0 instead of 9.0.124)
  3. pressed "Apply"
  4. unselected "Generate HTML wrapper file"
Errors dissapeared.

One more thing. I'm not using html wraper file. I'm not sure how it works when you have it selected. Maybe it'll update automatically. If not do it manually but with ommiting points 1 and 4 from my list.

Tuesday, May 31, 2011

A lot of useless files in output folder

I was wondering why does flex builder (flash builder also) generates so many empty folders in my debug output folder. I found there whole structure of folders while they were empty cause they included only source files. I found that it's easy to clear it. In Poperties on ActionScript Compiler window you have to uncheck Copy non-embeddded files to output folder



Thursday, April 28, 2011

VerifyError: Error #1053: Illegal override of z in mx.core.BitmapAsset.

Have you ever got error like in title? I was wondering what's the problem. I've checked everything twice. Spent on this some time. Solution? Check version of flash player and SDK that you're using. I had Flash player 10.1, I was compiling to 9.0 but was using SDK 4.2

Wednesday, March 30, 2011

Adjusting SWF parameters for ActionScript Project

While creating ActionScript Project in Flex builder (Flash builder) You have no .fla file where it's possible to set background color or dimensions.

Eitherway it's possible to configure those settings. To define them add line like this:

[SWF(width="800", height="600", backgroundColor="#ffffff", frameRate="30")]

before main class definition.

Thursday, February 24, 2011

Embedding fonts

Embedding fonts is quite easy. Here is example:

Firstly, we have to embed font. In this case my path is relative. mimeType is not manatory, but it's good practise to fill it.

[Embed(source='assets/MyFont.ttf', fontName="Font_MyFont", mimeType="application/x-font-truetype")]
private static var stringForHoldingFont:String;

Variable from above is not used anywhere. It's just for holding glyphs.

Here comes our field, where we use embedded font
private var _title:TextField;

_title = new TextField();

var style:TextFormat =  _title.getTextFormat();

Type of font is set in TextFormat. We can create new or copy existing one. And here comes most important part. We set name from embed. And in textfield object (not TextFormat!), we setembedFonts property to true. Otherwise there will be no result.


style.font = "Font_MyFont";
_title.embedFonts = true;

When we set format for field this should work.


_title.setTextFormat(style);
_title.defaultTextFormat = style;

If You are using Flex builder / Flash builder as IDE remember to set font manager for project. Otherwise it won't work. To do this choose project properties -> 'ActionScript Compiler' and as 'Additional compiler arguments' put
 -managers flash.fonts.AFEFontManager 
like on this screen:

Remember to check it on device where this font is not installed. For example if You forget to set property embedFonts this will work on computer where you have this font (like probably your computer).