Using Adobe Scout to profile a Haxe/OpenFL flash export

I needed to do some profiling on an flash export of a mobile Haxe/OpenFL/HaxeFlixel based project. Since I own a license of the creative suite I decided to test Adobe Scout. But it didn’t work, there was no sign of Scout noticing the swf file running. After a bit of research I found out that you need to enable advanced telemetry in the SWF file to be able to use scout. Since Haxe didn’t seem to have a function for this I looked for an tool to do this. And yes, there was something like it:

SWF Scout Enabler: https://github.com/renaun/ActionScriptExamples/tree/master/SWFScoutEnabler

That’s full source of the Adobe Air application. Compile it and use it.

Or if you are too lazy for compiling, you can also download a .air file that was created by the author of SWFScoutEnabler:

http://renaun.com/air/SWFScoutEnabler.air

The link is mentioned in the read me of the Source Repository.

Android version of Haxe/OpenFL app not showing the icon after integrating Nuggeta

After integrating Nuggeta into a game it suddenly stopped having an icon. I’ve been verifying that the icons were existing, entered into the projects xml file and also that they were exported to the bin/android/res folder.

Everything was correct, but the icon still was the wrong one.

A close look into the file /{project folder}/templates/android/AndroidManifest.xml (part of the Nuggeta sekeleton) finally told me, why:

<application android:label="Fancy Game Title" android:debuggable="false">
</application>

The icon property was missing in the application node, so I added it:

<application android:label="Fancy Game Title" android:icon="@drawable/icon" android:debuggable="false">
</application>

Did a quick clean + build and the icon was working again.

Haxe/OpenFL: Iterating through Dynamic/Object using Reflect API

Here’s a simple example of how to use Haxes Reflect API to iterate through an Dynamic (Object):

public function setProperties(properties:Dynamic):Void{
  for (n in Reflect.fields(properties)){
    Reflect.setField(button, n, Reflect.field(properties, n));
  }
}

“button” is a SimpleButton object in this case but the same method also works for Sprites, MovieClips and other DisplayObjects.

  • Reflect.fields returns an array with the keys of the Dynamic Object.
  • Reflect.field allows to access the values using the keys.
  • Reflect.setField allows to set the values of an object using the keys. The bracket notation from Flash (button[n]=…) will not work.

Avast Anti Virus now trying to trick users into installing unwanted software using the software updater.

I just uninstalled the free version Avast Anti Virus from a private PC after I noticed they started trying to make their customers install unwanted software. Right now it was Pokki for Amazon, here’s how the offer looks.

avast-spyware-install

As you can see they greyed out the disable button which indicate that it’s disabled. And while it’s opt in, you are forced to select an option and Avast is trying to trick the user into pressing the button that installs the unwanted software by indicating there’s no other option. Such cheap behaviour that tries to trick users into installing software ruined that companies reputation for me. Avast seems to have no interesst in protecting the user from unwanted software installs anymore if they get paid for distributing it.

As for Pokki, that’s a software company that’s already known for offering software with spyware like tracking. For example they have a windows 8 startmenu replacement app that reports your exact usage of the start menu to their servers. Here’s an overview of their usage statistics for it:

http://www.neowin.net/news/pokki-has-had-500000-downloads-of-its-windows-8-start-menu-program

Ofc that doesn’t mean that Pokki for Amazon does the same things, I just tend to be very wary of companies that already showed the world they don’t really care about the users privacy. And having an anti virus software like Avast trying to trick me into installing software from that company makes me more then wary of the anti virus software.

So good bye, Avast. I can only warn users of using Free Avast Antivirus now that they accept such shady methods in their security software.

public static constants with Haxe

If you are looking for a Haxe replacement of flashs public static const you should be taking a look at the inline property. The inline property variable value is being applied at compile time. That means using it doesn’t cost any calculation time – and that the value is final und unchangable.

Here’s a simple example for the class having a few static constants:

package [...];
class StartMenuEvents{
	public static inline var START_EASY:String="START_EASY";
	public static inline var START_NORMAL:String="START_NORMAL";
	public static inline var START_HARD:String="START_HARD";
	public static inline var START:String="START";
 
	public function new(){
	}
}

And this is how the constants are being accessed:

startMenuUI.addEventListener(StartMenuEvents.START, onStartButton);

Fixing a problem with a broken xampp installation after a system reinstallation

I just had the problem that one of my old xampp portable apache installation stopped working after a fresh system reinstall. This is how I fixed it:

1. I disabled the Skype’s blocking of the ports 80/443. Read here.
2. I ran setup_xampp.bat to fix paths
3. I opened xampp/apache/conf/httpd.conf and replaced

ServerRoot “D:/xampp-portable-php5.4.22-apache2.4.7/xampp/apache”

ServerRoot "D:/xampp-portable-php5.4.22-apache2.4.7/xampp-portable-php5.4.22-apache2.4.7/xampp/apache"

by

ServerRoot "D:/xampp-portable-php5.4.22-apache2.4.7/xampp/apache"

Seems the xampp installation script doubled the folder name somehow.

After this the xampp installation was working again.

Flash CC – the best reason to switch to HAXE/OpenFL

Today I noticed that Adobe posted an update on what Flash CC changed compared to Flash CS6 on the adobe blog:

http://blogs.adobe.com/flashpro/2013/05/14/what-is-flash-pro-cc/

What’s already sad is that the article didn’t mention that Adobe dropped the Actionscript 2.0 support, which still is the standard in banner advertising. So if you are in the advertising field, be very carefull with upgrading, you will lose the ability to create or edit your AS2 work files. They also removed the kinematic bone tool, jsfl code hinting, the device central, the project panel and much more. Check the list posted here:

