DocumentClass

By , June 1, 2011 8:04 pm

Document Class Example from Advanced Seminar.

http://blog.flashvt.com/wp-content/uploads/2011/06/DocumentClassSampleCS5.zip

Flash to Android/iPhone workshop

By , April 6, 2011 10:32 am

Thanks to everyone who cam to the workshop last night. I would say there were at least 25 people there. Here are the notes from the talk:

Setting up Air 2.6

-Download AIR 2.6 SDK (software development kit):
http://www.adobe.com/products/air/sdk/
-unzip the sdk
-I created a folder named SDKs and put the Air 2.6 SDK here: C:\SDKs\AdobeAIRSDK

Setting up ADT (Air Developer Tool)

AIR Developer Tool (ADT) has replaced Packager for iPhone (PFI), and the PFI utility is now integrated nto ADT. You can now use ADT to package AIR files, native desktop installers, Android applications, and iOS ap.
-Let’s get ADT working, 1st we need to set up some Environment Variables
-1. Click Start Menu> right click computer>properties.
-2. Click Advanced System Settings.
-3. Click Environmental Variables.
-4. Scroll through system variables until you find: Path, select it.
-5. Click edit.
-6. Add ;C:\SDKs\AdobeAIRSDK\bin to the end of the variable value. (please note the semicolon in front of the path)

-Click OK.
-Click OK.
-Click OK.

-Let’s try ADT(Air Developer Tool)
-open up the command prompt, start menu>type cmd in search field, press ENTER.
-type: adt -version in cmd, press ENTER

You will probably get an error like this unless the Environment Variable for Java has been set:
‘java’ is not recognized as an internal or external command, operable program or batch file.
-Close the CMD by typing exit and then press ENTER.

If you received the error, you will need to make sure you have java installed and then set the Path variable just like we did for the Air2.6 SDK.
Find java on your computer, mine was located here:
C:\Program Files (x86)\Java\jre6\bin
-add a semicolon in front of it: ;C:\Program Files (x86)\Java\jre6\bin
-Now repeat the steps we did for setting the path of the Air2.6 SDK.

Let’s try ADT again.
-open up the CMD prompt
-type adt -version
-press ENTER.
It should output: 2.6.0.19120
Yeah! ADT is working.

Create the app

Open up Flash and create a new Actionscript 3.0 flash file.
-save it to the root folder for this project, I saved as HelloWorld.fla
-add some content, I just typed HelloWorld, and then test.
-you should now have a HelloWorld.swf in your projects root folder.

Create the self-signing certificate-Android

-We are going to create a new flash file to create a signing certificate.
-Instead of creating a Actionscript 3.0 flash file, choose Adobe Air 2 as the type.
-1. once it’s open, in the document properties, Click edit next to Air 2.5 (or 2.0) settings
-2. Click the signature tab
-3. Click the Create tab.
-4. Enter your info, make up a password and remember it. You will you the pw in your adt command.
-5. Click Browse and select your projects root folder.

-Click OK.
-Click OK.
- wait a second…a dialogue box will pop up that says Self-signed certificate has been created.
-Click OK.
-Click OK.
-You will now have a file, mycert.p12 in your projects root folder.
-Close the Air 2 flash file. It does not need to be saved. We just needed it to create mycert.p12.

Create the signing certificate-iPhone

This is a much longer process, please review this post:
Air 2.6 and iOS using FlashDevelop and CS5 on Windows 7

Create the descriptor file.

You can use any editing program that supports xml files, I used FlashDevelop. You could use Notepad.
The files are basically the same between Android and iPhone.
-The file should be saved as an xml file.
-A typical naming convention for this file is yourappname-app.xml, ex: helloworld-app.xml
-save this file to your projects root folder.

Descriptor files

Android

<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/2.6" minimumPatchLevel="0">
	<id>com.flashVT.HelloWorld</id>
	<name>Hello World</name>
	<filename>HelloWorld</filename>
	<versionNumber>1.0.0</versionNumber>
	<initialWindow>
		<content>HelloWorld.swf</content>
		<aspectRatio>portrait</aspectRatio>
		<autoOrients>false</autoOrients>
		<fullScreen>true</fullScreen>
		<renderMode>gpu</renderMode>
	</initialWindow>
	<supportedProfiles>mobileDevice</supportedProfiles>
	<android>
		<manifestAdditions>
			<![CDATA[
				<manifest android:installLocation="auto"/>
			]]>
		</manifestAdditions>
	</android>
	<icon>
		<image36x36>icons/36x36icon.png</image36x36>
		<image48x48>icons/48x48icon.png</image48x48>
		<image72x72>icons/72x72icon.png</image72x72>
	</icon>
