Flash IDE Fonts not showing up problem

December 19th, 2012 by Slav

This is something that happened to me last week, some fonts (primarily open type fonts) just suddenly stopped showing up in Flash IDE. It was weird, as you could still select the text inside the textfield, copy and paste, but the font type outlines were not showing up in IDE or when compiled. It turns out, this was caused by a recent Microsoft Windows security update! Fortunately there’s easy way to fix this. Go to your Control Panel\System and Security\Windows Update at the left panel’s bottom there’s a link to Installed Updates. Click on that link and search for update : “kb2753842”. Right click on this update and select “Uninstall”. After the restart your fonts should be working again!

If the windows update dialogue comes back again, make sure to unselect this update and decline it for any other future updates .. (until MS releases a future fix for this mess).

Posted in flash | 5 Comments »

iOS apps installer (no iTunes needed)

December 17th, 2012 by Slav

Let’s face it, nobody in their right mind would describe developing applications for Apple as a “pleasant experience”. This is especially true when you’re on a PC. Especially when you compare developing android air app on PC and deploying it for testing on android device.  The amount of hoops apple makes you jump through and the effort needed to deploy your app on device just so you can test it is just downright discouraging.  The fact you need to use iTunes to deploy your app makes it very frustrating, as there’s a limit to a number of computers that are authorised to connect to certain devices, which is a pain if you have a multiple apple devices in the company, that we use for testing and debugging, and each of these when connected would have to be first sync, and depending on the size of your team de authorised from one computer to other, the whole deployment process just took too long and was a major pain.

Thankfully , since couple of month ago and version 3.4 of AIR we can deploy AIR apps directly to apple devices without using iTunes. There are couple of ways to do this – like using ANT scripts if you are using eclipse based IDEs, or command prompt, but none of them are very straightforward and user friendly.

That’s why me and my colleague Ben decided to make a GUI wrapper for this, that would make this matter of a simple drag and drop..

How does it work ?  Simples!

iosInstaller

 

  1. Run Setup.exe to install the app installer application.
  2. Start the application (it will check automatically at the start for usb connected apple devices) if your device wasn’t connected , connect it now, and click “Check connected devices” and make sure your device is found.
  3. Drag your app description xml file onto the app
  4. Drag Your compiled IPA file onto the app
  5. Press install on device.

That’s it!

It might take a minute or two , depending on the size of your app, but after the installation process is done you should have your app deployed on your device.

There are few caveats :

  • this installer works only with ONE apple device connected so make sure you unplug your other devices
  • if your ipa file wouldn’t deploy via iTunes, it won’t deploy via this app either. e.g. it will fail if there’s problem with certificate, or provisioning profile (for example make sure your device is added to the provisioning profile for your app)
  • it will only deploy adHoc profile applications, i.e. those compiled for testing on specific devices, and NOT the general distribution ones, (destined to be distributed via iTunes)

Posted in AIR, AS3, flash | 13 Comments »

Set transform to middle via JSFL

November 27th, 2012 by Slav

I just wrote a quick JSFL script for the Flash IDE that I though I’d share..

Example of situation where this could be useful.  You just imported a bunch of images from photoshop via PSD importer. All of those would have a bitmap inside of them , that would be left top aligned to registration point, and so would be his parent.

However, you’d like to have some of those bitmaps center aligned as you want to do some nice scale in / rotation tweening like this for example :

TweenLite.from(my_mc, .4, {scaleX:2, scaleY:2, rotation:90, alpha:0, ease:Back.easeOut});

Instead doing all of this manualy:

  1. double clicking on the clip to go inside it
  2. selecting a bitmap
  3. center align it
  4. making sure it’s on the whole pixel position (deleting .5 from x or y position)
  5. going out of edit mode
  6. selecting parent and moving it back by the half x and y width / height offset
  7. repeating this for all the elements you need to have center aligned!

you can simply right-click on this link and select “Save link as” and download it to your commands folder.

On win 7 this is : C:\Users\[YOUR PROFILE NAME]\AppData\Local\Adobe\Flash CS5\en_US\Configuration\Commands

Then in Flash IDE just select desired clips on your stage and select “CenterClipToMiddle” from the menu.

It will only work on one child in nested timeline of the MovieClips you select on a stage. I have automatic rounding of position as well both for parent and nested clip, so it will always be on a whole pixel value.

Any questions or suggestions for improvement just give me a shout in comments below.

Posted in AS3, flash, JSFL | 2 Comments »

Reading and settings scores to facebook app / game and my Adobe’s FB API update

March 22nd, 2012 by Slav

Majority of the calls you would ever make to Facebook API require user access token. There are some however, that require app access token instead. These are normally calls you do on behalf of the app not user. An example of such situation would be creating a test users, or reading Insight data.

To my surprise app access token is also required when you want to read or set user scores.

For those who are not aware of this, you can set and read score value for an app user.  For this to work, you have to set the type of your application to “Game”, in the FB developers app general settings page.

As current Adobe’s Facebook API didn’t support making such calls, I modified the source code (for web development) so that it would.

Btw, if anybody from the Adobe’s Facebook API administrators is reading this, please feel free to include these changes in your next version. You can download the modified source  here.

So how do you use this ? Here is the example how to set and read user scores, and also how to read scores of the users’s friends that have played the app/game. Read the rest of this entry »

Posted in AS3, Facebook, flash, Games | 24 Comments »

Publishing Open Graph actions to Facebook ticker with Flash

