Browsing articles tagged with "Flash Archives - Lorenzo Nuvoletta"

Build an App for iPhone or iPad with FlashDevelop

Mar 17, 2012   //   by Lorenzo Nuvoletta   //   AS3, Blog, iOS, Mobile  //  7 Comments

This guide contains the essential steps to build an App for iOS using FlashDevelop and Windows, I will not stop trying to explain what I am doing or why I am doing it, sometimes it gets so obscure that I don’t even know, just do it and it will work…. hopefully. Of course before you even start reading this make sure to pay the $99 fee to the Apple bloodsuckers to become an iOS developer.

Let’s Start

  • Install OpenSSL for Windows.
  • Create a new project with FlashDevelop selecting AIR Mobile AS3 App
  • Open CMD (Start, serach program cmd) and execute the following commands:
  1. cd C:\OpenSSL-Win32\bin (or wherever path you installed OpenSSL)
  2. set OPENSSL_CONF=c:\OpenSSL-Win32\bin\openssl.cfg
  3. set RANDFILE=.rnd
  4. openssl genrsa -passout pass:fd -out mykey.key 2048
  5. openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest -subj “/emailAddress=yourAddress@example.com, CN=Your Name, C=US” (Don’t forget to change your name and email)

Creating the Certificate

  • Go to https://developer.apple.com/ios/manage/certificates/team/index.action - Certificates->Development Tab, Click on Request Certificate and upload the file CertificateSigningRequest.certSigningRequest that is in your OpenSSL bin. Submit and refresh the page a couple of times until it says DOWNLOAD. Download that file and put it in your OpenSSL bin.

Adding the Device

Create App ID

  • Go to https://developer.apple.com/ios/manage/bundles/index.action and Click on New APP ID and add a name and an unique id. (Unique ID has to be the same you have in the application.xml in the FlashDevelop Project, that ID is set as default “air.MobileSomething” you should change it to something like “com.yourname.yourappname”, also remember to change the same APP_ID in SetupApplication.bat)

Create a Provisioning Profile

  • Go to https://developer.apple.com/ios/manage/provisioningprofiles/index.action and Click New Profile. Check everything, continue and refresh the page a couple of times until you see Download.
  • Download the file in the folder “cert” in your FlashDevelop Project.
  • Go to iTunes, File-Add File to Library… and import this file. (iTunes will not prompt you with any message, so to souble check you did it right try to reimport it).

Create the p12 file

  • Open CMD (Start, serach program cmd) and execute the following commands:
  1. cd C:\OpenSSL-Win32\bin (or wherever path you installed OpenSSL)
  2. set OPENSSL_CONF=c:\OpenSSL-Win32\bin\openssl.cfg
  3. set RANDFILE=.rnd
  4. openssl x509 -in ios_development.cer -inform DER -out developer_identity.pem -outform PEM
  5. openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out iphone_dev.p12 (When prompted to enter the password, write fd, or whatever password you used to create the key)
  • Copy the iphone_dev.p12 in your “cert” folder in the FlashDevelop Project

Setting the FlashDevelop Project

  • In the “bat” folder edit the file SetupApplication.bat

From line 18:

set IOS_DIST_CERT_FILE=cert\iphone_dev.p12
set IOS_DEV_CERT_FILE=cert\iphone_dev.p12
set IOS_DEV_CERT_PASS=fd
set IOS_PROVISION=cert\YourFileName.mobileprovision

Create the IPA

  • Execute the file PackageApp.bat in your FlashDevelop Project.
  • Select 8 “ad-hoc” and when prompted to enter password, enter: fd
  • Wait few minutes and you should see a IPA file in your “dist” folder
  • Import the IPA in iTunes and Sync.

 

At this point you should have your App running on your iPhone/iPod/iPad. This whole process is crazy, I don’t know why Apple doesn’t do anything to make it simpler. Try to do the same thing on Android it will take you not more than 5 seconds, but anyway, we all want to make the Apple gods happy.