</application>

iPhone

<?xml version="1.0" encoding="utf-8" ?>
<application xmlns="http://ns.adobe.com/air/application/2.6" minimumPatchLevel="0">
	<id>com.flashvt.HelloWorld</id>
	<name>HelloWorld</name>
	<versionNumber>1.0.0</versionNumber>
	<filename>HelloWorld</filename>
	<initialWindow>
		<content>HelloWorld.swf</content>
		<title>HelloWorld</title>
		<fullScreen>false</fullScreen>
		<renderMode>gpu</renderMode>
	</initialWindow>
	<supportedProfiles>mobileDevice</supportedProfiles>
	<icon>
		<image29x29>icons/29x29icon.png</image29x29>
		<image57x57>icons/57x57icon.png</image57x57>
		<image512x512>icons/512x512icon.png</image512x512>
	</icon>
</application>

Create your icons

Use your favorite image creation tool to create some icons for the app. In my sample, I saved them all, except for the Default.png (iphone only) to an icons folder in my projects root folder. Please not the paths in the descriptor xml files as well as in the ADT command line below.

Android

Iphone

The Default.png is for the load screen and is only used for the iphone.

Building your app with ADT command line

-replace the items in bold with your names.
-All files should be in the same root folder, you can have sub folders ex:icons/72x72icon.png
-you will need the following files in your root folder:
-Android: HelloWorld.swf, helloworld-app.xml, mycert.p12, any icons that you created.
-iPhone: HelloWorld.swf, helloworld-app.xml, mycert.p12, helloworld.mobileprovision, any icons that you created, Default.png.
-We want to open command prompt from your projects root folder.
-Browse to your projects folder through windows.
-shift/Right click in the folder and select open command window here

Command for Android:
adt -package -target apk -storetype pkcs12 -keystore signingCert.p12 -storepass yourPassword NameOfApk.apk Descriptor-app.xml app.swf icons/36x36icon.png icons/48x48icon.png icons/72x72icon.png

This will create NameOfApk.apk in your projects root folder. It might take a few seconds to compile. You can now install this on any Android phone. Please note, you will also need to install Air2.6 on your phone which is available for free in the Android Market.
-Also, please note, there is a setting on your Android phone to allow Developer apps. I believe it is under general settings. Please check this.
That’s it for android!!!

Command for iPhone:
adt -package -target ipa-test -storetype pkcs12 -keystore iphone_dev.p12 -storepass 12345 -provisioning-profile flashVT.mobileprovision HelloWorld.ipa iPhone-app.xml HelloWorld.swf finalIcons/icon_512x512.png finalIcons/icon_29x29.png finalIcons/icon_57x57.png Default.png

This will create HelloWorld.ipa in your project’s root folder. This process may take 2-3 minutes to process and the command prompt will not give any feedback until it is complete. Be patient.
You can now install this in the iPhone/iPod/iPad that is associated with the IUID number.
-To install, connect your device to your computer, make sure all your apps are synced in iTunes.our
-Click file>add file to library and choose your mobileprovision file.
-Click file> add file to library and choose helloworld.ipa.
-sync your phone
That’s it for iPhone!!!

Tile-based Platformer Part I

By , April 5, 2011 2:24 am


I have been meaning to create a tile-based platformer engine in AS3 forever. Since we were covering tile-based platformers this week in Game Tech I, I thought I would start my engine. This engine is derived from the classic TonyPa tutorials: AS1 version circa 2003 and AS3 version. I have made some different choices in how I am coding the engine, put please read the TonyPa’s tutorials to understand the overall concept.

I will try to add more features in the near future, but this is a start. All source files are located here. Part I has 9 versions that build up to the version you are seeing above. (use the arrow keys to move your blue square).

AVID Chainless Challenge Launches in app store

By , March 29, 2011 10:11 am

AVID Chainless challenge is a game developed by Tag New Media and JDK for Avid. Avid, whose parent company is Sram, is one of the worlds leading bike component makers. We started this project in mid January and the app was accepted into the iTunes store on March 25th. The entire project took just over 2 months.

Here’s a link to the game in the app store. (the game is very hard, but you will get better if you practice) We are hoping to do some more versions of this game in the future.

The game was created using FlashDevelop, AS3 and Flash CS5.

Air 2.6 and iOS using FlashDevelop and CS5 on Windows 7