March 15th, 2012 by Slav

It has been a while since Facebook announced changes to their API , including the introduction of new customisable open graph actions. Probably most famous example being The Guardian app publishing : “Mike Nolan is reading : “How to grow a dandelion” article on Guardian. Or some other user “Is listening to Depeche Mode” on Spotify. While you can get plenty of tutorials on how to achieve this in HTML / PHP I haven’t been able to found any on how to do this in Flash. It might be that my googling skills are diminishing, or the fact that you actually can’t do this PURELY in flash. Why ? In a similar way the “share” functionality works , for this to work properly, Facebook must read html metadata from your page, and use them to construct the ticker update. You can however trigger publishing the action from flash and with a bit of php magic link deeplink from the published action  on ticker back to your app. Here’s how: Read the rest of this entry »

Posted in AS3, Facebook, flash, html5, php | 6 Comments »

More Unity3D to flash conversions

February 17th, 2012 by Slav

I recently downloaded the latest version of Unity 3D 3.5 demo – release candidate 1 to further test the flash export capabilities.  I have to say I was impressed and it’s certainly a big step forward – long list of bugfixes and some new implemented features speaks for itself.

To test the flash conversion I made the 2 demos.

Click on the images to play demos.

Car demo

First it’s just a very simple demo with high poly car model,  plane , camera and one directional light. I wanted to see how the dynamic shadows would be rendered and whether the high poly model would cause any performance issues.  It’s using standard fps controler and a mouse look for the camera. To get reasonable looking dynamic shadows shadow resolution had to be “Very high Resolution” and also Shadow distance in Quality settings had to be increased to 300. Otherwise shadow started to disappear if you moved even slightly away from the car with the camera.

PROs:

  • Model renders smoothly and fast enough (as expected if you have good GPU).
  • Lens flare effect on the light now renders correctly

CONs

  • There’s a banding effect on the shadowed area both on the floor texture or inside of the car
  • Some materials were not correctly transferred from the max files

Car racing tutorial demo

NOTE : PLEASE DRIVE SLOWLY OTHERWISE SCENE WILL STOP RENDERING!

This was the conversion of a racing game tutorial . This is of course much more complex example and there were multiple issues with this conversion. Quite a lot of issues had to do with terrain object, which is currently not supported for flash platform build target. Removing Terrain, solved about a half of the compiler errors, but I had to remove also parts of code that referenced it, and with it also code that check the rendering and hiding the objects that don’t need to be rendered.

There were compiler errors that had to do with classes of the same name being defined twice. For example SoundControler was a class in C sharp but also in Javascript. Or Skidmarks was defined as a C sharp class but existed also as a shader under the same name.

I think it’s a pity that Terrain object isn’t supported as it brings a lot of convenience to the environment creation. I think there already must be an algorithm to converted it to mesh and apply textures ? As GPU can only work with polygons ? Why not do that for flash conversion as well and have a settings to how much detail would terrain have?

Ok, so here are some cons and pros

PROs

  • car runs pretty smoothly all the physics and lightning works quite nicely
  • lens flare now works fine as well

CONs

  • the same banding effect on the shadowed areas
  • no car sound effects only when collision occurs
  • for some reason if you speed up with the car it will stop rendering scene (ok this one might have to do with me disabling some parts of the script to get rid of compiler bugs : – ) )
  • there’s a slight space between the shadow and an object casting that shadow (you can notice that on the wheels for example)
  • Even without terrain the demo has 22 MB. Non development build.

Other than that, it’s pretty sweet and playable (apart from speedy non render bug).

Posted in AS3, flash, Unity3D | 10 Comments »

Unity3D to Flash First Person Shooter game conversion

January 3rd, 2012 by Slav

Had some free time around Christmas, so I decided to have a look at Unity 3D since it looks like (at this time) only reasonable way to do 3D in flash. Yes there are other 3D engines out there like Alternativa, Flare 3D, Away 3D, but none of them have a visual editor that comes even close to the Unity’s IDE.
The version that supports export to flash have been around a few weeks now, so I thought I’d give it a try.

Firstly I did a scene with the high poly count that tested the GPU rendering. This was absolutely fine, as the performance relied heavily on the GPU.
One thing I noticed though, that Terrain object wasn’t being rendered ? I guess it’s because in Unity Terrain is more of an abstract construct / game object rather than actual mesh.. Although, I’d imagine it would make sense to converted to editable mesh for flash ?

Secondly I tried converting an existing FPS game. It was a FPS tutorial made by Graham McAllister.

You can see the result here.

The conversion was pretty straightforward, there were a few compiler errors that needed fixing, but nothing too major.

The game itself work quite allright, there are some bits missing (like the lines of fire from the automated shooting robots) , but I guess it could be down to me not having a pro version..

The swf file size is 8.6 MB which is pretty hefty compared to normal 2D games or websites, but then, it’s a complete game , with lots of textures, meshes and sounds.

Also absence of mouse lock is quite evident, but this is fault of the flash plugin, not Unity. Support for mouse lock is coming soon though!

All in all, this is still a preview version, I imagine a lot of things will be fixed , optimised , added.

So far I am quite impressed (well done Ralph and team !)  and we’ll see how will it compare to the Unreal Engine to flash conversion!

Posted in flash, Unity3D | 11 Comments »

End of Google’s Translate API.

June 1st, 2011 by Slav

Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 32 bytes) in /nfs/c02/h05/mnt/22224/domains/durej.com/html/wp-includes/post.php on line 1904