For your reference I used this guides:

ConnorUllmann.com

Codeandvisual.com

Emanueleferonato.com

Stuff Flash artists should NOT do

Jan 31, 2012   //   by Lorenzo Nuvoletta   //   Art, Blog  //  7 Comments

People that worked with me knows that I kinda freak out when I notice that an artist is doing any of the below-listed things.

Following this small little rules can help your relationship with the engineering department and can also make you look cool!

The list

Do not use Groups

Actually remove the letter G from your keyboard otherwise that easy appealing CTRL+G will always tempt you. Using groups always leads to uncontrolled agglomerates of drawings all over the place, instead symbolize them, that way you have them in the library, and you can also reuse them. Done that you are already far ahead of the rest of your crew that didn’t read this.

Don’t draw twice the same stuff

This is where rule number 1 comes handy, instead use a movie clip sitting on the stage and copy/paste it.

Don’t create unnecessary layers

For example, imagine you have a popup with a bunch of buttons, text fields and some other art, you could potentially have a layer “Text”, one “Buttons and another one “Movieclips”. This is not really that important but it’s a nice to have.

Remove unused Guide layers

Ok, guide layers can be really helpful, BUT, if you don’t need them anymore just delete the layer.

Do NOT use masks

This is kinda tricky, setting a mask in Flash can really hurt performance if people abuses it, anybody trying to squeeze as much optimization as possible would try to find different solutions, leave the programmers the option to do that using code, and if they have no clue what to do tell them to RTFM or to use scrollRect for example.

Delete hidden art

If an element hides part of another element, delete that part of the second hidden element, even if you don’t see it doesn’t mean that Flash is not processing it, for example if I have 2 circles overlapping each other, you will see it as one circle, but flash will process it as 2 circles. It also helps the size of the final SWF.

Use lines instead of brush tool for outlines

And remember to set the outline hinting. A line is waaaaay faster to be drawn than a pseudo line drawn with a brush. Although if you really need to use the brush becouse you want to give it some special effect that you can’t with a simple line then this tip can be voided.

Do NOT scale Text Fields

This is very bad, and can waste hours of debugging trying to figure out why the heck that textfield is rendering all the character out of whack, especially in those cases where localization and translations are being used, so always make sure that your textfields are set to 100% scale.

Control your Fonts

A font library can occupy far more than what you expect, use them with moderation.

Don’t use Simple Buttons

They are obsolete and unmanageable, I think Adobe still keeps them in only so that amateurs can make stuff that looks like buttons.

9 sliced is your friend

The 9 sliced is a weird named option under the properties of a movie clip, but it is pretty cool, you can decide what portion gets scaled and omit the borders, perfect for reusing a background with different sizes!

Filters super suck performance

But they are super cool too, I know, especially the glowing, I love the glowing, but anyway IF possible do not use them, some times you can achieve the same effect with less sucking techniques.

Don’t code in the Timeline

Every time an artist writes code in the timeline an angel dies.

Clean the library

The FLA library is like your bedroom, it says everything about you, and you are about to share all your secrets with the entire engineering department. You want to, at least, hide the socks!

Simple Inverse Kinematics

Jan 29, 2012   //   by Lorenzo Nuvoletta   //   AS3, Blog  //  No Comments

I have been looking for a while with interest at how inverse kinematics works, on Wikipedia I found this page regarding the Law of cosines which sounds interesting, although looks overly complicated.

Other methods to take in consideration are the Cyclic-Coordinate Descent (CCD) solution and a Jacobian matrix iterative solution.

I have been able to determine the exact position of multiple joints using a mix of those, but the resulting algorithm looks ugly at least.

So while I am looking to find a cute one enjoy this piece of code to calculate IK on 2 joints. :)

Pages:12»
October 2014
M T W T F S S
« Mar    
 12345
6789101112
13141516171819
20212223242526
2728293031