By , March 26, 2011 12:54 pm

So after searching for info on how to compile an iPhone app with Air 2.6 and CS5, I thought I would share my knowledge. My work flow is typically to code in Flash Develop and publish with Flash CS5. I have been using the iPhone packager in CS5 to compile apps but that is not an option with Air 2.6. It was really hard to find all the documentation for this process in one place so here are my findings/link.

You will need to use ADT (Air Developer Tool) to package your iPhone app, you will also use this tool for Android as well. You will not use the packager built into cs5 anymore. You can still work in CS5/FlashDevelop and you will still publish the swf there if that is what you typically do.
It was actually hard to find info on the Adobe site about ADT, but this was the best link: AIR Developer Tool (ADT) ADT is included with the Air 2.6 SDK. Below is a list of the steps needed to publish your 1st Air 2.6 iOS app.


I have covered steps 1 and 2 in great detail in the following Google document:
Flash to iPhone Steps Please Note: Step 1 and 2 will take a little while to do (plan for at least an hour if not more), thanks Apple!

1. You need to get an Apple Developer’s License. This costs $99usd for an individual or company. If you are a student at Champlain College, we are part of the iOS Developer University Program. Just shoot me an email letting me know that you want to sign up. Otherwise, you can get your developer’s license at http://developer.apple.com/.

2. You will need to create a development certificate and a development provisioning file at the iOS provisioning portal.

3. Download the Air 2.6 SDK
After downloading and unzipping the SDK, I saved it to here: C:\SDKs\AdobeAIRSDK

4. You will now need to set the PATH so windows will be able to find the Air 2.6 SDK. Please follow these instructions.

5. Open a command prompt: go to the start menu and then type cmd in the search field and click Enter. The command prompt should now be open. Check to see if you can access ADT (Air Developer Tool). Type: adt -version and click Enter. It should output: 2.6.0.19120.

6. More to come…

Sample descriptor file

Useful Links
Developing AIR applications for mobile devices
Creating your first AIR application for iOS
AIR application descriptor elements
Setting mobile application properties (descriptor file)

GameJame IV: Game at the end of 48hrs

By , January 31, 2011 12:12 am

Mate or Die
My GameJam consisted of Friday 5PM -3AM and Sun 9AM – 3PM (16hrs). On Saturday my oldest son turned 8 and we hosted a sleepover. Needless to say, nothing was accomplished on Sat. I will try to find some time to finish it off, but the game is playable and relatively complete. Special thanks to Alex Schwartz for creating some last minute game assets.
Player 1 controls: Arrow keys and Space to select card.
Player 2 controls: WASD and Q to select card.

GameJame III: Added the Player and basic memory game logic

By , January 29, 2011 3:21 am

http://globalgamejam.org/
Use the arrow keys to move your player.
Press the SPACEBAR to flip a tile.
Try to match up the numbers.
Time for bed.

GameJam II: Cards are flipping and shuffling

By , January 28, 2011 10:21 pm

http://globalgamejam.org/
Making some progress, cards are now flipping and I added some shuffling for testings. Thanks to soulwire for the PaperSprite class. Next up, limiting to 2 flips per turn and checking matches.

GameJam I: Global Game Jam has started at Champlain

By , January 28, 2011 8:42 pm

http://globalgamejam.org/
The theme is Extinction.
So far I am working solo. I will document as I go. Looking for an artist to create some nice cuddly 2d animals that blow up.
Here’s the gameboard (actual size 1000×1000);

Sample Maze Game Part I

By , January 19, 2011 12:06 pm

This sample has all the basic requirements for Part I of the
maze assignment for Game Technology I.

Here is the source file.
Below is what the the update function looks like:

//the update function is called from the ENTER_FRAME event
//it will position the square and check for hits
function update(e:Event)
{
	//position the square where the mouse is
	square.x=mouseX;
	square.y=mouseY;

	//check for hitting maze using hitTestPoint.
	//hitTestPoint takes 3 parameters (x location, y location, true or false)
	//we set the 3rd parameter to true so that the hit ignores the bounding box
	var hit:Boolean = maze.hitTestPoint(square.x, square.y, true);

	//if hit is true, end the game
	if(hit)
	{
		//end game
		endGame();
		return;//return ends the function, we don't
		//need to check the rest if the game is already over
	}
	//OK, we didn't hit the maze, let's check to see if
	//we hit the star
	hit = star.hitTestObject(square);
	//if we hit the star, call the winGame function
	if(hit)
	{
		//end game
		winGame();
	}
}