https://forums.adobe.com/thread/1248141

So what do you get for for losing all those features? These are the listed changes:

  • Optimized for 64bit macs
  • Automated higher resolution exports
  • The previously free CreateJS export plugin now is integrated
  • The GUI can be colored bright or dark
  • Better support for retina Mac displays
  • Batch exporting to multiple devices
  • Unlimited pasteboard/work area
  • Small GUI improvements for animators
  • A function to toggle comments
  • Build in Creative Cloud support for syncronizing flash settings over 2 devices

There’s also a improved html5 export function, but it’s far worse then the free google tool with the same aim, so I find it hard to take it serious.

This was the smallest most useless update in the history of flash. It’s no wonder that the public has the perception that Flash has been given up on. These updates are minor and only helping very few people. The removal of AS2 and various animator functions on the other hand hits animators of ad material hard.

So what’s the conclusion? Mine is keeping Flash CS6 and not upgrading to Flash CC since CS6 is better for animating – and that’s the only thing that Flash Professional is actually decent for.

For coding I switched to Haxe instead of Flash.

Why Haxe?

Haxe allows a user to develope with a language which was based on Actionscript at some point of time but was developed further while Adobe cancelled their language update AS4. It has frameworks for many tasks, is free, open source and has support for Android and iOs applications. It has proper commandline support, meaning you can easily integrate it into build systems, something that never was possible with Flash. There are more reasons, but the most important is being provided by Adobe themselves. They stopped doing proper improvements to Flash long ago while the Haxe developers are actively improving their product for many years.

As the supported platforms for Flashs are shrinking Haxe allow you to export to:

  • SWF (Flash)
  • Air (iOs+Android)
  • HTML5
  • native Android
  • native iOs
  • native Windows
  • native MacOS
  • native Linux
  • webOS
  • etc

There are frameworks like KHA for Haxe that support even game consoles:

http://kha.ktxsoftware.com/?systems

Here’s another interessting read:

http://www.gamasutra.com/blogs/LarsDoucet/20140318/213407/Flash_is_dead_long_live_OpenFL.php

Haxe Site: http://haxe.org/

How to fix Git Extensions not saving passwords

There is a bug in Git Extensions for a long time and even though the developers claim it has been fixed, I just got it again with their latest version.

If you get the “command not found error”, here’s how you fix it:

1. Open c:\[Users]\[Your Username]\.gitconfig in a text editor
2. Change

[credential]
helper = !\\\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\\\”

to:

[credential]
helper = !\”C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\”

3. Save

and done. I hope this bug gets fixed some day.

Warning of privacy choice policy maker

I’ve been trying to create a privacy policy for Android (Google Play) and iOs (Apple App Store) using the service privacychoice policymaker. It sends you through a multi step process asking you questions about your policies, then forces you to enter an email adress and a product name, telling you, they will send you the policy text by email.

Well, they didn’t send any emais. I tried it on two different email accounts (two different email providers) and waited for a few hours. Of course I double checked spam folders. Nothing for any of the email adresses arrived. So in best case they got issues with their email system that they can’t get under control – or in the worst case they are some fake service that collects email adresses for viagra spam or similar.

So better be carefull and use some throw away email adress with them if you wanna try your luck.

getting the nme-drawing stage example from phillip elsass to work on the latest Haxe/NME/OpenFL version

I did a quick test project to figure out a few things about the latest version of haxe/nme/openfl inside FlashDevelop. The targets of the test were:

- Get old Haxe 2 code to work in Haxe 3
- Convert project from NME to OpenFL so stableuix was compatible

As test project source I chose the nme-drawingstage example:

https://github.com/elsassph/nme-drawingstage

Some files contain the deprecated Haxe 2 way to expose variables. So replace

class X extends haxe.Public

with

@:publicFields
class X

Next I outcommented some code:

private static var initResources:Dynamic = (function() {
 
       /*var nme_set_resource_factory = nme.Loader.load("nme_set_resource_factory", 1);
       nme_set_resource_factory(function(s) {
         var reso = haxe.Resource.getBytes(s);
         if (reso==null) return null;
         return ByteArray.fromBytes(reso);
         });
		 */
      return null; } ) ();

FlashDevelop decides on the platform by the projects filename extension. If the file has a .nmml extension it’s a NME project, it has a .xml extension it’s an OpenFL project. So rename “project.nmml” to “project.xml”.

Then open project -> properties then replace “project.nmml” by “project.xml” in the “Output file” field.

project_xml

In the next step add the used libraries to the “project.xml” file:

<haxelib name="nme"></haxelib>

by

<haxelib name="stablexui"></haxelib>
<haxelib name="openfl"></haxelib>
<haxelib name="actuate"></haxelib>
<haxelib name="openfl-nme-compatibility"></haxelib>

Edit FD’s .hxproj configuration file:

Replace

<movie path="project.nmml"></movie>

by

<movie path="project.xml"></movie>

For auto completition to work, tell Flash Develop to use the following libraries in Project -> Properties -> Compiler Option -> Libraries:

stablexui
actuate
openfl-nme-compatibility
openfl

After that I still got two errors:

Error: Could not process argument Board.swf
Class name must start with uppercase character

But the project compiles fine and auto completition works properly.

Thanks to Phillipe for his friendly help at the FD forums:

http://www.flashdevelop.org/community/viewtopic.php?f=13&t=11717