Posts Tagged: actionscript


25
Jun 12

iOS application descriptor file notes

Just some notes to myself and perhaps other people about the application descriptor file and the settings it allow you to configure.

language settings (AIR 3.2)
You can specify the language your app supports including app descriptions in all supported languages. Add snippet below

1
<supportedLanguages>en</supportedLanguages>

more or less anywhere in the rootnode (application) of the application descriptor xml. If your app supports more languages, seperate them with comma’s. Your app does not show up in the appstore in other languages.
(via and more on: http://www.flashrealtime.com/supported-languages-adobe-ai/)

Icons without the default glow
If you want the icon of your app without the default glow Apple adds to it, add line 8 of the snippet below to the InfoAdditions element (at the bottom of the application descriptor)

1
2
3
4
5
6
7
8
9
10
11
<iPhone>
    <InfoAdditions>
    <![CDATA[
       <key>UIDeviceFamily</key>
       <array>
         <string>1</string>
       </array>
       <key>UIPrerenderedIcon</key><true/>
   ]]>
    </InfoAdditions>
</iPhone>
Low res assets (480×320) fullscreen on high res (960×640) iPhone screen
Add following snippet to the iPhone element shown above.

1
<requestedDisplayResolution>standard</requestedDisplayResolution>

Looks crap while testing on the desktop; The graphics only cover the top-left quarter of the full resolution, but on the device it will be OK.


10
Nov 11

Determine iOS device type with ActionScript 3.0

Since I couldn’t find any articles offering the following solution to the problem of figuring out what specific iOS device an AIR app is running on I figured I’d post this short one.

For a current project I need to know what version of the iPad an AIR app is running on. I saw solutions measuring screen resolutions to get info whether an app runs in iPhone or iPad, but no posts on differentiating between iPad 1 and iPad 2. The Capabilities class seems to have the solution. Below is the output of the

property for the iPhone 4, iPad 1 and iPad 2.

iPhone 4 gives you:
iPhone OS 5.0 iPhone3,1

iPad 1 gives you:
iPhone OS 4.2.1 iPad1,1

iPad 2 gives you:
iPhone OS 5.0 iPad2,1

This info breaks down into:

  • The OS (the name apparently always is iPhone OS) with it’s version number (the iPad one in my case still running iOS 4)
  • The device id which holds the device name and the device ID

The device name and its ID apparently are different as for example the System Status reports. System Status for instance has “iPhone 4″ listed as being the Device and “iPhone3,1″ as the Device ID. The device IDs for the iPad are more descriptive, but once you know what to look for it does not really matter what it lists I guess…

Anyone have the info for the iPhone 3?


1
Apr 11

Random and constrained circular motion

For a small project in the near future I could need some objects to move fairly random, but constrained to a specific area. After a quick look on the web I thought of something I read before but could not find anymore. It involves movement aided by two circles and is (IMHO) really easy to grasp. Here’s a quick explanation.

Imagine (if you can’t, there a picture below doing it for you) one circle in the middle. OK, now imagine another circle centered on the edge of the first. This second circle moves over the circumference of the first, thus describing a circular motion. Now place something on the edge of the second circle and have it move over it’s circumference. Depending on the size of the circles and the rotation speeds the object on the outer circle describes a lot of different motions looking a bit like a spirograph.

The two circles and the moving object (blue)

In the above image, the red circle is the first one. The green one moves over the circumference of the red one. The blue dot moves over the circumference of the green circle. It cannot get outside of the blue circle.

This however is a very regular motion. Not what I had in mind or promised you with the title of this post. There’s no long explanation to it, so I’ll get to it right away: To make the motion random, just have the direction of both the rotations alter at random intervals. Not to often or the final object moves in a jittery fashion (and may not even leave it’s position), not to few or the object moves to predictable. In the example below you can alter the frequency of the direction change as well as the speed of rotation (with thanks to http://www.minimalcomps.com/).

Get Adobe Flash player

Right-click on the flash file to view the source files.